mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-22 09:32:12 +00:00
refine routing controls interactions
This commit is contained in:
1 parent
1a4ae96782
commit
b5fd8ea09b
3 files changed
+28
-8
No files matched your search
+7
-1
@@ -1360,7 +1360,13 @@ export class GPXStatistics {
|
||||
}
|
||||
|
||||
const earthRadius = 6371008.8;
|
||||
export function distance(coord1: Coordinates, coord2: Coordinates): number {
|
||||
export function distance(coord1: TrackPoint | Coordinates, coord2: TrackPoint | Coordinates): number {
|
||||
if (coord1 instanceof TrackPoint) {
|
||||
coord1 = coord1.getCoordinates();
|
||||
}
|
||||
if (coord2 instanceof TrackPoint) {
|
||||
coord2 = coord2.getCoordinates();
|
||||
}
|
||||
const rad = Math.PI / 180;
|
||||
const lat1 = coord1.lat * rad;
|
||||
const lat2 = coord2.lat * rad;
|
||||
|
||||
Reference in new issue
Block a user