summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeomap_p.h
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2016-06-27 08:33:20 +0200
committerAlex Blasche <alexander.blasche@qt.io>2016-07-28 08:08:04 +0000
commitcd12d3c8eaf1c1a3dabfb50f88c635b9b1def3fc (patch)
treeb5d196b1019b8d90c00b0c919c1cfb9180b5561a /src/location/maps/qgeomap_p.h
parent04762a9eecafc80ebeb90c06258de551d451497f (diff)
downloadqtlocation-cd12d3c8eaf1c1a3dabfb50f88c635b9b1def3fc.tar.gz
Fix the fitViewportToGeoShape calculation
The current implementation is calculating the bounding box of a geocircle based on moving along a circle of latitude by the distance of a circle's radius. Unfortunately the distances on a small circle of a sphere are greater than great circle distances. Reimplement the calculation using tangential points between a geocircle and meridians. Do not center the viewport in the center of the geoshape, use the center of the bounding box instead. Simplify zoom level adjustment calculations, use the reference world plane to get rid of longitude wrapping and rounding erros. Finally update a viewport unit test, adjust the minimum map size to 256x256, so fitToViewport calls have chance to succeed. Fix out of order test execution. Task-number: QTBUG-54337 Change-Id: I61726a4eb7183470c493ceb03d101f3a75305121 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeomap_p.h')
-rw-r--r--src/location/maps/qgeomap_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/location/maps/qgeomap_p.h b/src/location/maps/qgeomap_p.h
index acc928ea..9f3043aa 100644
--- a/src/location/maps/qgeomap_p.h
+++ b/src/location/maps/qgeomap_p.h
@@ -83,6 +83,8 @@ public:
virtual QGeoCoordinate itemPositionToCoordinate(const QDoubleVector2D &pos, bool clipToViewport = true) const = 0;
virtual QDoubleVector2D coordinateToItemPosition(const QGeoCoordinate &coordinate, bool clipToViewport = true) const = 0;
+ virtual QDoubleVector2D referenceCoordinateToItemPosition(const QGeoCoordinate &coordinate) const = 0;
+ virtual QGeoCoordinate referenceItemPositionToCoordinate(const QDoubleVector2D &pos) const = 0;
virtual void prefetchData();
virtual void clearData();