summaryrefslogtreecommitdiff
path: root/examples/location
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-07-11 14:27:34 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2016-07-27 05:36:25 +0000
commit04762a9eecafc80ebeb90c06258de551d451497f (patch)
tree1ac1ff2d6ea9f9fb448fee41aca0f2a30a50eea1 /examples/location
parent5adda3e6651f3d45838ece962a4ae656eac5af04 (diff)
downloadqtlocation-04762a9eecafc80ebeb90c06258de551d451497f.tar.gz
Add indirection for osm providers
To prevent furter breakage of qtlocation osm provider in existing qt versions, this patch introduces one level of indirection in resolving OSM providers, fetching the tile server address from files hosted at http://maps-redirect.qt.io/osm/5.6/ The content of the files requested for the server address resolution must be in JSON format, containing (currently) the following fields: { "Enabled" : bool, (optional) "UrlTemplate" : "<url template>", (mandatory) "ImageFormat" : "<image format>", (mandatory) "MapCopyRight" : "<copyright>", (mandatory) "DataCopyRight" : "<copyright>", (mandatory) "MinimumZoomLevel" : <minimumZoomLevel>, (optional) "MaximumZoomLevel" : <maximumZoomLevel>, (optional) } Enabled is optional, and allows us to temporarily disable tile providers if they go offline without firing requests to them. Default is true. MinimumZoomLevel and MaximumZoomLevel are also optional, and allow us to prevent tile requests to the providers, if they do not support the specific ZL. Default is 0 and 19, respectively. <server address template> is required, and is the tile url template, with %x, %y and %z as placeholders for the actual parameters. Example: http://localhost:8080/maps/%z/%x/%y.png <image format> is required, and is the format of the tile. Example: "png" or "jpg" <MapCopyRight> is required and is the string that will be displayed in the "Map (c)" part of the on-screen copyright notice. example: "<a href='http://www.mapquest.com/'>MapQuest</a>" <DataCopyRight> is required and is the string that will be displayed in the "Data (c)" part of the on-screen copyright notice. example: "a href= 'http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors" The patch also adds four additional OSM plugin parameters, modifies an existing ones, and removes another existing one. Removed: - osm.mapping.copyright, now removed and replaced by two other parameters (see below). New: - osm.mapping.providersrepository.address, allowing to change the hardcoded http://maps-redirect.qt.io/osm/5.6/ The implication of this parameter is that it becomes possible to use file:// urls or even qrc:, allowing to ship custom providers with the applicarions - osm.mapping.providersrepository.disabled, allowing to disable the indirection and go with hardcoded URLs by default. - osm.mapping.custom.mapcopyright replaces the old osm.mapping.copyright, and contains the copyright notice to be displayed next to the "Map (c)" part of the copyright, to be consistent with the way the copyright notice coming from the provider data is handled - osm.mapping.custom.datacopyright replaces the old osm.mapping.copyright, and contains the copyright notice to be displayed next to the "Data (c)" part of the copyright, to be consistent with the way the copyright notice coming from the provider data is handled Modified: - osm.mapping.host now became osm.mapping.custom.host, improving the naming consistency. Task-number: QTBUG-54599 Change-Id: Iee88883572a198c00bcf54cf2bc33fbcc0498a68 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location')
-rw-r--r--examples/location/mapviewer/mapviewer.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index eca51485..1b49472c 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -74,7 +74,7 @@ ApplicationWindow {
map = mapComponent.createObject(page);
map.plugin = plugin;
- map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
+ map.zoomLevel = 8
}
function getPlugins()