summaryrefslogtreecommitdiffstats
path: root/src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-12-20 17:48:00 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-01-09 10:37:50 +0000
commitcc988feee350e3ff35d11c7c484fed08981ef67c (patch)
treed4f05112f90c240e22ef0f54a93472ed9ba6408a /src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp
parent4b7889ff9e3784f9201b7d878606a9f84521815a (diff)
Use QGeoShapes properly throughout the module
Adds proper support to other valid shapes and use ::boundingGeoRectangle where appropriate. Change-Id: Ibba4cb18f5cca08df62d15b76fa0e1f249dc6fbb Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp')
-rw-r--r--src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp b/src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp
index 693a80a1..6065870a 100644
--- a/src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp
+++ b/src/plugins/geoservices/osm/qgeocodingmanagerengineosm.cpp
@@ -111,8 +111,8 @@ QGeoCodeReply *QGeoCodingManagerEngineOsm::geocode(const QString &address, int l
query.addQueryItem(QStringLiteral("format"), QStringLiteral("json"));
query.addQueryItem(QStringLiteral("accept-language"), locale().name().left(2));
//query.addQueryItem(QStringLiteral("countrycodes"), QStringLiteral("au,jp"));
- if (bounds.type() == QGeoShape::RectangleType) {
- query.addQueryItem(QStringLiteral("viewbox"), boundingBoxToLtrb(bounds));
+ if (bounds.type() != QGeoShape::UnknownType) {
+ query.addQueryItem(QStringLiteral("viewbox"), boundingBoxToLtrb(bounds.boundingGeoRectangle()));
query.addQueryItem(QStringLiteral("bounded"), QStringLiteral("1"));
}
query.addQueryItem(QStringLiteral("polygon_geojson"), QStringLiteral("1"));