diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-24 04:14:28 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 91302b3d8b9410da050a97d115e816907605410f (patch) | |
tree | 8b98878ac38be1fbd0d2686ed91c53e64273a0fc /mobile-widgets/qmlmapwidgethelper.h | |
parent | 4b8b61100aba6a2457a1b3c36868fcb39b1c5b8a (diff) | |
download | subsurface-91302b3d8b9410da050a97d115e816907605410f.tar.gz |
mapwidgethelper: add means to obtain a small circle radius
Based on a QGeoCoordinate, calculateSmallCircleRadius() calls
some QML Map methods to obtain how big a circle is in meters if
a circle is drawn over the Map widget with radius SMALL_CIRCLE_RADIUS_PX
pixels.
This is called a "small circle" of a sphere:
https://en.wikipedia.org/wiki/Circle_of_a_sphere
This "small circle" radius becomes huge if the map is zoomed out, while
quite small if the map is really zoomed in.
The idea behind this circle is to be able to select multiple nearby dives,
when clicking on the map (TODO).
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets/qmlmapwidgethelper.h')
-rw-r--r-- | mobile-widgets/qmlmapwidgethelper.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mobile-widgets/qmlmapwidgethelper.h b/mobile-widgets/qmlmapwidgethelper.h index 3a7f28eb0..d5cf669fc 100644 --- a/mobile-widgets/qmlmapwidgethelper.h +++ b/mobile-widgets/qmlmapwidgethelper.h @@ -21,10 +21,12 @@ public: void centerOnDiveSite(struct dive_site *);
void reloadMapLocations();
Q_INVOKABLE void copyToClipboardCoordinates(QGeoCoordinate coord, bool formatTraditional);
+ Q_INVOKABLE void calculateSmallCircleRadius(QGeoCoordinate coord);
private:
QObject *m_map;
MapLocationModel *m_mapLocationModel;
+ qreal m_smallCircleRadius;
private slots:
void selectedLocationChanged(MapLocation *);
|