summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index b8e0ec87e..76d48b7ba 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -1,4 +1,5 @@
#include "globe.h"
+#include <QGeoCoordinate>
#ifndef NO_MARBLE
#include "mainwindow.h"
#include "helpers.h"
@@ -392,3 +393,10 @@ void GlobeGPS::reload()
{
}
#endif
+
+extern "C" double getDistance(int lat1, int lon1, int lat2, int lon2)
+{
+ QGeoCoordinate c1(lat1 / 1000000.0, lon1 / 1000000.0);
+ QGeoCoordinate c2(lat2 / 1000000.0, lon2 / 1000000.0);
+ return c1.distanceTo(c2);
+}