summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/mapboxgl
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/geoservices/mapboxgl')
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp38
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h4
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h4
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp219
-rw-r--r--src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h11
5 files changed, 0 insertions, 276 deletions
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
index e00369a7..95e53581 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp
@@ -52,7 +52,6 @@
#include <QtLocation/private/qdeclarativepolygonmapitem_p.h>
#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
#include <QtLocation/private/qdeclarativerectanglemapitem_p.h>
-#include <QtLocation/private/qgeomapparameter_p.h>
#include <QtLocation/private/qgeoprojection_p.h>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QSGImageNode>
@@ -177,31 +176,6 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w
return node;
}
-void QGeoMapMapboxGLPrivate::addParameter(QGeoMapParameter *param)
-{
- Q_Q(QGeoMapMapboxGL);
-
- QObject::connect(param, &QGeoMapParameter::propertyUpdated, q,
- &QGeoMapMapboxGL::onParameterPropertyUpdated);
-
- if (m_styleLoaded) {
- m_styleChanges << QMapboxGLStyleChange::addMapParameter(param);
- emit q->sgNodeChanged();
- }
-}
-
-void QGeoMapMapboxGLPrivate::removeParameter(QGeoMapParameter *param)
-{
- Q_Q(QGeoMapMapboxGL);
-
- q->disconnect(param);
-
- if (m_styleLoaded) {
- m_styleChanges << QMapboxGLStyleChange::removeMapParameter(param);
- emit q->sgNodeChanged();
- }
-}
-
QGeoMap::ItemTypes QGeoMapMapboxGLPrivate::supportedMapItemTypes() const
{
return QGeoMap::MapRectangle | QGeoMap::MapCircle | QGeoMap::MapPolygon | QGeoMap::MapPolyline;
@@ -447,9 +421,6 @@ void QGeoMapMapboxGL::onMapChanged(QMapboxGL::MapChange change)
for (QDeclarativeGeoMapItemBase *item : d->m_mapItems)
d->m_styleChanges << QMapboxGLStyleChange::addMapItem(item, d->m_mapItemsBefore);
-
- for (QGeoMapParameter *param : d->m_mapParameters)
- d->m_styleChanges << QMapboxGLStyleChange::addMapParameter(param);
}
}
@@ -490,15 +461,6 @@ void QGeoMapMapboxGL::onMapItemGeometryChanged()
emit sgNodeChanged();
}
-void QGeoMapMapboxGL::onParameterPropertyUpdated(QGeoMapParameter *param)
-{
- Q_D(QGeoMapMapboxGL);
-
- d->m_styleChanges.append(QMapboxGLStyleChange::addMapParameter(param));
-
- emit sgNodeChanged();
-}
-
void QGeoMapMapboxGL::copyrightsChanged(const QString &copyrightsHtml)
{
Q_D(QGeoMapMapboxGL);
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h
index 0418adb7..2d16172f 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h
@@ -43,7 +43,6 @@
#include "qgeomappingmanagerenginemapboxgl.h"
#include <QtLocation/private/qgeomap_p.h>
-#include <QtLocation/private/qgeomapparameter_p.h>
class QGeoMapMapboxGLPrivate;
@@ -72,9 +71,6 @@ private Q_SLOTS:
void onMapItemUnsupportedPropertyChanged();
void onMapItemGeometryChanged();
- // QGeoMapParameter
- void onParameterPropertyUpdated(QGeoMapParameter *param, const char *propertyName);
-
public Q_SLOTS:
void copyrightsChanged(const QString &copyrightsHtml);
diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h
index 6098a5e1..3073f863 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h
+++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h
@@ -48,7 +48,6 @@
#include <QtCore/QVariant>
#include <QtCore/QRectF>
#include <QtLocation/private/qgeomap_p_p.h>
-#include <QtLocation/private/qgeomapparameter_p.h>
class QMapboxGL;
class QMapboxGLStyleChange;
@@ -64,9 +63,6 @@ public:
QSGNode *updateSceneGraph(QSGNode *oldNode, QQuickWindow *window);
- void addParameter(QGeoMapParameter *param) override;
- void removeParameter(QGeoMapParameter *param) override;
-
QGeoMap::ItemTypes supportedMapItemTypes() const override;
void addMapItem(QDeclarativeGeoMapItemBase *item) override;
void removeMapItem(QDeclarativeGeoMapItemBase *item) override;
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
index c094d51b..97a4cf39 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp
@@ -196,43 +196,6 @@ QList<QByteArray> getAllPropertyNamesList(QObject *object)
} // namespace
-// QMapboxGLStyleChange
-
-QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapParameter(QGeoMapParameter *param)
-{
- static const QStringList acceptedParameterTypes = QStringList()
- << QStringLiteral("paint") << QStringLiteral("layout") << QStringLiteral("filter")
- << QStringLiteral("layer") << QStringLiteral("source") << QStringLiteral("image");
-
- QList<QSharedPointer<QMapboxGLStyleChange>> changes;
-
- switch (acceptedParameterTypes.indexOf(param->type())) {
- case -1:
- qWarning() << "Invalid value for property 'type': " + param->type();
- break;
- case 0: // paint
- changes << QMapboxGLStyleSetPaintProperty::fromMapParameter(param);
- break;
- case 1: // layout
- changes << QMapboxGLStyleSetLayoutProperty::fromMapParameter(param);
- break;
- case 2: // filter
- changes << QMapboxGLStyleSetFilter::fromMapParameter(param);
- break;
- case 3: // layer
- changes << QMapboxGLStyleAddLayer::fromMapParameter(param);
- break;
- case 4: // source
- changes << QMapboxGLStyleAddSource::fromMapParameter(param);
- break;
- case 5: // image
- changes << QMapboxGLStyleAddImage::fromMapParameter(param);
- break;
- }
-
- return changes;
-}
-
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapItem(QDeclarativeGeoMapItemBase *item, const QString &before)
{
QList<QSharedPointer<QMapboxGLStyleChange>> changes;
@@ -258,35 +221,6 @@ QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::addMapItem(QDe
return changes;
}
-QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::removeMapParameter(QGeoMapParameter *param)
-{
- static const QStringList acceptedParameterTypes = QStringList()
- << QStringLiteral("paint") << QStringLiteral("layout") << QStringLiteral("filter")
- << QStringLiteral("layer") << QStringLiteral("source") << QStringLiteral("image");
-
- QList<QSharedPointer<QMapboxGLStyleChange>> changes;
-
- switch (acceptedParameterTypes.indexOf(param->type())) {
- case -1:
- qWarning() << "Invalid value for property 'type': " + param->type();
- break;
- case 0: // paint
- case 1: // layout
- case 2: // filter
- break;
- case 3: // layer
- changes << QSharedPointer<QMapboxGLStyleChange>(new QMapboxGLStyleRemoveLayer(param->property("name").toString()));
- break;
- case 4: // source
- changes << QSharedPointer<QMapboxGLStyleChange>(new QMapboxGLStyleRemoveSource(param->property("name").toString()));
- break;
- case 5: // image
- break;
- }
-
- return changes;
-}
-
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleChange::removeMapItem(QDeclarativeGeoMapItemBase *item)
{
QList<QSharedPointer<QMapboxGLStyleChange>> changes;
@@ -306,33 +240,6 @@ void QMapboxGLStyleSetLayoutProperty::apply(QMapboxGL *map)
map->setLayoutProperty(m_layer, m_property, m_value);
}
-QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "layout");
-
- QList<QSharedPointer<QMapboxGLStyleChange>> changes;
-
- QList<QByteArray> propertyNames = getAllPropertyNamesList(param);
- for (const QByteArray &propertyName : propertyNames) {
- if (isImmutableProperty(propertyName))
- continue;
-
- auto layout = new QMapboxGLStyleSetLayoutProperty();
-
- layout->m_value = param->property(propertyName);
- if (layout->m_value.canConvert<QJSValue>()) {
- layout->m_value = layout->m_value.value<QJSValue>().toVariant();
- }
-
- layout->m_layer = param->property("layer").toString();
- layout->m_property = formatPropertyName(propertyName);
-
- changes << QSharedPointer<QMapboxGLStyleChange>(layout);
- }
-
- return changes;
-}
-
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetLayoutProperty::fromMapItem(QDeclarativeGeoMapItemBase *item)
{
QList<QSharedPointer<QMapboxGLStyleChange>> changes;
@@ -383,33 +290,6 @@ void QMapboxGLStyleSetPaintProperty::apply(QMapboxGL *map)
map->setPaintProperty(m_layer, m_property, m_value);
}
-QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "paint");
-
- QList<QSharedPointer<QMapboxGLStyleChange>> changes;
-
- QList<QByteArray> propertyNames = getAllPropertyNamesList(param);
- for (const QByteArray &propertyName : propertyNames) {
- if (isImmutableProperty(propertyName))
- continue;
-
- auto paint = new QMapboxGLStyleSetPaintProperty();
-
- paint->m_value = param->property(propertyName);
- if (paint->m_value.canConvert<QJSValue>()) {
- paint->m_value = paint->m_value.value<QJSValue>().toVariant();
- }
-
- paint->m_layer = param->property("layer").toString();
- paint->m_property = formatPropertyName(propertyName);
-
- changes << QSharedPointer<QMapboxGLStyleChange>(paint);
- }
-
- return changes;
-}
-
QList<QSharedPointer<QMapboxGLStyleChange>> QMapboxGLStyleSetPaintProperty::fromMapItem(QDeclarativeGeoMapItemBase *item)
{
switch (item->itemType()) {
@@ -502,41 +382,6 @@ void QMapboxGLStyleAddLayer::apply(QMapboxGL *map)
map->addLayer(m_params, m_before);
}
-QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddLayer::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "layer");
-
- auto layer = new QMapboxGLStyleAddLayer();
-
- static const QStringList layerProperties = QStringList()
- << QStringLiteral("name") << QStringLiteral("layerType") << QStringLiteral("before");
-
- QList<QByteArray> propertyNames = getAllPropertyNamesList(param);
- for (const QByteArray &propertyName : propertyNames) {
- if (isImmutableProperty(propertyName))
- continue;
-
- const QVariant value = param->property(propertyName);
-
- switch (layerProperties.indexOf(propertyName)) {
- case -1:
- layer->m_params[formatPropertyName(propertyName)] = value;
- break;
- case 0: // name
- layer->m_params[QStringLiteral("id")] = value;
- break;
- case 1: // layerType
- layer->m_params[QStringLiteral("type")] = value;
- break;
- case 2: // before
- layer->m_before = value.toString();
- break;
- }
- }
-
- return QSharedPointer<QMapboxGLStyleChange>(layer);
-}
-
QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddLayer::fromFeature(const QMapbox::Feature &feature, const QString &before)
{
auto layer = new QMapboxGLStyleAddLayer();
@@ -580,47 +425,6 @@ void QMapboxGLStyleAddSource::apply(QMapboxGL *map)
map->updateSource(m_id, m_params);
}
-QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddSource::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "source");
-
- static const QStringList acceptedSourceTypes = QStringList()
- << QStringLiteral("vector") << QStringLiteral("raster") << QStringLiteral("raster-dem") << QStringLiteral("geojson") << QStringLiteral("image");
-
- QString sourceType = param->property("sourceType").toString();
-
- auto source = new QMapboxGLStyleAddSource();
- source->m_id = param->property("name").toString();
- source->m_params[QStringLiteral("type")] = sourceType;
-
- switch (acceptedSourceTypes.indexOf(sourceType)) {
- case -1:
- qWarning() << "Invalid value for property 'sourceType': " + sourceType;
- break;
- case 0: // vector
- case 1: // raster
- case 2: // raster-dem
- source->m_params[QStringLiteral("url")] = param->property("url");
- break;
- case 3: { // geojson
- auto data = param->property("data").toString();
- if (data.startsWith(':')) {
- QFile geojson(data);
- geojson.open(QIODevice::ReadOnly);
- source->m_params[QStringLiteral("data")] = geojson.readAll();
- } else {
- source->m_params[QStringLiteral("data")] = data.toUtf8();
- }
- } break;
- case 4: { // image
- source->m_params[QStringLiteral("url")] = param->property("url");
- source->m_params[QStringLiteral("coordinates")] = param->property("coordinates");
- } break;
- }
-
- return QSharedPointer<QMapboxGLStyleChange>(source);
-}
-
QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddSource::fromFeature(const QMapbox::Feature &feature)
{
auto source = new QMapboxGLStyleAddSource();
@@ -657,32 +461,9 @@ void QMapboxGLStyleSetFilter::apply(QMapboxGL *map)
map->setFilter(m_layer, m_filter);
}
-QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleSetFilter::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "filter");
-
- auto filter = new QMapboxGLStyleSetFilter();
- filter->m_layer = param->property("layer").toString();
- filter->m_filter = param->property("filter");
-
- return QSharedPointer<QMapboxGLStyleChange>(filter);
-}
-
-
// QMapboxGLStyleAddImage
void QMapboxGLStyleAddImage::apply(QMapboxGL *map)
{
map->addImage(m_name, m_sprite);
}
-
-QSharedPointer<QMapboxGLStyleChange> QMapboxGLStyleAddImage::fromMapParameter(QGeoMapParameter *param)
-{
- Q_ASSERT(param->type() == "image");
-
- auto image = new QMapboxGLStyleAddImage();
- image->m_name = param->property("name").toString();
- image->m_sprite = QImage(param->property("sprite").toString());
-
- return QSharedPointer<QMapboxGLStyleChange>(image);
-}
diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
index 24b84b34..0645b7b4 100644
--- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
+++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h
@@ -51,7 +51,6 @@
#include <QtLocation/private/qdeclarativepolygonmapitem_p.h>
#include <QtLocation/private/qdeclarativepolylinemapitem_p.h>
#include <QtLocation/private/qdeclarativerectanglemapitem_p.h>
-#include <QtLocation/private/qgeomapparameter_p.h>
#include <QMapboxGL>
@@ -60,9 +59,7 @@ class QMapboxGLStyleChange
public:
virtual ~QMapboxGLStyleChange() = default;
- static QList<QSharedPointer<QMapboxGLStyleChange>> addMapParameter(QGeoMapParameter *);
static QList<QSharedPointer<QMapboxGLStyleChange>> addMapItem(QDeclarativeGeoMapItemBase *, const QString &before);
- static QList<QSharedPointer<QMapboxGLStyleChange>> removeMapParameter(QGeoMapParameter *);
static QList<QSharedPointer<QMapboxGLStyleChange>> removeMapItem(QDeclarativeGeoMapItemBase *);
virtual void apply(QMapboxGL *map) = 0;
@@ -71,7 +68,6 @@ public:
class QMapboxGLStyleSetLayoutProperty : public QMapboxGLStyleChange
{
public:
- static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapParameter(QGeoMapParameter *);
static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeGeoMapItemBase *);
void apply(QMapboxGL *map) override;
@@ -90,7 +86,6 @@ private:
class QMapboxGLStyleSetPaintProperty : public QMapboxGLStyleChange
{
public:
- static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapParameter(QGeoMapParameter *);
static QList<QSharedPointer<QMapboxGLStyleChange>> fromMapItem(QDeclarativeGeoMapItemBase *);
void apply(QMapboxGL *map) override;
@@ -112,7 +107,6 @@ private:
class QMapboxGLStyleAddLayer : public QMapboxGLStyleChange
{
public:
- static QSharedPointer<QMapboxGLStyleChange> fromMapParameter(QGeoMapParameter *);
static QSharedPointer<QMapboxGLStyleChange> fromFeature(const QMapbox::Feature &feature, const QString &before);
void apply(QMapboxGL *map) override;
@@ -140,7 +134,6 @@ private:
class QMapboxGLStyleAddSource : public QMapboxGLStyleChange
{
public:
- static QSharedPointer<QMapboxGLStyleChange> fromMapParameter(QGeoMapParameter *);
static QSharedPointer<QMapboxGLStyleChange> fromFeature(const QMapbox::Feature &feature);
static QSharedPointer<QMapboxGLStyleChange> fromMapItem(QDeclarativeGeoMapItemBase *);
@@ -169,8 +162,6 @@ private:
class QMapboxGLStyleSetFilter : public QMapboxGLStyleChange
{
public:
- static QSharedPointer<QMapboxGLStyleChange> fromMapParameter(QGeoMapParameter *);
-
void apply(QMapboxGL *map) override;
private:
@@ -183,8 +174,6 @@ private:
class QMapboxGLStyleAddImage : public QMapboxGLStyleChange
{
public:
- static QSharedPointer<QMapboxGLStyleChange> fromMapParameter(QGeoMapParameter *);
-
void apply(QMapboxGL *map) override;
private: