From 5be371b95cfeb3dc9bbe64e77833709ef8e4495b Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 21 Mar 2017 15:28:37 +0200 Subject: Allow clearing before rendering for Mapbox GL plugin Change-Id: I5a82c663287c35584567280efd9a8dd20a549fcb Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp index 4a76ac29..f7d95f63 100644 --- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp +++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp @@ -81,8 +81,6 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio) void QSGMapboxGLTextureNode::render(QQuickWindow *window) { - window->setClearBeforeRendering(false); - QOpenGLFunctions *f = window->openglContext()->functions(); f->glViewport(0, 0, m_fbo->width(), m_fbo->height()); -- cgit v1.2.1 From 02c1b7eabaab6f7b2262ab34ac46c8aeeb09f064 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 27 Mar 2017 13:54:13 +0300 Subject: Disable Mapbox GL Native plugin for QNX Unsupported for now. Needs to get it building first and also testing. Task-number: QTBUG-59685 Change-Id: Iec965cb758b9a1a7f007f6f1aaf69ac04d86edf2 Reviewed-by: Paolo Angelelli Reviewed-by: Samuli Piippo --- src/plugins/geoservices/geoservices.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro index 5a8647a5..ffcb5d15 100644 --- a/src/plugins/geoservices/geoservices.pro +++ b/src/plugins/geoservices/geoservices.pro @@ -2,7 +2,7 @@ TEMPLATE = subdirs SUBDIRS = nokia osm mapbox esri itemsoverlay -qtConfig(c++14):!win32 { +qtConfig(c++14):!win32:!qnx { !exists(../../3rdparty/mapbox-gl-native/CMakeLists.txt) { warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") } else { -- cgit v1.2.1 From 74b456578063f184838774c54c89a96d7ab90a5b Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Tue, 21 Mar 2017 17:35:05 +0100 Subject: Add parameter to control prefetching in tile-based geoservice plugins Change-Id: I18fc1788f7af0efe76f97257ffe739eb1a96e6cc Reviewed-by: Alex Blasche --- .../esri/geotiledmappingmanagerengine_esri.cpp | 14 +++++++++++++- .../mapbox/qgeotiledmappingmanagerenginemapbox.cpp | 14 +++++++++++++- .../nokia/qgeotiledmappingmanagerengine_nokia.cpp | 15 ++++++++++++++- .../geoservices/osm/qgeotiledmappingmanagerengineosm.cpp | 12 ++++++++++++ 4 files changed, 52 insertions(+), 3 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp index a0f00615..3b06d237 100644 --- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp @@ -199,6 +199,16 @@ GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(const QVarian tileCache->setExtraTextureUsage(cacheSize); } + /* PREFETCHING */ + if (parameters.contains(QStringLiteral("esri.mapping.prefetching_style"))) { + const QString prefetchingMode = parameters.value(QStringLiteral("esri.mapping.prefetching_style")).toString(); + if (prefetchingMode == QStringLiteral("TwoNeighbourLayers")) + m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers; + else if (prefetchingMode == QStringLiteral("OneNeighbourLayer")) + m_prefetchStyle = QGeoTiledMap::PrefetchNeighbourLayer; + else if (prefetchingMode == QStringLiteral("NoPrefetching")) + m_prefetchStyle = QGeoTiledMap::NoPrefetching; + } setTileCache(tileCache); *error = QGeoServiceProvider::NoError; @@ -212,7 +222,9 @@ GeoTiledMappingManagerEngineEsri::~GeoTiledMappingManagerEngineEsri() QGeoMap *GeoTiledMappingManagerEngineEsri::createMap() { - return new GeoTiledMapEsri(this); + QGeoTiledMap *map = new GeoTiledMapEsri(this); + map->setPrefetchStyle(m_prefetchStyle); + return map; } // ${z} = Zoom diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp index 4b62aece..090ba310 100644 --- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp @@ -221,6 +221,16 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q tileCache->setExtraTextureUsage(cacheSize); } + /* PREFETCHING */ + if (parameters.contains(QStringLiteral("mapbox.mapping.prefetching_style"))) { + const QString prefetchingMode = parameters.value(QStringLiteral("mapbox.mapping.prefetching_style")).toString(); + if (prefetchingMode == QStringLiteral("TwoNeighbourLayers")) + m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers; + else if (prefetchingMode == QStringLiteral("OneNeighbourLayer")) + m_prefetchStyle = QGeoTiledMap::PrefetchNeighbourLayer; + else if (prefetchingMode == QStringLiteral("NoPrefetching")) + m_prefetchStyle = QGeoTiledMap::NoPrefetching; + } setTileCache(tileCache); @@ -234,7 +244,9 @@ QGeoTiledMappingManagerEngineMapbox::~QGeoTiledMappingManagerEngineMapbox() QGeoMap *QGeoTiledMappingManagerEngineMapbox::createMap() { - return new QGeoTiledMap(this, 0); + QGeoTiledMap *map = new QGeoTiledMap(this, 0); + map->setPrefetchStyle(m_prefetchStyle); + return map; } QT_END_NAMESPACE diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index ab6cd7ea..ca83dc30 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -185,6 +185,17 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia( tileCache->setExtraTextureUsage(cacheSize); } + /* PREFETCHING */ + if (parameters.contains(QStringLiteral("here.mapping.prefetching_style"))) { + const QString prefetchingMode = parameters.value(QStringLiteral("here.mapping.prefetching_style")).toString(); + if (prefetchingMode == QStringLiteral("TwoNeighbourLayers")) + m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers; + else if (prefetchingMode == QStringLiteral("OneNeighbourLayer")) + m_prefetchStyle = QGeoTiledMap::PrefetchNeighbourLayer; + else if (prefetchingMode == QStringLiteral("NoPrefetching")) + m_prefetchStyle = QGeoTiledMap::NoPrefetching; + } + setTileCache(tileCache); populateMapSchemes(); loadMapVersion(); @@ -431,7 +442,9 @@ QString QGeoTiledMappingManagerEngineNokia::evaluateCopyrightsText(const QGeoMap QGeoMap *QGeoTiledMappingManagerEngineNokia::createMap() { - return new QGeoTiledMapNokia(this); + QGeoTiledMap *map = new QGeoTiledMapNokia(this); + map->setPrefetchStyle(m_prefetchStyle); + return map; } QT_END_NAMESPACE diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp index 0e1fb356..a0fb1a59 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp @@ -311,6 +311,17 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian } setTileFetcher(tileFetcher); + /* PREFETCHING */ + if (parameters.contains(QStringLiteral("osm.mapping.prefetching_style"))) { + const QString prefetchingMode = parameters.value(QStringLiteral("osm.mapping.prefetching_style")).toString(); + if (prefetchingMode == QStringLiteral("TwoNeighbourLayers")) + m_prefetchStyle = QGeoTiledMap::PrefetchTwoNeighbourLayers; + else if (prefetchingMode == QStringLiteral("OneNeighbourLayer")) + m_prefetchStyle = QGeoTiledMap::PrefetchNeighbourLayer; + else if (prefetchingMode == QStringLiteral("NoPrefetching")) + m_prefetchStyle = QGeoTiledMap::NoPrefetching; + } + *error = QGeoServiceProvider::NoError; errorString->clear(); } @@ -324,6 +335,7 @@ QGeoMap *QGeoTiledMappingManagerEngineOsm::createMap() QGeoTiledMap *map = new QGeoTiledMapOsm(this); connect(qobject_cast(tileCache()), &QGeoFileTileCacheOsm::mapDataUpdated , map, &QGeoTiledMap::clearScene); + map->setPrefetchStyle(m_prefetchStyle); return map; } -- cgit v1.2.1 From 93d174d276d208434b6615d73a7e9c805ea48ff9 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 27 Mar 2017 18:28:23 +0300 Subject: Better battery usage on Mapbox GL plugin with threaded GL Stop the refresh timer hack when all the resources are loaded so we don't keep waking up for re-drawing when it is not needed. Change-Id: Iada46850adf4fec04dc70c9d3f7263b71c325d8a Reviewed-by: Paolo Angelelli --- .../geoservices/mapboxgl/qgeomapmapboxgl.cpp | 36 ++++++++++++++++------ .../geoservices/mapboxgl/qgeomapmapboxgl_p.h | 2 ++ 2 files changed, 29 insertions(+), 9 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index ea4209e8..74bea76a 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -91,15 +91,6 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w { Q_Q(QGeoMapMapboxGL); - if (!m_warned) { - if (window->openglContext()->thread() != QCoreApplication::instance()->thread()) { - qWarning() << "Threaded rendering is not supported by Mapbox GL plugin."; - QMetaObject::invokeMethod(&m_refresh, "start", Qt::QueuedConnection); - } - - m_warned = true; - } - QMapboxGL *map = 0; if (m_useFBO) { if (!node) { @@ -151,6 +142,8 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w static_cast(node)->render(window); } + threadedRenderingHack(window, map); + m_syncState = NoSync; return node; @@ -278,6 +271,31 @@ void QGeoMapMapboxGLPrivate::syncStyleChanges(QMapboxGL *map) m_styleChanges.clear(); } +void QGeoMapMapboxGLPrivate::threadedRenderingHack(QQuickWindow *window, QMapboxGL *map) +{ + // FIXME: Optimal support for threaded rendering needs core changes + // in Mapbox GL Native. Meanwhile we need to set a timer to update + // the map until all the resources are loaded, which is not exactly + // battery friendly, because might trigger more paints than we need. + if (!m_warned) { + m_threadedRendering = window->openglContext()->thread() != QCoreApplication::instance()->thread(); + + if (m_threadedRendering) { + qWarning() << "Threaded rendering is not optimal in the Mapbox GL plugin."; + } + + m_warned = true; + } + + if (m_threadedRendering) { + if (!map->isFullyLoaded()) { + QMetaObject::invokeMethod(&m_refresh, "start", Qt::QueuedConnection); + } else { + QMetaObject::invokeMethod(&m_refresh, "stop", Qt::QueuedConnection); + } + } +} + /* * QGeoMapMapboxGL implementation */ diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h index b6527c01..15e5d167 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h @@ -83,6 +83,7 @@ public: QTimer m_refresh; bool m_shouldRefresh = true; bool m_warned = false; + bool m_threadedRendering = false; bool m_styleLoaded = false; SyncStates m_syncState = NoSync; @@ -98,6 +99,7 @@ private: Q_DISABLE_COPY(QGeoMapMapboxGLPrivate); void syncStyleChanges(QMapboxGL *map); + void threadedRenderingHack(QQuickWindow *window, QMapboxGL *map); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QGeoMapMapboxGLPrivate::SyncStates) -- cgit v1.2.1 From a7cadd6f5f5278220847dcb2c4897a3c40896ea3 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 28 Mar 2017 14:11:46 +0300 Subject: Minimum texture size check for QSGMapboxGLTextureNode Change-Id: I096a14f5f1e8f83d4671990d052ecfff8095e985 Reviewed-by: Thiago Marcos P. Santos Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp index f7d95f63..d338a51a 100644 --- a/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp +++ b/src/plugins/geoservices/mapboxgl/qsgmapboxglnode.cpp @@ -43,13 +43,15 @@ // QSGMapboxGLTextureNode +static const QSize minTextureSize = QSize(64, 64); + QSGMapboxGLTextureNode::QSGMapboxGLTextureNode(const QMapboxGLSettings &settings, const QSize &size, qreal pixelRatio, QGeoMapMapboxGL *geoMap) : QSGSimpleTextureNode() { setTextureCoordinatesTransform(QSGSimpleTextureNode::MirrorVertically); setFiltering(QSGTexture::Linear); - m_map.reset(new QMapboxGL(nullptr, settings, size, pixelRatio)); + m_map.reset(new QMapboxGL(nullptr, settings, size.expandedTo(minTextureSize), pixelRatio)); QObject::connect(m_map.data(), &QMapboxGL::needsRendering, geoMap, &QGeoMap::sgNodeChanged); QObject::connect(m_map.data(), &QMapboxGL::copyrightsChanged, geoMap, @@ -58,8 +60,9 @@ QSGMapboxGLTextureNode::QSGMapboxGLTextureNode(const QMapboxGLSettings &settings void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio) { - const QSize fbSize = size * pixelRatio; - m_map->resize(size, fbSize); + const QSize& minSize = size.expandedTo(minTextureSize); + const QSize fbSize = minSize * pixelRatio; + m_map->resize(minSize, fbSize); m_fbo.reset(new QOpenGLFramebufferObject(fbSize, QOpenGLFramebufferObject::CombinedDepthStencil)); @@ -75,7 +78,7 @@ void QSGMapboxGLTextureNode::resize(const QSize &size, qreal pixelRatio) setOwnsTexture(true); } - setRect(QRectF(QPointF(), size)); + setRect(QRectF(QPointF(), minSize)); markDirty(QSGNode::DirtyGeometry); } -- cgit v1.2.1 From 20a7d7b265742c3eea8d080e6710bf7bd2cb5bdd Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Wed, 29 Mar 2017 15:26:12 +0300 Subject: Prevent creating the Mapbox GL node map if size is empty Change-Id: I3fe2c7fecd8cf8036f84fed5c4875e39d937c9cd Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index 74bea76a..563c84f2 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -91,6 +91,11 @@ QSGNode *QGeoMapMapboxGLPrivate::updateSceneGraph(QSGNode *node, QQuickWindow *w { Q_Q(QGeoMapMapboxGL); + if (m_viewportSize.isEmpty()) { + delete node; + return 0; + } + QMapboxGL *map = 0; if (m_useFBO) { if (!node) { -- cgit v1.2.1 From a51e1915adc366fafbd36b5a163b14f8d8224447 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 1 Apr 2017 22:12:22 -0700 Subject: Fix Clang warning about inconsistent use of override keyword qgeotiledmappingmanagerengineosm.h:62:14: error: 'createMap' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] Change-Id: I27b55fdf514247549455fffd14b17c97ad2db003 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h index db8b230c..d77ffab5 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h @@ -59,10 +59,10 @@ public: QGeoServiceProvider::Error *error, QString *errorString); ~QGeoTiledMappingManagerEngineOsm(); - QGeoMap *createMap(); + QGeoMap *createMap() override; const QVector &providers(); QString customCopyright() const; - QGeoCameraCapabilities cameraCapabilities(const QGeoMapType &mapType) const Q_DECL_OVERRIDE; + QGeoCameraCapabilities cameraCapabilities(const QGeoMapType &mapType) const override; protected Q_SLOTS: void onProviderResolutionFinished(const QGeoTileProviderOsm *provider); -- cgit v1.2.1 From 8714cb31102026f96a3fbf10b8d715319d400536 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Fri, 7 Apr 2017 17:18:42 +0300 Subject: Mapbox GL static/debug build fixes Task-number: QTBUG-59281 Change-Id: I3605265ca9c330ea782bdda53ce5af004ef35a22 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index 37dd383c..5ae804f8 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -36,7 +36,7 @@ qtConfig(icu) { include(../../../3rdparty/zlib_dependency.pri) load(qt_build_paths) -LIBS_PRIVATE += -L$$MODULE_BASE_OUTDIR/lib -lqmapboxgl +LIBS_PRIVATE += -L$$MODULE_BASE_OUTDIR/lib -lqmapboxgl$$qtPlatformTargetSuffix() PLUGIN_TYPE = geoservices PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapboxGL -- cgit v1.2.1 From 3f278a5cee03ffe16547acb496cad2eabf9cfe32 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 10 Apr 2017 16:10:35 +0300 Subject: Fix linking error when building Mapbox GL plugin with ICU Mapbox GL depends on ICU, so it should be after -lqmapboxgl in the linker command line. Change-Id: I725d32d1132520ddd0704c7d9e998453a92e10ab Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index 5ae804f8..dcdee7e4 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -29,15 +29,15 @@ OTHER_FILES += \ INCLUDEPATH += ../../../3rdparty/mapbox-gl-native/platform/qt/include -qtConfig(icu) { - include(../../../3rdparty/icu_dependency.pri) -} - include(../../../3rdparty/zlib_dependency.pri) load(qt_build_paths) LIBS_PRIVATE += -L$$MODULE_BASE_OUTDIR/lib -lqmapboxgl$$qtPlatformTargetSuffix() +qtConfig(icu) { + include(../../../3rdparty/icu_dependency.pri) +} + PLUGIN_TYPE = geoservices PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapboxGL load(qt_plugin) -- cgit v1.2.1 From 57ca202484c996c15f7a3caabcfe9199cc75112e Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 7 Apr 2017 21:48:11 +0200 Subject: Fix itemsoverlay .pro file structure This patch makes the structure of the pro file of the itemsoverlay plugin the same as the other plugins (like the mapbox plugin). Change-Id: Iada6296562282b238c6f793b9f0b80ade8ec6ddf Reviewed-by: Alex Blasche --- src/plugins/geoservices/itemsoverlay/itemsoverlay.pro | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/itemsoverlay/itemsoverlay.pro b/src/plugins/geoservices/itemsoverlay/itemsoverlay.pro index 2a09a994..1f45de97 100644 --- a/src/plugins/geoservices/itemsoverlay/itemsoverlay.pro +++ b/src/plugins/geoservices/itemsoverlay/itemsoverlay.pro @@ -12,9 +12,10 @@ SOURCES += \ qgeomappingmanagerengineitemsoverlay.cpp \ qgeomapitemsoverlay.cpp +OTHER_FILES += \ + itemsoverlay_plugin.json + PLUGIN_TYPE = geoservices PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryItemsOverlay load(qt_plugin) -DISTFILES += \ - itemsoverlay_plugin.json -- cgit v1.2.1 From b82f9dd722e21fd7694221147dc0dccc94b2ad60 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 7 Apr 2017 10:58:46 +0200 Subject: Replace QGeoMapType argument of cameraCapabilities Since the only part of QGeoMapType used in the method is mapId, there's no need to pass the whole map type as argument. The benefit is that the camera caps can be requested solely based on the info in QGeoTileSpec. Change-Id: Iafd0e2a1d4d45fbf02b862efe56841001cbebd75 Reviewed-by: Alex Blasche --- .../geoservices/osm/qgeotiledmappingmanagerengineosm.cpp | 10 +++++----- src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp index a0fb1a59..9a1a0e47 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp @@ -349,13 +349,13 @@ QString QGeoTiledMappingManagerEngineOsm::customCopyright() const return m_customCopyright; } -QGeoCameraCapabilities QGeoTiledMappingManagerEngineOsm::cameraCapabilities(const QGeoMapType &mapType) const +QGeoCameraCapabilities QGeoTiledMappingManagerEngineOsm::cameraCapabilities(int mapId) const { - if (mapType.mapId() == 0) - return QGeoMappingManagerEngine::cameraCapabilities(mapType); - int idx = mapType.mapId() - 1; + if (mapId == 0) + return QGeoMappingManagerEngine::cameraCapabilities(mapId); + int idx = mapId - 1; if (idx >= m_providers.size()) - return QGeoMappingManagerEngine::cameraCapabilities(QGeoMapType()); + return QGeoMappingManagerEngine::cameraCapabilities(mapId); return m_providers[idx]->cameraCapabilities(); } diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h index d77ffab5..c5f16c2b 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h @@ -62,7 +62,7 @@ public: QGeoMap *createMap() override; const QVector &providers(); QString customCopyright() const; - QGeoCameraCapabilities cameraCapabilities(const QGeoMapType &mapType) const override; + QGeoCameraCapabilities cameraCapabilities(int mapId) const override; protected Q_SLOTS: void onProviderResolutionFinished(const QGeoTileProviderOsm *provider); -- cgit v1.2.1 From ae2329252e84a4931b321cacf529a13a3f06a0d5 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 7 Apr 2017 11:23:55 +0200 Subject: Bound check QGeoTileSpec against min/max ZL before requesting it Until now we have not honored the min/max zoom levels specified in QGeoCameraCapabilities when requesting tiles. As a result we have often fired requests for non-existing tile layers. This change complements the added support for individual camera caps for each map type, and makes the tile fetcher honor the bounds defined in the camera capabilities. This also allows to set larger zoom levels in the renderer, overzooming existing tiles, without the fetcher firing requests for invalid resources Change-Id: Ic8a523a114147109f7ef8af3510a3ab78d06d714 Reviewed-by: Qt CI Bot Reviewed-by: Alex Blasche --- src/plugins/geoservices/esri/geotilefetcher_esri.cpp | 2 +- src/plugins/geoservices/esri/geotilefetcher_esri.h | 2 +- src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp | 2 +- src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h | 2 +- src/plugins/geoservices/osm/qgeotilefetcherosm.cpp | 2 +- src/plugins/geoservices/osm/qgeotilefetcherosm.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/esri/geotilefetcher_esri.cpp b/src/plugins/geoservices/esri/geotilefetcher_esri.cpp index 62484bbb..8ceba374 100644 --- a/src/plugins/geoservices/esri/geotilefetcher_esri.cpp +++ b/src/plugins/geoservices/esri/geotilefetcher_esri.cpp @@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE -GeoTileFetcherEsri::GeoTileFetcherEsri(QObject *parent) : +GeoTileFetcherEsri::GeoTileFetcherEsri(QGeoTiledMappingManagerEngine *parent) : QGeoTileFetcher(parent), m_networkManager(new QNetworkAccessManager(this)), m_userAgent(QByteArrayLiteral("Qt Location based application")) { diff --git a/src/plugins/geoservices/esri/geotilefetcher_esri.h b/src/plugins/geoservices/esri/geotilefetcher_esri.h index 43dcfdfa..be948af1 100644 --- a/src/plugins/geoservices/esri/geotilefetcher_esri.h +++ b/src/plugins/geoservices/esri/geotilefetcher_esri.h @@ -52,7 +52,7 @@ class GeoTileFetcherEsri : public QGeoTileFetcher Q_OBJECT public: - explicit GeoTileFetcherEsri(QObject *parent = Q_NULLPTR); + explicit GeoTileFetcherEsri(QGeoTiledMappingManagerEngine *parent); inline const QByteArray &userAgent() const; inline void setUserAgent(const QByteArray &userAgent); diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp index 062b4f89..732d04e9 100644 --- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE -QGeoTileFetcherMapbox::QGeoTileFetcherMapbox(int scaleFactor, QObject *parent) +QGeoTileFetcherMapbox::QGeoTileFetcherMapbox(int scaleFactor, QGeoTiledMappingManagerEngine *parent) : QGeoTileFetcher(parent), m_networkManager(new QNetworkAccessManager(this)), m_userAgent("Qt Location based application"), m_format("png"), diff --git a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h index e52651e1..47f3a8aa 100644 --- a/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h +++ b/src/plugins/geoservices/mapbox/qgeotilefetchermapbox.h @@ -50,7 +50,7 @@ class QGeoTileFetcherMapbox : public QGeoTileFetcher Q_OBJECT public: - QGeoTileFetcherMapbox(int scaleFactor = 2, QObject *parent = 0); + QGeoTileFetcherMapbox(int scaleFactor, QGeoTiledMappingManagerEngine *parent); void setUserAgent(const QByteArray &userAgent); void setMapIds(const QVector &mapIds); diff --git a/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp b/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp index f7c25d61..8c5778d1 100644 --- a/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp +++ b/src/plugins/geoservices/osm/qgeotilefetcherosm.cpp @@ -78,7 +78,7 @@ QGeoTileFetcherOsmPrivate::~QGeoTileFetcherOsmPrivate() QGeoTileFetcherOsm::QGeoTileFetcherOsm(const QVector &providers, QNetworkAccessManager *nm, - QObject *parent) + QGeoMappingManagerEngine *parent) : QGeoTileFetcher(*new QGeoTileFetcherOsmPrivate(), parent), m_userAgent("Qt Location based application"), m_providers(providers), m_nm(nm), m_ready(true) { diff --git a/src/plugins/geoservices/osm/qgeotilefetcherosm.h b/src/plugins/geoservices/osm/qgeotilefetcherosm.h index a7b89bad..859033cc 100644 --- a/src/plugins/geoservices/osm/qgeotilefetcherosm.h +++ b/src/plugins/geoservices/osm/qgeotilefetcherosm.h @@ -59,7 +59,7 @@ class QGeoTileFetcherOsm : public QGeoTileFetcher public: QGeoTileFetcherOsm(const QVector &providers, QNetworkAccessManager *nm, - QObject *parent = 0); + QGeoMappingManagerEngine *parent); void setUserAgent(const QByteArray &userAgent); -- cgit v1.2.1 From e81ba34a98b259723e783e2d2df4321309992291 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 7 Apr 2017 13:40:19 +0200 Subject: Allow overzooming when setting zoomLevel directly in a Map This patch moves the lower/upper bound check on setZoom from QDeclarativeGeoMap to the gesture area, allowing to set higher zoom levels than the maximumZoomLevel when setting Map.zoomLevel directly, for the map types that support overzoom. This is now safe as the bound check is introduced in the tile fetcher, so no invalid tiles will be requested, and is beneficial when combining layers supporting different maximum zoom levels. Change-Id: I08ee9c282ee2ebc1dafa3c68a238b93ffbc1ba02 Reviewed-by: Alex Blasche --- src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp | 1 + src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp | 1 + src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp | 1 + src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp | 1 + 4 files changed, 4 insertions(+) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp index 3b06d237..7a92ea23 100644 --- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp @@ -101,6 +101,7 @@ GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(const QVarian cameraCaps.setMaximumTilt(80); cameraCaps.setMinimumFieldOfView(20.0); cameraCaps.setMaximumFieldOfView(120.0); + cameraCaps.setOverzoomEnabled(true); setCameraCapabilities(cameraCaps); setTileSize(QSize(256, 256)); diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp index 090ba310..da6c9579 100644 --- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp @@ -56,6 +56,7 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q cameraCaps.setMaximumTilt(80); cameraCaps.setMinimumFieldOfView(20.0); cameraCaps.setMaximumFieldOfView(120.0); + cameraCaps.setOverzoomEnabled(true); setCameraCapabilities(cameraCaps); setTileSize(QSize(256, 256)); diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index ca83dc30..4a987800 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -85,6 +85,7 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia( capabilities.setMaximumTilt(80); capabilities.setMinimumFieldOfView(20.0); capabilities.setMaximumFieldOfView(120.0); + capabilities.setOverzoomEnabled(true); setCameraCapabilities(capabilities); setTileSize(QSize(256, 256)); diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp index 9a1a0e47..2f2d9c80 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp @@ -63,6 +63,7 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian cameraCaps.setMaximumTilt(80); cameraCaps.setMinimumFieldOfView(20.0); cameraCaps.setMaximumFieldOfView(120.0); + cameraCaps.setOverzoomEnabled(true); setCameraCapabilities(cameraCaps); setTileSize(QSize(256, 256)); -- cgit v1.2.1 From 12e45e9e4052a18d70048624e2303ecdcf24f22e Mon Sep 17 00:00:00 2001 From: Stephan Binner Date: Tue, 18 Apr 2017 20:09:58 +0200 Subject: Fix build for -no-feature-concurrent Change-Id: I42e67c0af0b0658d6f1a876191e561d86aaa3ae8 Reviewed-by: Paul Olav Tvete --- src/plugins/geoservices/geoservices.pro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro index ffcb5d15..a0d29325 100644 --- a/src/plugins/geoservices/geoservices.pro +++ b/src/plugins/geoservices/geoservices.pro @@ -1,6 +1,10 @@ TEMPLATE = subdirs -SUBDIRS = nokia osm mapbox esri itemsoverlay +SUBDIRS = nokia mapbox esri itemsoverlay + +qtConfig(concurrent) { + SUBDIRS += osm +} qtConfig(c++14):!win32:!qnx { !exists(../../3rdparty/mapbox-gl-native/CMakeLists.txt) { -- cgit v1.2.1 From 7f2a98f4c2d9beafb4b22a3a72527e58f4236a57 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 19 Apr 2017 20:44:33 +0300 Subject: Update Mapbox logo Mapbox released a new logo today. Change-Id: I15d271762a492d142571f6cae3920af30e04aaa6 Reviewed-by: Simon Hausmann --- src/plugins/geoservices/mapboxgl/logo.png | Bin 3620 -> 2749 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/logo.png b/src/plugins/geoservices/mapboxgl/logo.png index 57410f79..9d6e90ef 100644 Binary files a/src/plugins/geoservices/mapboxgl/logo.png and b/src/plugins/geoservices/mapboxgl/logo.png differ -- cgit v1.2.1 From c2691cf479c88ba0f74492195912cd9b62ce4e62 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Wed, 19 Apr 2017 20:22:39 +0300 Subject: Update Mapbox GL styles to the latest version Better cartography and visuals. Change-Id: I1d751beeafc216351c1f7459a270d48f67693295 Reviewed-by: Simon Hausmann --- .../geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp index c87b458d..5cba7e2d 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp @@ -68,17 +68,17 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian QList mapTypes; int mapId = 0; - mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-v9"), + mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-v10"), tr("Streets"), false, false, ++mapId); mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/basic-v9"), tr("Basic"), false, false, ++mapId); mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/bright-v9"), tr("Bright"), false, false, ++mapId); - mapTypes << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("mapbox://styles/mapbox/outdoors-v9"), + mapTypes << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("mapbox://styles/mapbox/outdoors-v10"), tr("Outdoors"), false, false, ++mapId); mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox://styles/mapbox/satellite-v9"), tr("Satellite"), false, false, ++mapId); - mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox://styles/mapbox/satellite-streets-v9"), + mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox://styles/mapbox/satellite-streets-v10"), tr("Satellite Streets"), false, false, ++mapId); mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/light-v9"), tr("Light"), false, false, ++mapId); -- cgit v1.2.1 From 1aa24b25a99335e350503fb45a0bca2f25d3dd05 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Fri, 21 Apr 2017 15:38:34 +0300 Subject: Enable Mapbox GL plugin on MinGW builds Qt CI is using MinGW 5.3.0 that should do the job compiling Mapbox GL. For now, only the ANGLE OpenGL backend is supported on Windows for this plugin. I.e. you need to set QT_OPENGL=angle or Qt::AA_UseOpenGLES. Task-number: QTBUG-60110 Change-Id: Iebd4d1569191f47a14b264c489b5d3fb23338d78 Reviewed-by: Qt CI Bot Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/geoservices.pro | 2 +- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 8 ++++++++ .../geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro index a0d29325..0810d392 100644 --- a/src/plugins/geoservices/geoservices.pro +++ b/src/plugins/geoservices/geoservices.pro @@ -6,7 +6,7 @@ qtConfig(concurrent) { SUBDIRS += osm } -qtConfig(c++14):!win32:!qnx { +qtConfig(c++14):!win32|mingw:!qnx { !exists(../../3rdparty/mapbox-gl-native/CMakeLists.txt) { warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") } else { diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index dcdee7e4..7781fd6d 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -38,6 +38,14 @@ qtConfig(icu) { include(../../../3rdparty/icu_dependency.pri) } +# When building for Windows with dynamic OpenGL, this plugin +# can only run with ANGLE because Mapbox GL requires at least +# OpenGL ES and does not use QOpenGLFunctions for resolving +# the OpenGL symbols. -lopengl32 only gives OpenGL 1.1. +win32:qtConfig(dynamicgl) { + LIBS_PRIVATE += -lQtANGLE +} + PLUGIN_TYPE = geoservices PLUGIN_CLASS_NAME = QGeoServiceProviderFactoryMapboxGL load(qt_plugin) diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp index 30c01f8c..fb8dd19e 100644 --- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp @@ -38,6 +38,7 @@ #include "qgeoserviceproviderpluginmapboxgl.h" #include "qgeomappingmanagerenginemapboxgl.h" +#include QT_BEGIN_NAMESPACE @@ -54,6 +55,15 @@ QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingMana QGeoMappingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createMappingManagerEngine( const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { +#ifdef Q_OS_WIN + if (QOpenGLContext::openGLModuleType() != QOpenGLContext::LibGLES) { + qWarning("The Mapbox GL plugin only supports OpenGL ES on Windows. \ + Try setting the environment variable QT_OPENGL to 'angle'."); + + return 0; + } +#endif + return new QGeoMappingManagerEngineMapboxGL(parameters, error, errorString); } -- cgit v1.2.1 From 1c29e3f36976134d1db3133d49ee3dc21eb1c07a Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Wed, 12 Apr 2017 15:21:03 +0200 Subject: Add pluginName to QGeoMapType and check against it in setActiveMapType This patch adds a QByteArray member to QGeoMapType with the name of the plugin providing that map type. This value is then used to validate what is passed to QDeclarativeGeoMap::setActiveMapType to see if it's a map type for the currently set plugin. Change-Id: If15b67c32150f0c3c2815d28e26fc37138d4cf71 Reviewed-by: Alex Blasche --- src/plugins/geoservices/esri/geomapsource.cpp | 2 +- .../esri/geotiledmappingmanagerengine_esri.cpp | 3 +- .../qgeomappingmanagerengineitemsoverlay.cpp | 2 +- .../mapbox/qgeotiledmappingmanagerenginemapbox.cpp | 37 +++++++++--------- .../mapboxgl/qgeomappingmanagerenginemapboxgl.cpp | 23 +++++------ .../nokia/qgeotiledmappingmanagerengine_nokia.cpp | 45 +++++++++++----------- .../osm/qgeotiledmappingmanagerengineosm.cpp | 19 ++++----- 7 files changed, 68 insertions(+), 63 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/esri/geomapsource.cpp b/src/plugins/geoservices/esri/geomapsource.cpp index 32fe1899..19f284e6 100644 --- a/src/plugins/geoservices/esri/geomapsource.cpp +++ b/src/plugins/geoservices/esri/geomapsource.cpp @@ -68,7 +68,7 @@ static const MapStyleData mapStyles[] = GeoMapSource::GeoMapSource(QGeoMapType::MapStyle style, const QString &name, const QString &description, bool mobile, bool night, int mapId, const QString &url, const QString ©right) : - QGeoMapType(style, name, description, mobile, night, mapId), + QGeoMapType(style, name, description, mobile, night, mapId, "esri"), m_url(url), m_copyright(copyright) { } diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp index 7a92ea23..00d17327 100644 --- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp @@ -118,7 +118,8 @@ GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(const QVarian mapSource->description(), mapSource->mobile(), mapSource->night(), - mapSource->mapId()); + mapSource->mapId(), + "esri"); } setSupportedMapTypes(mapTypes); diff --git a/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp b/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp index bbb30164..955fbcae 100644 --- a/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp +++ b/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp @@ -62,7 +62,7 @@ QGeoMappingManagerEngineItemsOverlay::QGeoMappingManagerEngineItemsOverlay(const setCameraCapabilities(cameraCaps); QList mapTypes; - mapTypes << QGeoMapType(QGeoMapType::NoMap, tr("Empty Map"), tr("Empty Map"), false, false, 1); + mapTypes << QGeoMapType(QGeoMapType::NoMap, tr("Empty Map"), tr("Empty Map"), false, false, 1, "itemsoverlay"); setSupportedMapTypes(mapTypes); engineInitialized(); diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp index da6c9579..3177b6c4 100644 --- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp +++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp @@ -61,45 +61,46 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q setTileSize(QSize(256, 256)); + const QByteArray pluginName = "mapbox"; QList mapTypes; // as index 0 to retain compatibility with the current API, that expects the passed map_id to be on by default. if (parameters.contains(QStringLiteral("mapbox.mapping.map_id"))) { const QString name = parameters.value(QStringLiteral("mapbox.mapping.map_id")).toString(); - mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size(), pluginName); } else if (parameters.contains(QStringLiteral("mapbox.map_id"))) { //deprecated const QString name = parameters.value(QStringLiteral("mapbox.map_id")).toString(); - mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size(), pluginName); } // As of 2016.06.15, valid mapbox map_ids are documented at https://www.mapbox.com/api-documentation/#maps //: Noun describing map type 'Street map' - mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets"), tr("Street"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets"), tr("Street"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map using light colors (weak contrast) - mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.light"), tr("Light"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.light"), tr("Light"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map using dark colors - mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.dark"), tr("Dark"), false, true, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.dark"), tr("Dark"), false, true, mapTypes.size(), pluginName); //: Noun describing type of a map created by satellite - mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox.satellite"), tr("Satellite"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox.satellite"), tr("Satellite"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a street map created by satellite - mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox.streets-satellite"), tr("Streets Satellite"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox.streets-satellite"), tr("Streets Satellite"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map using wheat paste colors - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.wheatpaste"), tr("Wheatpaste"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.wheatpaste"), tr("Wheatpaste"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a basic street map - mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets-basic"), tr("Streets Basic"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets-basic"), tr("Streets Basic"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map using cartoon-style fonts - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.comic"), tr("Comic"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.comic"), tr("Comic"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map for outdoor activities - mapTypes << QGeoMapType(QGeoMapType::PedestrianMap, QStringLiteral("mapbox.outdoors"), tr("Outdoors"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::PedestrianMap, QStringLiteral("mapbox.outdoors"), tr("Outdoors"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map for sports - mapTypes << QGeoMapType(QGeoMapType::CycleMap, QStringLiteral("mapbox.run-bike-hike"), tr("Run Bike Hike"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CycleMap, QStringLiteral("mapbox.run-bike-hike"), tr("Run Bike Hike"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map drawn by pencil - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pencil"), tr("Pencil"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pencil"), tr("Pencil"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a treasure map with pirate boat watermark - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pirates"), tr("Pirates"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pirates"), tr("Pirates"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map using emerald colors - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.emerald"), tr("Emerald"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.emerald"), tr("Emerald"), false, false, mapTypes.size(), pluginName); //: Noun describing type of a map with high contrast - mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.high-contrast"), tr("High Contrast"), false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.high-contrast"), tr("High Contrast"), false, false, mapTypes.size(), pluginName); // New way to specify multiple customized map_ids via additional_map_ids if (parameters.contains(QStringLiteral("mapbox.mapping.additional_map_ids"))) { @@ -108,7 +109,7 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q for (const QString &name: idList) { if (!name.isEmpty()) - mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size()); + mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size(), pluginName); } } @@ -153,7 +154,7 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q m_cacheDirectory = parameters.value(QStringLiteral("mapbox.mapping.cache.directory")).toString(); } else { // managerName() is not yet set, we have to hardcode the plugin name below - m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String("mapbox"); + m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String(pluginName); } QGeoFileTileCache *tileCache = new QGeoFileTileCacheMapbox(mapTypes, scaleFactor, m_cacheDirectory); diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp index 5cba7e2d..0535bf96 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp @@ -67,27 +67,28 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian QList mapTypes; int mapId = 0; + const QByteArray pluginName = "mapboxgl"; mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-v10"), - tr("Streets"), false, false, ++mapId); + tr("Streets"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/basic-v9"), - tr("Basic"), false, false, ++mapId); + tr("Basic"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/bright-v9"), - tr("Bright"), false, false, ++mapId); + tr("Bright"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("mapbox://styles/mapbox/outdoors-v10"), - tr("Outdoors"), false, false, ++mapId); + tr("Outdoors"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox://styles/mapbox/satellite-v9"), - tr("Satellite"), false, false, ++mapId); + tr("Satellite"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox://styles/mapbox/satellite-streets-v10"), - tr("Satellite Streets"), false, false, ++mapId); + tr("Satellite Streets"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/light-v9"), - tr("Light"), false, false, ++mapId); + tr("Light"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/dark-v9"), - tr("Dark"), false, false, ++mapId); + tr("Dark"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-day-v1"), - tr("Streets Traffic Day"), false, false, ++mapId); + tr("Streets Traffic Day"), false, false, ++mapId, pluginName); mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-night-v1"), - tr("Streets Traffic Night"), false, true, ++mapId); + tr("Streets Traffic Night"), false, true, ++mapId, pluginName); if (parameters.contains(QStringLiteral("mapboxgl.mapping.additional_style_urls"))) { const QString ids = parameters.value(QStringLiteral("mapboxgl.mapping.additional_style_urls")).toString(); @@ -98,7 +99,7 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian continue; mapTypes.prepend(QGeoMapType(QGeoMapType::CustomMap, *it, - tr("User provided style"), false, false, ++mapId)); + tr("User provided style"), false, false, ++mapId, pluginName)); } } diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp index 4a987800..146071f7 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp @@ -90,28 +90,29 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia( setTileSize(QSize(256, 256)); + const QByteArray pluginName = "here"; QList types; - types << QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Normal map view in daylight mode"), false, false, 1); - types << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, 2); - types << QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view in daylight mode"), false, false, 3); - types << QGeoMapType(QGeoMapType::HybridMap, tr("Hybrid Map"), tr("Satellite map view with streets in daylight mode"), false, false, 4); - types << QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Color-reduced map view with public transport scheme in daylight mode"), false, false, 5); - types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Street Map"), tr("Color-reduced map view in daylight mode"), false, false, 6); - types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Street Map"), tr("Mobile normal map view in daylight mode"), true, false, 7); - types << QGeoMapType(QGeoMapType::TerrainMap, tr("Mobile Terrain Map"), tr("Mobile terrain map view in daylight mode"), true, false, 8); - types << QGeoMapType(QGeoMapType::HybridMap, tr("Mobile Hybrid Map"), tr("Mobile satellite map view with streets in daylight mode"), true, false, 9); - types << QGeoMapType(QGeoMapType::TransitMap, tr("Mobile Transit Map"), tr("Mobile color-reduced map view with public transport scheme in daylight mode"), true, false, 10); - types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Street Map"), tr("Mobile color-reduced map view in daylight mode"), true, false, 11); - types << QGeoMapType(QGeoMapType::StreetMap, tr("Custom Street Map"), tr("Normal map view in daylight mode"), false, false, 12); - types << QGeoMapType(QGeoMapType::StreetMap, tr("Night Street Map"), tr("Normal map view in night mode"), false, true, 13); - types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Night Street Map"), tr("Mobile normal map view in night mode"), true, true, 14); - types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Night Street Map"), tr("Color-reduced map view in night mode (especially used for background maps)"), false, true, 15); - types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Night Street Map"), tr("Mobile color-reduced map view in night mode (especially used for background maps)"), true, true, 16); - types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Street Map"), tr("Pedestrian map view in daylight mode"), false, false, 17); - types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Street Map"), tr("Mobile pedestrian map view in daylight mode for mobile usage"), true, false, 18); - types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Night Street Map"), tr("Pedestrian map view in night mode"), false, true, 19); - types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Night Street Map"), tr("Mobile pedestrian map view in night mode for mobile usage"), true, true, 20); - types << QGeoMapType(QGeoMapType::CarNavigationMap, tr("Car Navigation Map"), tr("Normal map view in daylight mode for car navigation"), false, false, 21); + types << QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Normal map view in daylight mode"), false, false, 1, pluginName); + types << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, 2, pluginName); + types << QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view in daylight mode"), false, false, 3, pluginName); + types << QGeoMapType(QGeoMapType::HybridMap, tr("Hybrid Map"), tr("Satellite map view with streets in daylight mode"), false, false, 4, pluginName); + types << QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Color-reduced map view with public transport scheme in daylight mode"), false, false, 5, pluginName); + types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Street Map"), tr("Color-reduced map view in daylight mode"), false, false, 6, pluginName); + types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Street Map"), tr("Mobile normal map view in daylight mode"), true, false, 7, pluginName); + types << QGeoMapType(QGeoMapType::TerrainMap, tr("Mobile Terrain Map"), tr("Mobile terrain map view in daylight mode"), true, false, 8, pluginName); + types << QGeoMapType(QGeoMapType::HybridMap, tr("Mobile Hybrid Map"), tr("Mobile satellite map view with streets in daylight mode"), true, false, 9, pluginName); + types << QGeoMapType(QGeoMapType::TransitMap, tr("Mobile Transit Map"), tr("Mobile color-reduced map view with public transport scheme in daylight mode"), true, false, 10, pluginName); + types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Street Map"), tr("Mobile color-reduced map view in daylight mode"), true, false, 11, pluginName); + types << QGeoMapType(QGeoMapType::StreetMap, tr("Custom Street Map"), tr("Normal map view in daylight mode"), false, false, 12, pluginName); + types << QGeoMapType(QGeoMapType::StreetMap, tr("Night Street Map"), tr("Normal map view in night mode"), false, true, 13, pluginName); + types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Night Street Map"), tr("Mobile normal map view in night mode"), true, true, 14, pluginName); + types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Night Street Map"), tr("Color-reduced map view in night mode (especially used for background maps)"), false, true, 15, pluginName); + types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Night Street Map"), tr("Mobile color-reduced map view in night mode (especially used for background maps)"), true, true, 16, pluginName); + types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Street Map"), tr("Pedestrian map view in daylight mode"), false, false, 17, pluginName); + types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Street Map"), tr("Mobile pedestrian map view in daylight mode for mobile usage"), true, false, 18, pluginName); + types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Night Street Map"), tr("Pedestrian map view in night mode"), false, true, 19, pluginName); + types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Night Street Map"), tr("Mobile pedestrian map view in night mode for mobile usage"), true, true, 20, pluginName); + types << QGeoMapType(QGeoMapType::CarNavigationMap, tr("Car Navigation Map"), tr("Normal map view in daylight mode for car navigation"), false, false, 21, pluginName); setSupportedMapTypes(types); QGeoTileFetcherNokia *fetcher = new QGeoTileFetcherNokia(parameters, networkManager, this, tileSize(), ppi); @@ -124,7 +125,7 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia( m_cacheDirectory = parameters.value(QStringLiteral("here.mapping.cache.directory")).toString(); } else { // managerName() is not yet set, we have to hardcode the plugin name below - m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String("here"); + m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String(pluginName); } QGeoFileTileCache *tileCache = new QGeoFileTileCacheNokia(ppi, m_cacheDirectory); diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp index 2f2d9c80..da7b61d2 100644 --- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp @@ -162,26 +162,27 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian /* QGeoTileProviderOsms setup */ + const QByteArray pluginName = "osm"; m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Street map view in daylight mode"), false, false, 1), + QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Street map view in daylight mode"), false, false, 1, pluginName), providers_street, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, 2), + QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, 2, pluginName), providers_satellite, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::CycleMap, tr("Cycle Map"), tr("Cycle map view in daylight mode"), false, false, 3), + QGeoMapType(QGeoMapType::CycleMap, tr("Cycle Map"), tr("Cycle map view in daylight mode"), false, false, 3, pluginName), providers_cycle, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Public transit map view in daylight mode"), false, false, 4), + QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Public transit map view in daylight mode"), false, false, 4, pluginName), providers_transit, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::TransitMap, tr("Night Transit Map"), tr("Public transit map view in night mode"), false, true, 5), + QGeoMapType(QGeoMapType::TransitMap, tr("Night Transit Map"), tr("Public transit map view in night mode"), false, true, 5, pluginName), providers_nighttransit, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view"), false, false, 6), + QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view"), false, false, 6, pluginName), providers_terrain, cameraCaps )); m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::PedestrianMap, tr("Hiking Map"), tr("Hiking map view"), false, false, 7), + QGeoMapType(QGeoMapType::PedestrianMap, tr("Hiking Map"), tr("Hiking map view"), false, false, 7, pluginName), providers_hiking, cameraCaps )); if (parameters.contains(QStringLiteral("osm.mapping.custom.host")) @@ -205,7 +206,7 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian m_providers.push_back( new QGeoTileProviderOsm( nm, - QGeoMapType(QGeoMapType::CustomMap, tr("Custom URL Map"), tr("Custom url map view set via urlprefix parameter"), false, false, 8), + QGeoMapType(QGeoMapType::CustomMap, tr("Custom URL Map"), tr("Custom url map view set via urlprefix parameter"), false, false, 8, pluginName), { new TileProvider(tmsServer + QStringLiteral("%z/%x/%y.png"), QStringLiteral("png"), mapCopyright, @@ -237,7 +238,7 @@ QGeoTiledMappingManagerEngineOsm::QGeoTiledMappingManagerEngineOsm(const QVarian m_cacheDirectory = parameters.value(QStringLiteral("osm.mapping.cache.directory")).toString(); } else { // managerName() is not yet set, we have to hardcode the plugin name below - m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String("osm"); + m_cacheDirectory = QAbstractGeoTileCache::baseLocationCacheDirectory() + QLatin1String(pluginName); } if (parameters.contains(QStringLiteral("osm.mapping.offline.directory"))) m_offlineDirectory = parameters.value(QStringLiteral("osm.mapping.offline.directory")).toString(); -- cgit v1.2.1 From c598f11461a0791d1c5fccbf328b833722207ab0 Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Fri, 5 May 2017 16:52:46 +0200 Subject: Fix for mobile maps from the HERE plugin not showing in low-dpi Apparently these maps support only 250ppi or more. Task-number: QTBUG-60545 Change-Id: Iadb59c4f034cbfd94a825048358583f3a978315f Reviewed-by: Alex Blasche --- src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp index a55f71c0..d07a93ba 100644 --- a/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotilefetcher_nokia.cpp @@ -96,8 +96,15 @@ QGeoTiledMapReply *QGeoTileFetcherNokia::getTileImage(const QGeoTileSpec &spec) { // TODO add error detection for if request.connectivityMode() != QGraphicsGeoMap::OnlineMode int ppi = m_ppi; - if ((spec.mapId() == 2) || (spec.mapId() == 12) || (spec.mapId() == 21)) + if ((spec.mapId() == 2) || (spec.mapId() == 12) || (spec.mapId() == 21)) { ppi = 72; // HiDpi apparently not supported for these maps + } else if ((spec.mapId() >= 7 && spec.mapId() <= 11) + || (spec.mapId() == 14) + || (spec.mapId() == 16) + || (spec.mapId() == 18) + || (spec.mapId() == 20)) { + ppi = 250; // LoDpi apparently not supported for these maps + } QString rawRequest = getRequestString(spec, ppi); if (rawRequest.isEmpty()) { -- cgit v1.2.1 From 87681b757206a4c18a72cfa8c92d10c1a09d4af3 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 15 May 2017 08:06:08 +0200 Subject: mapboxgl: Fix dynamic opengl build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default in Qt was changed back to ANGLE being split into libEGL and libGLESv2. mapboxgl now supports both both configurations - having two libraries and combining them into QtANGLE. Task-number: QTBUG-60795 Change-Id: Id3297ed295b20872bc0693b8cd3596a03e739b98 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen Reviewed-by: Jan Arve Sæther --- src/plugins/geoservices/mapboxgl/mapboxgl.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index 7781fd6d..f35f26dc 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -43,7 +43,8 @@ qtConfig(icu) { # OpenGL ES and does not use QOpenGLFunctions for resolving # the OpenGL symbols. -lopengl32 only gives OpenGL 1.1. win32:qtConfig(dynamicgl) { - LIBS_PRIVATE += -lQtANGLE + qtConfig(combined-angle-lib): LIBS_PRIVATE += -l$${LIBQTANGLE_NAME} + else: LIBS_PRIVATE += -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} } PLUGIN_TYPE = geoservices -- cgit v1.2.1 From 5767601d95e33b20962d0cd88cc6ce5c8c724a91 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Thu, 11 May 2017 15:41:37 +0300 Subject: Fix resources not loading on static builds Explicitly call Q_INIT_RESOURCE, otherwise the resources are not found and the plugins using resources are broken when building Qt with -static. This patch also adds a prefix to these resources to avoid collision, since they are very generic like "logo.png" or "maps.json". Task-number: QTBUG-60007 Change-Id: Ifb73e9b97af107f2e24f5478f3de534bbd40e158 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/esri/esri.qrc | 2 +- .../geoservices/esri/geotiledmappingmanagerengine_esri.cpp | 2 +- .../geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp | 10 ++++++++++ .../geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h | 2 ++ src/plugins/geoservices/nokia/nokia.pro | 2 +- src/plugins/geoservices/nokia/nokia.qrc | 5 +++++ .../geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp | 10 ++++++++++ .../geoservices/nokia/qgeoserviceproviderplugin_nokia.h | 2 ++ src/plugins/geoservices/nokia/resource.qrc | 5 ----- 9 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 src/plugins/geoservices/nokia/nokia.qrc delete mode 100644 src/plugins/geoservices/nokia/resource.qrc (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/esri/esri.qrc b/src/plugins/geoservices/esri/esri.qrc index 43b0857f..d085b09f 100644 --- a/src/plugins/geoservices/esri/esri.qrc +++ b/src/plugins/geoservices/esri/esri.qrc @@ -1,5 +1,5 @@ - + maps.json diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp index 00d17327..23783d7e 100644 --- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp @@ -240,7 +240,7 @@ bool GeoTiledMappingManagerEngineEsri::initializeMapSources(QGeoServiceProvider: QString *errorString) { initResources(); - QFile mapsFile(":/maps.json"); + QFile mapsFile(":/esri/maps.json"); if (!mapsFile.open(QIODevice::ReadOnly)) { *error = QGeoServiceProvider::NotSupportedError; diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp index fb8dd19e..c7d5d3ee 100644 --- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.cpp @@ -40,8 +40,18 @@ #include +static void initResources() +{ + Q_INIT_RESOURCE(mapboxgl); +} + QT_BEGIN_NAMESPACE +QGeoServiceProviderFactoryMapboxGL::QGeoServiceProviderFactoryMapboxGL() +{ + initResources(); +} + QGeoCodingManagerEngine *QGeoServiceProviderFactoryMapboxGL::createGeocodingManagerEngine( const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const { diff --git a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h index 2bba96f1..b9c0098a 100644 --- a/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h +++ b/src/plugins/geoservices/mapboxgl/qgeoserviceproviderpluginmapboxgl.h @@ -51,6 +51,8 @@ class QGeoServiceProviderFactoryMapboxGL: public QObject, public QGeoServiceProv FILE "mapboxgl_plugin.json") public: + QGeoServiceProviderFactoryMapboxGL(); + QGeoCodingManagerEngine *createGeocodingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; diff --git a/src/plugins/geoservices/nokia/nokia.pro b/src/plugins/geoservices/nokia/nokia.pro index c60bc7af..c6dadd86 100644 --- a/src/plugins/geoservices/nokia/nokia.pro +++ b/src/plugins/geoservices/nokia/nokia.pro @@ -45,7 +45,7 @@ SOURCES += \ include(placesv2/placesv2.pri) -RESOURCES += resource.qrc +RESOURCES += nokia.qrc INCLUDEPATH += ../../../location/maps diff --git a/src/plugins/geoservices/nokia/nokia.qrc b/src/plugins/geoservices/nokia/nokia.qrc new file mode 100644 index 00000000..41d973c5 --- /dev/null +++ b/src/plugins/geoservices/nokia/nokia.qrc @@ -0,0 +1,5 @@ + + + logo.png + + diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp index 4deac4ee..f68a0d99 100644 --- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.cpp @@ -47,6 +47,11 @@ #include #include +static void initResources() +{ + Q_INIT_RESOURCE(nokia); +} + QT_BEGIN_NAMESPACE namespace @@ -110,6 +115,11 @@ namespace } } +QGeoServiceProviderFactoryNokia::QGeoServiceProviderFactoryNokia() +{ + initResources(); +} + QGeoCodingManagerEngine *QGeoServiceProviderFactoryNokia::createGeocodingManagerEngine( const QVariantMap ¶meters, QGeoServiceProvider::Error *error, diff --git a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h index bce65cbf..5ed2645e 100644 --- a/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h +++ b/src/plugins/geoservices/nokia/qgeoserviceproviderplugin_nokia.h @@ -52,6 +52,8 @@ class QGeoServiceProviderFactoryNokia : public QObject, public QGeoServiceProvid FILE "nokia_plugin.json") public: + QGeoServiceProviderFactoryNokia(); + QGeoCodingManagerEngine *createGeocodingManagerEngine(const QVariantMap ¶meters, QGeoServiceProvider::Error *error, QString *errorString) const; diff --git a/src/plugins/geoservices/nokia/resource.qrc b/src/plugins/geoservices/nokia/resource.qrc deleted file mode 100644 index 41d973c5..00000000 --- a/src/plugins/geoservices/nokia/resource.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - logo.png - - -- cgit v1.2.1 From 2244429e7577baee4de062756d0708b076c1541f Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Thu, 11 May 2017 20:28:01 +0300 Subject: Make it possible to MapItems to rendered under some style layers Add a MapParamter to specify the default "before" layer for MapItems that Mapbox GL can render. This can be used for inserting route lines before labels. Change-Id: I3ee414ee8af31f38b74c95b3ecc31df6085bed30 Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp | 10 ++++++++-- src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h | 1 + src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h | 1 + .../mapboxgl/qgeomappingmanagerenginemapboxgl.cpp | 5 +++++ .../geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.h | 1 + src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp | 12 ++++++++---- src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h | 5 +++-- 7 files changed, 27 insertions(+), 8 deletions(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index 563c84f2..82378f0a 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -210,7 +210,7 @@ void QGeoMapMapboxGLPrivate::addMapItem(QDeclarativeGeoMapItemBase *item) QObject::connect(item, &QDeclarativeGeoMapItemBase::mapItemOpacityChanged, q, &QGeoMapMapboxGL::onMapItemPropertyChanged); - m_styleChanges << QMapboxGLStyleChange::addMapItem(item); + m_styleChanges << QMapboxGLStyleChange::addMapItem(item, m_mapItemsBefore); emit q->sgNodeChanged(); } @@ -342,6 +342,12 @@ void QGeoMapMapboxGL::setUseFBO(bool useFBO) d->m_useFBO = useFBO; } +void QGeoMapMapboxGL::setMapItemsBefore(const QString &before) +{ + Q_D(QGeoMapMapboxGL); + d->m_mapItemsBefore = before; +} + QSGNode *QGeoMapMapboxGL::updateSceneGraph(QSGNode *oldNode, QQuickWindow *window) { Q_D(QGeoMapMapboxGL); @@ -362,7 +368,7 @@ void QGeoMapMapboxGL::onMapChanged(QMapboxGL::MapChange change) d->m_styleChanges << QMapboxGLStyleChange::addMapParameter(param); for (QDeclarativeGeoMapItemBase *item : d->m_mapItems) - d->m_styleChanges << QMapboxGLStyleChange::addMapItem(item); + d->m_styleChanges << QMapboxGLStyleChange::addMapItem(item, d->m_mapItemsBefore); } } diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h index 56b97e99..73cfd75a 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h @@ -56,6 +56,7 @@ public: QString copyrightsStyleSheet() const Q_DECL_OVERRIDE; void setMapboxGLSettings(const QMapboxGLSettings &); void setUseFBO(bool); + void setMapItemsBefore(const QString &); private Q_SLOTS: // QMapboxGL diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h index 15e5d167..598c9078 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl_p.h @@ -79,6 +79,7 @@ public: QMapboxGLSettings m_settings; bool m_useFBO = true; bool m_developmentMode = false; + QString m_mapItemsBefore; QTimer m_refresh; bool m_shouldRefresh = true; diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp index 0535bf96..211c0bba 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp @@ -138,6 +138,10 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian m_useFBO = parameters.value(QStringLiteral("mapboxgl.mapping.use_fbo")).toBool(); } + if (parameters.contains(QStringLiteral("mapboxgl.mapping.items.insert_before"))) { + m_mapItemsBefore = parameters.value(QStringLiteral("mapboxgl.mapping.items.insert_before")).toString(); + } + engineInitialized(); } @@ -150,6 +154,7 @@ QGeoMap *QGeoMappingManagerEngineMapboxGL::createMap() QGeoMapMapboxGL* map = new QGeoMapMapboxGL(this, 0); map->setMapboxGLSettings(m_settings); map->setUseFBO(m_useFBO); + map->setMapItemsBefore(m_mapItemsBefore); return map; } diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.h index c5923cda..44096e60 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.h +++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.h @@ -59,6 +59,7 @@ public: private: QMapboxGLSettings m_settings; bool m_useFBO = true; + QString m_mapItemsBefore; }; QT_END_NAMESPACE diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp index eccc64b8..8229b784 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange.cpp @@ -175,7 +175,7 @@ QList> QMapboxGLStyleChange::addMapParamete return changes; } -QList> QMapboxGLStyleChange::addMapItem(QDeclarativeGeoMapItemBase *item) +QList> QMapboxGLStyleChange::addMapItem(QDeclarativeGeoMapItemBase *item, const QString &before) { QList> changes; @@ -191,7 +191,7 @@ QList> QMapboxGLStyleChange::addMapItem(QDe QMapbox::Feature feature = featureFromMapItem(item); - changes << QMapboxGLStyleAddLayer::fromFeature(feature); + changes << QMapboxGLStyleAddLayer::fromFeature(feature, before); changes << QMapboxGLStyleAddSource::fromFeature(feature); changes << QMapboxGLStyleSetPaintProperty::fromMapItem(item); changes << QMapboxGLStyleSetLayoutProperty::fromMapItem(item); @@ -390,7 +390,7 @@ QList> QMapboxGLStyleSetPaintProperty::from void QMapboxGLStyleAddLayer::apply(QMapboxGL *map) { - map->addLayer(m_params); + map->addLayer(m_params, m_before); } QSharedPointer QMapboxGLStyleAddLayer::fromMapParameter(QGeoMapParameter *param) @@ -406,10 +406,12 @@ QSharedPointer QMapboxGLStyleAddLayer::fromMapParameter(QG layer->m_params[QStringLiteral("source-layer")] = param->property("sourceLayer"); } + layer->m_before = param->property("before").toString(); + return QSharedPointer(layer); } -QSharedPointer QMapboxGLStyleAddLayer::fromFeature(const QMapbox::Feature &feature) +QSharedPointer QMapboxGLStyleAddLayer::fromFeature(const QMapbox::Feature &feature, const QString &before) { auto layer = new QMapboxGLStyleAddLayer(); layer->m_params[QStringLiteral("id")] = feature.id; @@ -427,6 +429,8 @@ QSharedPointer QMapboxGLStyleAddLayer::fromFeature(const Q break; } + layer->m_before = before; + return QSharedPointer(layer); } diff --git a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h index a380660b..9164591a 100644 --- a/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h +++ b/src/plugins/geoservices/mapboxgl/qmapboxglstylechange_p.h @@ -58,7 +58,7 @@ public: virtual ~QMapboxGLStyleChange() = default; static QList> addMapParameter(QGeoMapParameter *); - static QList> addMapItem(QDeclarativeGeoMapItemBase *); + static QList> addMapItem(QDeclarativeGeoMapItemBase *, const QString &before); static QList> removeMapItem(QDeclarativeGeoMapItemBase *); virtual void apply(QMapboxGL *map) = 0; @@ -109,7 +109,7 @@ class QMapboxGLStyleAddLayer : public QMapboxGLStyleChange { public: static QSharedPointer fromMapParameter(QGeoMapParameter *); - static QSharedPointer fromFeature(const QMapbox::Feature &feature); + static QSharedPointer fromFeature(const QMapbox::Feature &feature, const QString &before); void apply(QMapboxGL *map) Q_DECL_OVERRIDE; @@ -117,6 +117,7 @@ private: QMapboxGLStyleAddLayer() = default; QVariantMap m_params; + QString m_before; }; class QMapboxGLStyleRemoveLayer : public QMapboxGLStyleChange -- cgit v1.2.1 From 31c594d25b22204afced1832aab1c654bb9d8137 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Tue, 30 May 2017 11:19:32 -0300 Subject: Fix build when OpenGL is disabled Make OpenGL a requirement for the Mapbox GL plugin. Task-number: QTBUG-61087 Change-Id: I8d8224f14fdff01c03d48991c4ff704d74e70234 Reviewed-by: Qt CI Bot Reviewed-by: Paolo Angelelli --- src/plugins/geoservices/geoservices.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/geoservices') diff --git a/src/plugins/geoservices/geoservices.pro b/src/plugins/geoservices/geoservices.pro index 0810d392..459897a8 100644 --- a/src/plugins/geoservices/geoservices.pro +++ b/src/plugins/geoservices/geoservices.pro @@ -6,7 +6,7 @@ qtConfig(concurrent) { SUBDIRS += osm } -qtConfig(c++14):!win32|mingw:!qnx { +qtConfig(opengl):qtConfig(c++14):!win32|mingw:!qnx { !exists(../../3rdparty/mapbox-gl-native/CMakeLists.txt) { warning("Submodule mapbox-gl-native does not exist. Run 'git submodule update --init' on qtlocation.") } else { -- cgit v1.2.1