From 04762a9eecafc80ebeb90c06258de551d451497f Mon Sep 17 00:00:00 2001 From: Paolo Angelelli Date: Mon, 11 Jul 2016 14:27:34 +0200 Subject: 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" : "", (mandatory) "ImageFormat" : "", (mandatory) "MapCopyRight" : "", (mandatory) "DataCopyRight" : "", (mandatory) "MinimumZoomLevel" : , (optional) "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. 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 is required, and is the format of the tile. Example: "png" or "jpg" is required and is the string that will be displayed in the "Map (c)" part of the on-screen copyright notice. example: "MapQuest" 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 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 --- examples/location/mapviewer/mapviewer.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/location/mapviewer/mapviewer.qml') 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() -- cgit v1.2.3