summaryrefslogtreecommitdiffstats
path: root/src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp
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/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp
parenta4a8d12237c630017a0093823fa9dc9848620eed (diff)
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/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp')
-rw-r--r--src/plugins/geoservices/esri/geotiledmappingmanagerengine_esri.cpp15
1 files changed, 8 insertions, 7 deletions
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
);
}