summaryrefslogtreecommitdiff
path: root/src/plugins/geoservices/osm/qplacemanagerengineosm.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/qplacemanagerengineosm.cpp
parent4b7889ff9e3784f9201b7d878606a9f84521815a (diff)
downloadqtlocation-cc988feee350e3ff35d11c7c484fed08981ef67c.tar.gz
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/qplacemanagerengineosm.cpp')
-rw-r--r--src/plugins/geoservices/osm/qplacemanagerengineosm.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp
index dcf02b13..16632b67 100644
--- a/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp
+++ b/src/plugins/geoservices/osm/qplacemanagerengineosm.cpp
@@ -134,25 +134,7 @@ QPlaceSearchReply *QPlaceManagerEngineOsm::search(const QPlaceSearchRequest &req
//queryItems.addQueryItem(QStringLiteral("accept-language"), QStringLiteral("en"));
- QGeoRectangle boundingBox;
- QGeoShape searchArea = request.searchArea();
- switch (searchArea.type()) {
- case QGeoShape::CircleType: {
- QGeoCircle c(searchArea);
- qreal radius = c.radius();
- if (radius < 0)
- radius = 50000;
-
- boundingBox = QGeoRectangle(c.center().atDistanceAndAzimuth(radius, -45),
- c.center().atDistanceAndAzimuth(radius, 135));
- break;
- }
- case QGeoShape::RectangleType:
- boundingBox = searchArea;
- break;
- default:
- ;
- }
+ QGeoRectangle boundingBox = request.searchArea().boundingGeoRectangle();
if (!boundingBox.isEmpty()) {
queryItems.addQueryItem(QStringLiteral("bounded"), QStringLiteral("1"));