mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
4b8b61100a
commit
91302b3d8b
2 changed files with 27 additions and 0 deletions
|
@ -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 *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue