summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-07-18 11:26:29 +0200
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-07-31 12:59:58 +0000
commit11da6dec6d47e7670482ed146cced92573cc0b85 (patch)
treedbfb0e3a4f48b1f5e827d48c2ffcf327d5cb3511 /src
parenta4a8d12237c630017a0093823fa9dc9848620eed (diff)
downloadqtlocation-11da6dec6d47e7670482ed146cced92573cc0b85.tar.gz
Add camera capabilities + metadata to QGeoMapType/QDeclarativeGeoMapType
This patch enriches QGeoMapType/QDeclarativeGeoMapType embedding into this object the camera capabilities for this type, that are then exposed via a new QML Type, CameraCapabilities, and custom metadata in form of a QVariantMap, that can be accessed via the new metadata property. [ChangeLog][QtLocation][QDeclarativeGeoMapType] Added CameraCapabilities and metadata properties to QDeclarativeGeoMapType. Task-number: QTBUG-58931 Change-Id: I97a8852fbb3bbac88fdbf0d47e8247ea7ed1f31e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/imports/location/location.cpp7
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp13
-rw-r--r--src/location/declarativemaps/qdeclarativegeomaptype.cpp115
-rw-r--r--src/location/declarativemaps/qdeclarativegeomaptype_p.h30
-rw-r--r--src/location/maps/qgeomappingmanagerengine.cpp8
-rw-r--r--src/location/maps/qgeomappingmanagerengine_p.h2
-rw-r--r--src/location/maps/qgeomaptype.cpp29
-rw-r--r--src/location/maps/qgeomaptype_p.h10
-rw-r--r--src/location/maps/qgeomaptype_p_p.h9
-rw-r--r--src/plugins/geoservices/esri/geomapsource.cpp4
-rw-r--r--src/plugins/geoservices/esri/geomapsource.h3
-rw-r--r--src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp15
-rw-r--r--src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.h2
-rw-r--r--src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp2
-rw-r--r--src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp34
-rw-r--r--src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp22
-rw-r--r--src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp43
-rw-r--r--src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp26
-rw-r--r--src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h1
-rw-r--r--src/plugins/geoservices/osm/qgeotileproviderosm.cpp3
20 files changed, 281 insertions, 97 deletions
diff --git a/src/imports/location/location.cpp b/src/imports/location/location.cpp
index 0a20e5ad..9c89d3b8 100644
--- a/src/imports/location/location.cpp
+++ b/src/imports/location/location.cpp
@@ -100,7 +100,7 @@ public:
int minor = 0;
// Register the 5.0 types
- // 5.0 is siltent and not advertised
+ // 5.0 is silent and not advertised
qmlRegisterType<QDeclarativeGeoServiceProvider >(uri, major, minor, "Plugin");
qmlRegisterType<QDeclarativeGeoServiceProviderParameter >(uri, major, minor, "PluginParameter");
@@ -175,6 +175,11 @@ public:
qmlRegisterType<QDeclarativeGeoMapCopyrightNotice>(uri, major, minor, "MapCopyrightNotice");
qmlRegisterType<QDeclarativeGeoMapItemGroup>(uri, major, minor, "MapItemGroup");
+ // Register the 5.10 types
+ minor = 10;
+ qmlRegisterUncreatableType<QDeclarativeGeoCameraCapabilities>(uri, major, minor, "CameraCapabilities"
+ , QStringLiteral("CameraCapabilities is not intended instantiable by developer."));
+
//registrations below are version independent
qRegisterMetaType<QPlaceCategory>();
qRegisterMetaType<QPlace>();
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index f5d2bdb5..cb991341 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -190,7 +190,11 @@ QDeclarativeGeoMap::QDeclarativeGeoMap(QQuickItem *parent)
m_activeMapType = new QDeclarativeGeoMapType(QGeoMapType(QGeoMapType::NoMap,
tr("No Map"),
- tr("No Map"), false, false, 0, QByteArrayLiteral("")), this);
+ tr("No Map"),
+ false, false,
+ 0,
+ QByteArrayLiteral(""),
+ QGeoCameraCapabilities()), this);
m_cameraData.setCenter(QGeoCoordinate(51.5073,-0.1277)); //London city center
m_cameraData.setZoomLevel(8.0);
@@ -750,7 +754,12 @@ void QDeclarativeGeoMap::mappingManagerInitialized()
} else {
m_activeMapType = new QDeclarativeGeoMapType(QGeoMapType(QGeoMapType::NoMap,
tr("No Map"),
- tr("No Map"), false, false, 0, QByteArrayLiteral("")), this);
+ tr("No Map"),
+ false,
+ false,
+ 0,
+ QByteArrayLiteral(""),
+ QGeoCameraCapabilities()), this);
}
}
diff --git a/src/location/declarativemaps/qdeclarativegeomaptype.cpp b/src/location/declarativemaps/qdeclarativegeomaptype.cpp
index 86444aa4..7e40d414 100644
--- a/src/location/declarativemaps/qdeclarativegeomaptype.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomaptype.cpp
@@ -57,7 +57,8 @@ QT_BEGIN_NAMESPACE
QDeclarativeGeoMapType::QDeclarativeGeoMapType(const QGeoMapType mapType, QObject *parent)
: QObject(parent),
- mapType_(mapType) {}
+ mapType_(mapType),
+ cameraCapabilities_(new QDeclarativeGeoCameraCapabilities(mapType.cameraCapabilities(), this)) {}
QDeclarativeGeoMapType::~QDeclarativeGeoMapType() {}
@@ -131,4 +132,116 @@ bool QDeclarativeGeoMapType::night() const
return mapType_.night();
}
+/*!
+ \qmlproperty CameraCapabilities MapType::cameraCapabilities
+ \since Qt Location 5.10
+
+ This property holds the camera capabilities for this map type.
+*/
+QDeclarativeGeoCameraCapabilities *QDeclarativeGeoMapType::cameraCapabilities() const
+{
+ return cameraCapabilities_;
+}
+
+/*!
+ \qmlproperty VariantMap MapType::metadata
+ \since Qt Location 5.10
+
+ This property holds optional, extra metadata related to a specific map type.
+ The content of this property is entirely plugin-specific.
+*/
+QVariantMap QDeclarativeGeoMapType::metadata() const
+{
+ return mapType_.metadata();
+}
+
+/*
+ * QDeclarativeGeoCameraCapabilities implementation
+ */
+
+/*!
+ \qmltype CameraCapabilities
+ \instantiates QDeclarativeGeoCameraCapabilities
+ \inherits QObject
+ \inqmlmodule QtLocation
+ \ingroup qml-QtLocation5-maps
+ \since Qt Location 5.10
+
+ \brief The CameraCapabilities type holds information about the camera capabilities for a specific map type.
+
+ This includes the map minimum and maximum zoom level, minimum and maximum tilt angle and
+ minimum and maximum field of view.
+*/
+
+QDeclarativeGeoCameraCapabilities::QDeclarativeGeoCameraCapabilities(const QGeoCameraCapabilities &cameraCaps, QObject *parent)
+ : QObject(parent), cameraCaps_(cameraCaps)
+{
+
+}
+
+QDeclarativeGeoCameraCapabilities::~QDeclarativeGeoCameraCapabilities()
+{
+
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::minimumZoomLevel
+
+ This read-only property holds the minimum available zoom level with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::minimumZoomLevel() const
+{
+ return cameraCaps_.minimumZoomLevelAt256();
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::maximumZoomLevel
+
+ This read-only property holds the maximum available zoom level with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::maximumZoomLevel() const
+{
+ return cameraCaps_.maximumZoomLevelAt256();
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::minimumTilt
+
+ This read-only property holds the minimum available tilt with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::minimumTilt() const
+{
+ return cameraCaps_.minimumTilt();
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::maximumTilt
+
+ This read-only property holds the maximum available tilt with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::maximumTilt() const
+{
+ return cameraCaps_.maximumTilt();
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::minimumFieldOfView
+
+ This read-only property holds the minimum available field of view with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::minimumFieldOfView() const
+{
+ return cameraCaps_.minimumFieldOfView();
+}
+
+/*!
+ \qmlproperty qreal CameraCapabilities::maximumFieldOfView
+
+ This read-only property holds the maximum available field of view with this map type.
+*/
+qreal QDeclarativeGeoCameraCapabilities::maximumFieldOfView() const
+{
+ return cameraCaps_.maximumFieldOfView();
+}
+
QT_END_NAMESPACE
diff --git a/src/location/declarativemaps/qdeclarativegeomaptype_p.h b/src/location/declarativemaps/qdeclarativegeomaptype_p.h
index 7b449aa0..5d99083d 100644
--- a/src/location/declarativemaps/qdeclarativegeomaptype_p.h
+++ b/src/location/declarativemaps/qdeclarativegeomaptype_p.h
@@ -56,6 +56,31 @@
QT_BEGIN_NAMESPACE
+class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoCameraCapabilities: public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(qreal minimumZoomLevel READ minimumZoomLevel CONSTANT)
+ Q_PROPERTY(qreal maximumZoomLevel READ maximumZoomLevel CONSTANT)
+ Q_PROPERTY(qreal minimumTilt READ minimumTilt CONSTANT)
+ Q_PROPERTY(qreal maximumTilt READ maximumTilt CONSTANT)
+ Q_PROPERTY(qreal minimumFieldOfView READ minimumFieldOfView CONSTANT)
+ Q_PROPERTY(qreal maximumFieldOfView READ maximumFieldOfView CONSTANT)
+
+public:
+ QDeclarativeGeoCameraCapabilities(const QGeoCameraCapabilities &cameraCaps, QObject *parent = 0);
+ ~QDeclarativeGeoCameraCapabilities();
+
+ qreal minimumZoomLevel() const;
+ qreal maximumZoomLevel() const;
+ qreal minimumTilt() const;
+ qreal maximumTilt() const;
+ qreal minimumFieldOfView() const;
+ qreal maximumFieldOfView() const;
+
+private:
+ QGeoCameraCapabilities cameraCaps_;
+};
+
class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapType : public QObject
{
Q_OBJECT
@@ -66,6 +91,8 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeGeoMapType : public QObject
Q_PROPERTY(QString description READ description CONSTANT)
Q_PROPERTY(bool mobile READ mobile CONSTANT)
Q_PROPERTY(bool night READ night CONSTANT REVISION 1)
+ Q_PROPERTY(QDeclarativeGeoCameraCapabilities *cameraCapabilities READ cameraCapabilities CONSTANT)
+ Q_PROPERTY(QVariantMap metadata READ metadata CONSTANT)
public:
enum MapStyle {
@@ -91,11 +118,14 @@ public:
QString description() const;
bool mobile() const;
bool night() const;
+ QDeclarativeGeoCameraCapabilities *cameraCapabilities() const;
+ QVariantMap metadata() const;
const QGeoMapType mapType() { return mapType_; }
private:
QGeoMapType mapType_;
+ QDeclarativeGeoCameraCapabilities *cameraCapabilities_;
};
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeomappingmanagerengine.cpp b/src/location/maps/qgeomappingmanagerengine.cpp
index ffc0f065..187b30eb 100644
--- a/src/location/maps/qgeomappingmanagerengine.cpp
+++ b/src/location/maps/qgeomappingmanagerengine.cpp
@@ -154,7 +154,13 @@ QGeoCameraCapabilities QGeoMappingManagerEngine::cameraCapabilities(int mapId) c
{
Q_UNUSED(mapId)
Q_D(const QGeoMappingManagerEngine);
- return d->capabilities_;
+
+ if (mapId == 0)
+ return d->capabilities_;
+ int idx = mapId - 1;
+ if (idx >= supportedMapTypes().size())
+ return d->capabilities_;
+ return supportedMapTypes().at(idx).cameraCapabilities();
}
void QGeoMappingManagerEngine::setCameraCapabilities(const QGeoCameraCapabilities &capabilities)
diff --git a/src/location/maps/qgeomappingmanagerengine_p.h b/src/location/maps/qgeomappingmanagerengine_p.h
index 0f347d73..dd4aa681 100644
--- a/src/location/maps/qgeomappingmanagerengine_p.h
+++ b/src/location/maps/qgeomappingmanagerengine_p.h
@@ -90,7 +90,7 @@ public:
QList<QGeoMapType> supportedMapTypes() const;
// the class is private, so this can be virtual here for now.
- virtual QGeoCameraCapabilities cameraCapabilities(int mapId = 0) const;
+ QGeoCameraCapabilities cameraCapabilities(int mapId = 0) const;
void setLocale(const QLocale &locale);
QLocale locale() const;
diff --git a/src/location/maps/qgeomaptype.cpp b/src/location/maps/qgeomaptype.cpp
index 34781451..c4635998 100644
--- a/src/location/maps/qgeomaptype.cpp
+++ b/src/location/maps/qgeomaptype.cpp
@@ -46,8 +46,11 @@ QGeoMapType::QGeoMapType(const QGeoMapType &other)
: d_ptr(other.d_ptr) {}
QGeoMapType::QGeoMapType(QGeoMapType::MapStyle style, const QString &name,
- const QString &description, bool mobile, bool night, int mapId, QByteArray pluginName)
-: d_ptr(new QGeoMapTypePrivate(style, name, description, mobile, night, mapId, pluginName))
+ const QString &description, bool mobile, bool night, int mapId,
+ const QByteArray &pluginName,
+ const QGeoCameraCapabilities &cameraCapabilities,
+ const QVariantMap &metadata)
+: d_ptr(new QGeoMapTypePrivate(style, name, description, mobile, night, mapId, pluginName, cameraCapabilities, metadata))
{
}
@@ -107,6 +110,16 @@ QByteArray QGeoMapType::pluginName() const
return d_ptr->pluginName_;
}
+QGeoCameraCapabilities QGeoMapType::cameraCapabilities() const
+{
+ return d_ptr->cameraCapabilities_;
+}
+
+QVariantMap QGeoMapType::metadata() const
+{
+ return d_ptr->metadata_;
+}
+
QGeoMapTypePrivate::QGeoMapTypePrivate()
: style_(QGeoMapType::NoMap), mobile_(false), night_(false), mapId_(0)
{
@@ -114,15 +127,18 @@ QGeoMapTypePrivate::QGeoMapTypePrivate()
QGeoMapTypePrivate::QGeoMapTypePrivate(const QGeoMapTypePrivate &other)
: QSharedData(other), style_(other.style_), name_(other.name_), description_(other.description_),
- mobile_(other.mobile_), night_(other.night_), mapId_(other.mapId_), pluginName_(other.pluginName_)
+ mobile_(other.mobile_), night_(other.night_), mapId_(other.mapId_), pluginName_(other.pluginName_),
+ cameraCapabilities_(other.cameraCapabilities_), metadata_(other.metadata_)
{
}
QGeoMapTypePrivate::QGeoMapTypePrivate(QGeoMapType::MapStyle style, const QString &name,
const QString &description, bool mobile, bool night,
- int mapId, QByteArray pluginName)
+ int mapId, const QByteArray &pluginName,
+ const QGeoCameraCapabilities &cameraCapabilities,
+ const QVariantMap &metadata)
: style_(style), name_(name), description_(description), mobile_(mobile), night_(night),
- mapId_(mapId), pluginName_(pluginName)
+ mapId_(mapId), pluginName_(pluginName), cameraCapabilities_(cameraCapabilities), metadata_(metadata)
{
}
@@ -134,7 +150,8 @@ bool QGeoMapTypePrivate::operator==(const QGeoMapTypePrivate &other) const
{
return pluginName_ == other.pluginName_ && style_ == other.style_ && name_ == other.name_ &&
description_ == other.description_ && mobile_ == other.mobile_ && night_ == other.night_ &&
- mapId_ == other.mapId_;
+ mapId_ == other.mapId_ && cameraCapabilities_ == other.cameraCapabilities_ &&
+ metadata_ == other.metadata_;
}
QT_END_NAMESPACE
diff --git a/src/location/maps/qgeomaptype_p.h b/src/location/maps/qgeomaptype_p.h
index 4b5cb0d0..3ce0e95a 100644
--- a/src/location/maps/qgeomaptype_p.h
+++ b/src/location/maps/qgeomaptype_p.h
@@ -51,6 +51,8 @@
#include <QtCore/QString>
#include <QtCore/QSharedDataPointer>
#include <QtLocation/private/qlocationglobal_p.h>
+#include <QtLocation/private/qgeocameracapabilities_p.h>
+#include <QVariantMap>
QT_BEGIN_NAMESPACE
@@ -59,7 +61,7 @@ class QGeoMapTypePrivate;
class Q_LOCATION_PRIVATE_EXPORT QGeoMapType
{
public:
- enum MapStyle {
+ enum MapStyle { // ### Qt6: change this to be a QFlags instead, or remove.
NoMap = 0,
StreetMap,
SatelliteMapDay,
@@ -77,7 +79,9 @@ public:
QGeoMapType();
QGeoMapType(const QGeoMapType &other);
QGeoMapType(MapStyle style, const QString &name, const QString &description, bool mobile,
- bool night, int mapId, QByteArray pluginName);
+ bool night, int mapId, const QByteArray &pluginName,
+ const QGeoCameraCapabilities &cameraCapabilities,
+ const QVariantMap &metadata = QVariantMap());
~QGeoMapType();
QGeoMapType &operator = (const QGeoMapType &other);
@@ -92,6 +96,8 @@ public:
bool night() const;
int mapId() const;
QByteArray pluginName() const;
+ QGeoCameraCapabilities cameraCapabilities() const;
+ QVariantMap metadata() const;
private:
QSharedDataPointer<QGeoMapTypePrivate> d_ptr;
diff --git a/src/location/maps/qgeomaptype_p_p.h b/src/location/maps/qgeomaptype_p_p.h
index 039c0962..e66991ab 100644
--- a/src/location/maps/qgeomaptype_p_p.h
+++ b/src/location/maps/qgeomaptype_p_p.h
@@ -50,9 +50,10 @@
#include <QMetaType>
#include <QString>
+#include <QVariantMap>
#include <QByteArray>
#include <QSharedData>
-
+#include "qgeocameracapabilities_p.h"
#include "qgeomaptype_p.h"
QT_BEGIN_NAMESPACE
@@ -62,7 +63,9 @@ class QGeoMapTypePrivate : public QSharedData
public:
QGeoMapTypePrivate();
QGeoMapTypePrivate(QGeoMapType::MapStyle style, const QString &name, const QString &description, bool mobile,
- bool night, int mapId, QByteArray pluginName);
+ bool night, int mapId, const QByteArray &pluginName,
+ const QGeoCameraCapabilities &cameraCapabilities,
+ const QVariantMap &metadata);
QGeoMapTypePrivate(const QGeoMapTypePrivate &other);
~QGeoMapTypePrivate();
@@ -77,6 +80,8 @@ public:
bool night_;
int mapId_;
QByteArray pluginName_;
+ QGeoCameraCapabilities cameraCapabilities_;
+ QVariantMap metadata_;
};
QT_END_NAMESPACE
diff --git a/src/plugins/geoservices/esri/geomapsource.cpp b/src/plugins/geoservices/esri/geomapsource.cpp
index 19f284e6..7ec63e2f 100644
--- a/src/plugins/geoservices/esri/geomapsource.cpp
+++ b/src/plugins/geoservices/esri/geomapsource.cpp
@@ -67,8 +67,8 @@ 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 &copyright) :
- QGeoMapType(style, name, description, mobile, night, mapId, "esri"),
+ const QString &url, const QString &copyright, const QGeoCameraCapabilities &cameraCapabilities) :
+ QGeoMapType(style, name, description, mobile, night, mapId, "esri", cameraCapabilities),
m_url(url), m_copyright(copyright)
{
}
diff --git a/src/plugins/geoservices/esri/geomapsource.h b/src/plugins/geoservices/esri/geomapsource.h
index 8660e999..86258d2e 100644
--- a/src/plugins/geoservices/esri/geomapsource.h
+++ b/src/plugins/geoservices/esri/geomapsource.h
@@ -41,6 +41,7 @@
#define GEOMAPSOURCE_H
#include <QtLocation/private/qgeomaptype_p.h>
+#include <QtLocation/private/qgeocameracapabilities_p.h>
QT_BEGIN_NAMESPACE
@@ -49,7 +50,7 @@ class GeoMapSource : public QGeoMapType
public:
GeoMapSource(QGeoMapType::MapStyle style, const QString &name,
const QString &description, bool mobile, bool night, int mapId,
- const QString &url, const QString &copyright);
+ const QString &url, const QString &copyright, const QGeoCameraCapabilities &cameraCapabilities);
inline const QString &url() const;
inline const QString &copyright() const;
diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp
index 23783d7e..ac8f8450 100644
--- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp
+++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp
@@ -106,7 +106,7 @@ GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(const QVarian
setTileSize(QSize(256, 256));
- if (!initializeMapSources(error, errorString))
+ if (!initializeMapSources(error, errorString, cameraCaps))
return;
QList<QGeoMapType> mapTypes;
@@ -119,7 +119,8 @@ GeoTiledMappingManagerEngineEsri::GeoTiledMappingManagerEngineEsri(const QVarian
mapSource->mobile(),
mapSource->night(),
mapSource->mapId(),
- "esri");
+ "esri",
+ cameraCaps);
}
setSupportedMapTypes(mapTypes);
@@ -237,7 +238,8 @@ QGeoMap *GeoTiledMappingManagerEngineEsri::createMap()
// template = 'http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{{z}}/{{y}}/{{x}}.png'
bool GeoTiledMappingManagerEngineEsri::initializeMapSources(QGeoServiceProvider::Error *error,
- QString *errorString)
+ QString *errorString,
+ const QGeoCameraCapabilities &cameraCaps)
{
initResources();
QFile mapsFile(":/esri/maps.json");
@@ -271,9 +273,7 @@ bool GeoTiledMappingManagerEngineEsri::initializeMapSources(QGeoServiceProvider:
foreach (QVariant mapSourceElement, mapSources) {
QVariantMap mapSource = mapSourceElement.toMap();
- int mapId = mapSource[kPropMapId].toInt();
- if (mapId <= 0)
- mapId = m_mapSources.count() + 1;
+ int mapId = m_mapSources.count() + 1;
m_mapSources << new GeoMapSource(
GeoMapSource::mapStyle(mapSource[kPropStyle].toString()),
@@ -283,7 +283,8 @@ bool GeoTiledMappingManagerEngineEsri::initializeMapSources(QGeoServiceProvider:
mapSource[kPropMapId].toBool(),
mapId,
GeoMapSource::toFormat(mapSource[kPropUrl].toString()),
- mapSource[kPropCopyright].toString()
+ mapSource[kPropCopyright].toString(),
+ cameraCaps
);
}
diff --git a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.h b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.h
index a13ba05c..ea0c3c8b 100644
--- a/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.h
+++ b/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.h
@@ -63,7 +63,7 @@ public:
GeoMapSource *mapSource(int mapId) const;
private:
- bool initializeMapSources(QGeoServiceProvider::Error *error, QString *errorString);
+ bool initializeMapSources(QGeoServiceProvider::Error *error, QString *errorString, const QGeoCameraCapabilities &cameraCaps);
QList<GeoMapSource *> m_mapSources;
};
diff --git a/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp b/src/plugins/geoservices/itemsoverlay/qgeomappingmanagerengineitemsoverlay.cpp
index 955fbcae..c19815e8 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<QGeoMapType> mapTypes;
- mapTypes << QGeoMapType(QGeoMapType::NoMap, tr("Empty Map"), tr("Empty Map"), false, false, 1, "itemsoverlay");
+ mapTypes << QGeoMapType(QGeoMapType::NoMap, tr("Empty Map"), tr("Empty Map"), false, false, 1, "itemsoverlay", cameraCaps);
setSupportedMapTypes(mapTypes);
engineInitialized();
diff --git a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
index 03a574c3..632b2286 100644
--- a/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
+++ b/src/plugins/geoservices/mapbox/qgeotiledmappingmanagerenginemapbox.cpp
@@ -66,41 +66,41 @@ QGeoTiledMappingManagerEngineMapbox::QGeoTiledMappingManagerEngineMapbox(const Q
// 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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size() + 1, pluginName, cameraCaps);
} 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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size() + 1, pluginName, cameraCaps);
}
// 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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets"), tr("Street"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map using light colors (weak contrast)
- mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.light"), tr("Light"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.light"), tr("Light"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map using dark colors
- mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.dark"), tr("Dark"), false, true, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.dark"), tr("Dark"), false, true, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map created by satellite
- mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox.satellite"), tr("Satellite"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox.satellite"), tr("Satellite"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: 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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox.streets-satellite"), tr("Streets Satellite"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map using wheat paste colors
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.wheatpaste"), tr("Wheatpaste"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.wheatpaste"), tr("Wheatpaste"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a basic street map
- mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets-basic"), tr("Streets Basic"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox.streets-basic"), tr("Streets Basic"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map using cartoon-style fonts
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.comic"), tr("Comic"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.comic"), tr("Comic"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map for outdoor activities
- mapTypes << QGeoMapType(QGeoMapType::PedestrianMap, QStringLiteral("mapbox.outdoors"), tr("Outdoors"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::PedestrianMap, QStringLiteral("mapbox.outdoors"), tr("Outdoors"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: 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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CycleMap, QStringLiteral("mapbox.run-bike-hike"), tr("Run Bike Hike"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map drawn by pencil
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pencil"), tr("Pencil"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pencil"), tr("Pencil"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a treasure map with pirate boat watermark
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pirates"), tr("Pirates"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.pirates"), tr("Pirates"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map using emerald colors
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.emerald"), tr("Emerald"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.emerald"), tr("Emerald"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
//: Noun describing type of a map with high contrast
- mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.high-contrast"), tr("High Contrast"), false, false, mapTypes.size() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, QStringLiteral("mapbox.high-contrast"), tr("High Contrast"), false, false, mapTypes.size() + 1, pluginName, cameraCaps);
// New way to specify multiple customized map_ids via additional_map_ids
if (parameters.contains(QStringLiteral("mapbox.mapping.additional_map_ids"))) {
@@ -109,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() + 1, pluginName);
+ mapTypes << QGeoMapType(QGeoMapType::CustomMap, name, name, false, false, mapTypes.size() + 1, pluginName, cameraCaps);
}
}
diff --git a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
index 211c0bba..9fa8f695 100644
--- a/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
+++ b/src/plugins/geoservices/mapboxgl/qgeomappingmanagerenginemapboxgl.cpp
@@ -70,25 +70,25 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian
const QByteArray pluginName = "mapboxgl";
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/streets-v10"),
- tr("Streets"), false, false, ++mapId, pluginName);
+ tr("Streets"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/basic-v9"),
- tr("Basic"), false, false, ++mapId, pluginName);
+ tr("Basic"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::StreetMap, QStringLiteral("mapbox://styles/mapbox/bright-v9"),
- tr("Bright"), false, false, ++mapId, pluginName);
+ tr("Bright"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::TerrainMap, QStringLiteral("mapbox://styles/mapbox/outdoors-v10"),
- tr("Outdoors"), false, false, ++mapId, pluginName);
+ tr("Outdoors"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::SatelliteMapDay, QStringLiteral("mapbox://styles/mapbox/satellite-v9"),
- tr("Satellite"), false, false, ++mapId, pluginName);
+ tr("Satellite"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::HybridMap, QStringLiteral("mapbox://styles/mapbox/satellite-streets-v10"),
- tr("Satellite Streets"), false, false, ++mapId, pluginName);
+ tr("Satellite Streets"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/light-v9"),
- tr("Light"), false, false, ++mapId, pluginName);
+ tr("Light"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::GrayStreetMap, QStringLiteral("mapbox://styles/mapbox/dark-v9"),
- tr("Dark"), false, false, ++mapId, pluginName);
+ tr("Dark"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-day-v1"),
- tr("Streets Traffic Day"), false, false, ++mapId, pluginName);
+ tr("Streets Traffic Day"), false, false, ++mapId, pluginName, cameraCaps);
mapTypes << QGeoMapType(QGeoMapType::TransitMap, QStringLiteral("mapbox://styles/mapbox/traffic-night-v1"),
- tr("Streets Traffic Night"), false, true, ++mapId, pluginName);
+ tr("Streets Traffic Night"), false, true, ++mapId, pluginName, cameraCaps);
if (parameters.contains(QStringLiteral("mapboxgl.mapping.additional_style_urls"))) {
const QString ids = parameters.value(QStringLiteral("mapboxgl.mapping.additional_style_urls")).toString();
@@ -99,7 +99,7 @@ QGeoMappingManagerEngineMapboxGL::QGeoMappingManagerEngineMapboxGL(const QVarian
continue;
mapTypes.prepend(QGeoMapType(QGeoMapType::CustomMap, *it,
- tr("User provided style"), false, false, ++mapId, pluginName));
+ tr("User provided style"), false, false, ++mapId, pluginName, cameraCaps));
}
}
diff --git a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
index 146071f7..e315c44e 100644
--- a/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
+++ b/src/plugins/geoservices/nokia/qgeotiledmappingmanagerengine_nokia.cpp
@@ -90,29 +90,30 @@ QGeoTiledMappingManagerEngineNokia::QGeoTiledMappingManagerEngineNokia(
setTileSize(QSize(256, 256));
+ int mapId = 0;
const QByteArray pluginName = "here";
QList<QGeoMapType> types;
- 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);
+ types << QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Normal map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::HybridMap, tr("Hybrid Map"), tr("Satellite map view with streets in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Color-reduced map view with public transport scheme in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Street Map"), tr("Color-reduced map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Street Map"), tr("Mobile normal map view in daylight mode"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::TerrainMap, tr("Mobile Terrain Map"), tr("Mobile terrain map view in daylight mode"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::HybridMap, tr("Mobile Hybrid Map"), tr("Mobile satellite map view with streets in daylight mode"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::TransitMap, tr("Mobile Transit Map"), tr("Mobile color-reduced map view with public transport scheme in daylight mode"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Mobile Gray Street Map"), tr("Mobile color-reduced map view in daylight mode"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::StreetMap, tr("Custom Street Map"), tr("Normal map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::StreetMap, tr("Night Street Map"), tr("Normal map view in night mode"), false, true, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::StreetMap, tr("Mobile Night Street Map"), tr("Mobile normal map view in night mode"), true, true, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::GrayStreetMap, tr("Gray Night Street Map"), tr("Color-reduced map view in night mode (especially used for background maps)"), false, true, ++mapId, pluginName, capabilities);
+ 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, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Street Map"), tr("Pedestrian map view in daylight mode"), false, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Street Map"), tr("Mobile pedestrian map view in daylight mode for mobile usage"), true, false, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Pedestrian Night Street Map"), tr("Pedestrian map view in night mode"), false, true, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::PedestrianMap, tr("Mobile Pedestrian Night Street Map"), tr("Mobile pedestrian map view in night mode for mobile usage"), true, true, ++mapId, pluginName, capabilities);
+ types << QGeoMapType(QGeoMapType::CarNavigationMap, tr("Car Navigation Map"), tr("Normal map view in daylight mode for car navigation"), false, false, ++mapId, pluginName, capabilities);
setSupportedMapTypes(types);
QGeoTileFetcherNokia *fetcher = new QGeoTileFetcherNokia(parameters, networkManager, this, tileSize(), ppi);
diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
index da7b61d2..3f0062c0 100644
--- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.cpp
@@ -164,25 +164,25 @@ 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, pluginName),
+ QGeoMapType(QGeoMapType::StreetMap, tr("Street Map"), tr("Street map view in daylight mode"), false, false, 1, pluginName, cameraCaps),
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, pluginName),
+ QGeoMapType(QGeoMapType::SatelliteMapDay, tr("Satellite Map"), tr("Satellite map view in daylight mode"), false, false, 2, pluginName, cameraCaps),
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, pluginName),
+ QGeoMapType(QGeoMapType::CycleMap, tr("Cycle Map"), tr("Cycle map view in daylight mode"), false, false, 3, pluginName, cameraCaps),
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, pluginName),
+ QGeoMapType(QGeoMapType::TransitMap, tr("Transit Map"), tr("Public transit map view in daylight mode"), false, false, 4, pluginName, cameraCaps),
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, pluginName),
+ QGeoMapType(QGeoMapType::TransitMap, tr("Night Transit Map"), tr("Public transit map view in night mode"), false, true, 5, pluginName, cameraCaps),
providers_nighttransit, cameraCaps ));
m_providers.push_back( new QGeoTileProviderOsm( nm,
- QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view"), false, false, 6, pluginName),
+ QGeoMapType(QGeoMapType::TerrainMap, tr("Terrain Map"), tr("Terrain map view"), false, false, 6, pluginName, cameraCaps),
providers_terrain, cameraCaps ));
m_providers.push_back( new QGeoTileProviderOsm( nm,
- QGeoMapType(QGeoMapType::PedestrianMap, tr("Hiking Map"), tr("Hiking map view"), false, false, 7, pluginName),
+ QGeoMapType(QGeoMapType::PedestrianMap, tr("Hiking Map"), tr("Hiking map view"), false, false, 7, pluginName, cameraCaps),
providers_hiking, cameraCaps ));
if (parameters.contains(QStringLiteral("osm.mapping.custom.host"))
@@ -206,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, pluginName),
+ QGeoMapType(QGeoMapType::CustomMap, tr("Custom URL Map"), tr("Custom url map view set via urlprefix parameter"), false, false, 8, pluginName, cameraCaps),
{ new TileProvider(tmsServer + QStringLiteral("%z/%x/%y.png"),
QStringLiteral("png"),
mapCopyright,
@@ -351,16 +351,6 @@ QString QGeoTiledMappingManagerEngineOsm::customCopyright() const
return m_customCopyright;
}
-QGeoCameraCapabilities QGeoTiledMappingManagerEngineOsm::cameraCapabilities(int mapId) const
-{
- if (mapId == 0)
- return QGeoMappingManagerEngine::cameraCapabilities(mapId);
- int idx = mapId - 1;
- if (idx >= m_providers.size())
- return QGeoMappingManagerEngine::cameraCapabilities(mapId);
- return m_providers[idx]->cameraCapabilities();
-}
-
void QGeoTiledMappingManagerEngineOsm::onProviderResolutionFinished(const QGeoTileProviderOsm *provider)
{
if (!provider->isResolved())
diff --git a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h
index c5f16c2b..12290c8f 100644
--- a/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h
+++ b/src/plugins/geoservices/osm/qgeotiledmappingmanagerengineosm.h
@@ -62,7 +62,6 @@ public:
QGeoMap *createMap() override;
const QVector<QGeoTileProviderOsm *> &providers();
QString customCopyright() const;
- QGeoCameraCapabilities cameraCapabilities(int mapId) const override;
protected Q_SLOTS:
void onProviderResolutionFinished(const QGeoTileProviderOsm *provider);
diff --git a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
index ad8edfd5..e736f6b7 100644
--- a/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
+++ b/src/plugins/geoservices/osm/qgeotileproviderosm.cpp
@@ -234,7 +234,8 @@ void QGeoTileProviderOsm::updateCameraCapabilities()
m_cameraCapabilities.setMinimumZoomLevel(minimumZoomLevel());
m_cameraCapabilities.setMaximumZoomLevel(maximumZoomLevel());
- // Pushing the change
+ m_mapType = QGeoMapType(m_mapType.style(), m_mapType.name(), m_mapType.description(), m_mapType.mobile(),
+ m_mapType.night(), m_mapType.mapId(), m_mapType.pluginName(), m_cameraCapabilities);
}
void QGeoTileProviderOsm::addProvider(TileProvider *provider)