summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 9b19a0ac..9745e315 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -46,6 +46,7 @@
#include <QtPositioning/QGeoCircle>
#include <QtPositioning/QGeoRectangle>
#include <QtPositioning/QGeoPath>
+#include <QtPositioning/QGeoPolygon>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QSGRectangleNode>
#include <QtQuick/private/qquickwindow_p.h>
@@ -1341,22 +1342,22 @@ QGeoShape QDeclarativeGeoMap::visibleRegion() const
return m_visibleRegion;
const QList<QDoubleVector2D> &visibleRegion = m_map->geoProjection().visibleRegion();
- QGeoPath path;
+ QGeoPolygon poly;
for (int i = 0; i < visibleRegion.size(); ++i) {
const QDoubleVector2D &c = visibleRegion.at(i);
// If a segment spans more than half of the map longitudinally, split in 2.
if (i && qAbs(visibleRegion.at(i-1).x() - c.x()) >= 0.5) { // This assumes a segment is never >= 1.0 (whole map span)
QDoubleVector2D extraPoint = (visibleRegion.at(i-1) + c) * 0.5;
- path.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(extraPoint));
+ poly.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(extraPoint));
}
- path.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(c));
+ poly.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(c));
}
if (visibleRegion.size() >= 2 && qAbs(visibleRegion.last().x() - visibleRegion.first().x()) >= 0.5) {
QDoubleVector2D extraPoint = (visibleRegion.last() + visibleRegion.first()) * 0.5;
- path.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(extraPoint));
+ poly.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(extraPoint));
}
- return path.boundingGeoRectangle();
+ return poly;
}
/*!