diff options
author | Matthias Rauter <matthias.rauter@qt.io> | 2023-06-28 12:02:29 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-06-29 07:08:11 +0000 |
commit | d8203131a573337f3329cd9ea4f2c97357e1f6f3 (patch) | |
tree | 45cf58790ff5446e75e7ab3662651c6062fb6c1a /examples/location/planespotter/main.cpp | |
parent | b6a04bc22b0f8d35cac8a59971b65ad90eba7e35 (diff) |
Remove private QWebmercator function from planespotter example
The relevant part of the used function can be easily implemented
in the example.
Pick-to: 6.5 6.6
Change-Id: I5e961dcd51fffd11cf1a72a4383a1ed57537b0fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/location/planespotter/main.cpp')
-rw-r--r-- | examples/location/planespotter/main.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/location/planespotter/main.cpp b/examples/location/planespotter/main.cpp index 4e04105c..16748fd0 100644 --- a/examples/location/planespotter/main.cpp +++ b/examples/location/planespotter/main.cpp @@ -10,7 +10,6 @@ #include <QDebug> #include <QEasingCurve> #include <QGeoCoordinate> -#include <QtPositioning/private/qwebmercator_p.h> #define ANIMATION_DURATION 4000 @@ -125,7 +124,7 @@ private: progress = ((qreal)startTime.msecsTo(current) / ANIMATION_DURATION); } - setPosition(QWebMercator::coordinateInterpolation( + setPosition(coordinateInterpolation( fromCoordinate, toCoordinate, easingCurve.valueForProgress(progress))); if (!timer.isActive()) @@ -133,6 +132,15 @@ private: } //! [C++Pilot3] + QGeoCoordinate coordinateInterpolation(const QGeoCoordinate &from, const QGeoCoordinate &to, qreal progress) + { + + QPointF v = QPointF(from.latitude(), from.longitude()) * (1.-progress) + + QPointF(to.latitude(), to.longitude()) * progress; + + return QGeoCoordinate(v.x(), v.y()); + } + private: QGeoCoordinate currentPosition; QGeoCoordinate fromCoordinate, toCoordinate; |