diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-07-11 14:27:34 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2016-07-27 05:36:25 +0000 |
commit | 04762a9eecafc80ebeb90c06258de551d451497f (patch) | |
tree | 1ac1ff2d6ea9f9fb448fee41aca0f2a30a50eea1 /src/plugins/geoservices/osm/osm.pro | |
parent | 5adda3e6651f3d45838ece962a4ae656eac5af04 (diff) | |
download | qtlocation-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 'src/plugins/geoservices/osm/osm.pro')
-rw-r--r-- | src/plugins/geoservices/osm/osm.pro | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/geoservices/osm/osm.pro b/src/plugins/geoservices/osm/osm.pro index e73c16d7..56f4cb33 100644 --- a/src/plugins/geoservices/osm/osm.pro +++ b/src/plugins/geoservices/osm/osm.pro @@ -14,7 +14,8 @@ HEADERS += \ qplacemanagerengineosm.h \ qplacesearchreplyosm.h \ qplacecategoriesreplyosm.h \ - qgeotiledmaposm.h + qgeotiledmaposm.h \ + qgeotileproviderosm.h SOURCES += \ qgeoserviceproviderpluginosm.cpp \ @@ -28,7 +29,8 @@ SOURCES += \ qplacemanagerengineosm.cpp \ qplacesearchreplyosm.cpp \ qplacecategoriesreplyosm.cpp \ - qgeotiledmaposm.cpp + qgeotiledmaposm.cpp \ + qgeotileproviderosm.cpp OTHER_FILES += \ |