summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-08-26 15:38:38 +0200
committerPaolo Angelelli <paolo.angelelli@theqtcompany.com>2016-08-26 14:02:25 +0000
commit14fac7ee65202b0af7032aaade16d1611bc43731 (patch)
tree7032ae33fab2b76a0410dc39f1164675ac390284
parentfafc158427e9d54298ce5c3419c1d4b6ec3b946e (diff)
downloadqtlocation-14fac7ee65202b0af7032aaade16d1611bc43731.tar.gz
Fix for broken geocoding in mapviewer with OSM plugin
OSM Nominatim blocks user agents for default libraries. This patch adds a specific user agent to the mapviewer example if one isn't provided by the user Change-Id: I9bc598eec6f53b0990c7cd0fb42cf3ef7807bedb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
-rw-r--r--examples/location/mapviewer/main.cpp2
-rw-r--r--src/location/doc/src/plugins/osm.qdoc4
2 files changed, 5 insertions, 1 deletions
diff --git a/examples/location/mapviewer/main.cpp b/examples/location/mapviewer/main.cpp
index 8b8991fe..1b526435 100644
--- a/examples/location/mapviewer/main.cpp
+++ b/examples/location/mapviewer/main.cpp
@@ -91,6 +91,8 @@ int main(int argc, char *argv[])
if (parseArgs(args, parameters))
return 0;
+ if (!args.contains(QStringLiteral("osm.useragent")))
+ parameters[QStringLiteral("osm.useragent")] = QStringLiteral("QtLocation Mapviewer example");
QQmlApplicationEngine engine;
engine.addImportPath(QStringLiteral(":/imports"));
diff --git a/src/location/doc/src/plugins/osm.qdoc b/src/location/doc/src/plugins/osm.qdoc
index 75ac104d..1960fae9 100644
--- a/src/location/doc/src/plugins/osm.qdoc
+++ b/src/location/doc/src/plugins/osm.qdoc
@@ -63,7 +63,9 @@ a prefix.
\row
\li osm.useragent
\li User agent string set when making network requests. This parameter should be set to a
- value that uniquely identifies the application.
+ value that uniquely identifies the application. Note that providers might block applications not setting this
+ parameter, leaving it to the stock plugin user agent (e.g., \l {http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy}{Nominatim}
+ for geocoding)
\row
\li osm.mapping.custom.host
\li Url string set when making network requests to the tile server. This parameter should be set to a