diff options
Diffstat (limited to 'src/location/declarativemaps/qdeclarativegeomap.cpp')
-rw-r--r-- | src/location/declarativemaps/qdeclarativegeomap.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp index 9f4dae3f..572745fd 100644 --- a/src/location/declarativemaps/qdeclarativegeomap.cpp +++ b/src/location/declarativemaps/qdeclarativegeomap.cpp @@ -1324,7 +1324,17 @@ QGeoShape QDeclarativeGeoMap::visibleRegion() const for (const QDoubleVector2D &c: visibleRegion) path.addCoordinate(m_map->geoProjection().wrappedMapProjectionToGeo(c)); - return path.boundingGeoRectangle(); + QGeoRectangle vr = path.boundingGeoRectangle(); + + bool empty = vr.topLeft().latitude() == vr.bottomRight().latitude() || + qFuzzyCompare(vr.topLeft().longitude(), vr.bottomRight().longitude()); // QTBUG-57690 + + if (empty) { + vr.setTopLeft(QGeoCoordinate(vr.topLeft().latitude(), -180)); + vr.setBottomRight(QGeoCoordinate(vr.bottomRight().latitude(), 180)); + } + + return vr; } /*! |