diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/geoservices/esri/geotiledmap_esri.cpp | 7 | ||||
-rw-r--r-- | src/plugins/geoservices/mapboxgl/logo.png | bin | 0 -> 3620 bytes | |||
-rw-r--r-- | src/plugins/geoservices/mapboxgl/mapboxgl.pro | 2 | ||||
-rw-r--r-- | src/plugins/geoservices/mapboxgl/mapboxgl.qrc | 5 | ||||
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp | 22 | ||||
-rw-r--r-- | src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h | 1 | ||||
-rw-r--r-- | src/plugins/geoservices/nokia/qgeotiledmap_nokia.cpp | 2 | ||||
-rw-r--r-- | src/plugins/geoservices/nokia/resource.qrc | 2 | ||||
-rw-r--r-- | src/plugins/geoservices/osm/qgeotiledmaposm.cpp | 7 |
9 files changed, 28 insertions, 20 deletions
diff --git a/src/plugins/geoservices/esri/geotiledmap_esri.cpp b/src/plugins/geoservices/esri/geotiledmap_esri.cpp index 8caf055d..9171fc2b 100644 --- a/src/plugins/geoservices/esri/geotiledmap_esri.cpp +++ b/src/plugins/geoservices/esri/geotiledmap_esri.cpp @@ -44,11 +44,6 @@ QT_BEGIN_NAMESPACE -static QString bodify(const QString &html) -{ - return QStringLiteral("<body>") + html + QStringLiteral("</body>"); -} - GeoTiledMapEsri::GeoTiledMapEsri(GeoTiledMappingManagerEngineEsri *engine, QObject *parent) : QGeoTiledMap(engine, parent), m_engine(engine), m_mapId(-1) { @@ -72,7 +67,7 @@ void GeoTiledMapEsri::evaluateCopyrights(const QSet<QGeoTileSpec> &visibleTiles) GeoMapSource *mapSource = engine()->mapSource(m_mapId); if (mapSource) - emit copyrightsChanged(bodify(mapSource->copyright())); + emit copyrightsChanged(mapSource->copyright()); } QT_END_NAMESPACE diff --git a/src/plugins/geoservices/mapboxgl/logo.png b/src/plugins/geoservices/mapboxgl/logo.png Binary files differnew file mode 100644 index 00000000..57410f79 --- /dev/null +++ b/src/plugins/geoservices/mapboxgl/logo.png diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.pro b/src/plugins/geoservices/mapboxgl/mapboxgl.pro index 6714ee55..81dd37e2 100644 --- a/src/plugins/geoservices/mapboxgl/mapboxgl.pro +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.pro @@ -20,6 +20,8 @@ SOURCES += \ qgeomapmapboxgl.cpp \ qsgmapboxglnode.cpp +RESOURCES += mapboxgl.qrc + OTHER_FILES += \ mapboxgl_plugin.json diff --git a/src/plugins/geoservices/mapboxgl/mapboxgl.qrc b/src/plugins/geoservices/mapboxgl/mapboxgl.qrc new file mode 100644 index 00000000..55ff337b --- /dev/null +++ b/src/plugins/geoservices/mapboxgl/mapboxgl.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="/mapboxgl"> + <file>logo.png</file> + </qresource> +</RCC> diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp index 053a926e..0bcd27de 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.cpp @@ -336,6 +336,11 @@ QGeoMapMapboxGL::~QGeoMapMapboxGL() { } +QString QGeoMapMapboxGL::copyrightsStyleSheet() const +{ + return QStringLiteral("* { vertical-align: middle; font-weight: normal }"); +} + void QGeoMapMapboxGL::setMapboxGLSettings(const QMapboxGLSettings& settings) { Q_D(QGeoMapMapboxGL); @@ -395,12 +400,17 @@ void QGeoMapMapboxGL::copyrightsChanged(const QString ©rightsHtml) { Q_D(QGeoMapMapboxGL); + QString copyrightsHtmlFinal = copyrightsHtml; + if (d->m_developmentMode) { - QString copyrightsHtmlDev = "<a href=\"https://www.mapbox.com/pricing/\">" - + tr("Development access token, do not use in production!") + "</a> - " - + copyrightsHtml; - QGeoMap::copyrightsChanged(copyrightsHtmlDev); - } else { - QGeoMap::copyrightsChanged(copyrightsHtml); + copyrightsHtmlFinal.prepend("<a href='https://www.mapbox.com/pricing'>" + + QObject::tr("Development access token, do not use in production!") + "</a> - "); } + + if (d->m_activeMapType.name().startsWith("mapbox://")) { + copyrightsHtmlFinal = "<table><tr><th><img src='qrc:/mapboxgl/logo.png'/></th><th>" + + copyrightsHtmlFinal + "</th></tr></table>"; + } + + QGeoMap::copyrightsChanged(copyrightsHtmlFinal); } diff --git a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h index 4e6bf575..d16d0a6a 100644 --- a/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h +++ b/src/plugins/geoservices/mapboxgl/qgeomapmapboxgl.h @@ -51,6 +51,7 @@ public: QGeoMapMapboxGL(QGeoMappingManagerEngineMapboxGL *engine, QObject *parent); virtual ~QGeoMapMapboxGL(); + QString copyrightsStyleSheet() const Q_DECL_OVERRIDE; void setMapboxGLSettings(const QMapboxGLSettings &); private Q_SLOTS: diff --git a/src/plugins/geoservices/nokia/qgeotiledmap_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmap_nokia.cpp index 5179fff4..90be0ae9 100644 --- a/src/plugins/geoservices/nokia/qgeotiledmap_nokia.cpp +++ b/src/plugins/geoservices/nokia/qgeotiledmap_nokia.cpp @@ -55,7 +55,7 @@ QT_BEGIN_NAMESPACE */ QGeoTiledMapNokia::QGeoTiledMapNokia(QGeoTiledMappingManagerEngineNokia *engine, QObject *parent /*= 0*/) : QGeoTiledMap(engine, parent), - m_logo(":/images/logo.png"), // HERE logo image + m_logo(":/nokia/logo.png"), // HERE logo image m_engine(engine) {} diff --git a/src/plugins/geoservices/nokia/resource.qrc b/src/plugins/geoservices/nokia/resource.qrc index d48a6ca2..41d973c5 100644 --- a/src/plugins/geoservices/nokia/resource.qrc +++ b/src/plugins/geoservices/nokia/resource.qrc @@ -1,5 +1,5 @@ <RCC> - <qresource prefix="/images"> + <qresource prefix="/nokia"> <file>logo.png</file> </qresource> </RCC> diff --git a/src/plugins/geoservices/osm/qgeotiledmaposm.cpp b/src/plugins/geoservices/osm/qgeotiledmaposm.cpp index e1383afb..e31cbdd5 100644 --- a/src/plugins/geoservices/osm/qgeotiledmaposm.cpp +++ b/src/plugins/geoservices/osm/qgeotiledmaposm.cpp @@ -45,11 +45,6 @@ QT_BEGIN_NAMESPACE -static QString bodify(const QString &html) -{ - return QStringLiteral("<body>") + html + QStringLiteral("</body>"); -} - QGeoTiledMapOsm::QGeoTiledMapOsm(QGeoTiledMappingManagerEngineOsm *engine, QObject *parent) : QGeoTiledMap(engine, parent), m_mapId(-1), m_engine(engine) { @@ -114,7 +109,7 @@ void QGeoTiledMapOsm::onProviderDataUpdated(const QGeoTileProviderOsm *provider) if (copyRights.isEmpty() && provider->mapType().style() == QGeoMapType::CustomMap) copyRights = m_engine->customCopyright(); - emit copyrightsChanged(bodify(copyRights)); + emit copyrightsChanged(copyRights); } QT_END_NAMESPACE |