mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-01 08:12:32 +00:00
get waypoint elevation
This commit is contained in:
@@ -338,7 +338,11 @@ export class GPXLayer {
|
|||||||
let waypoint = get(currentPopupWaypoint)?.[0];
|
let waypoint = get(currentPopupWaypoint)?.[0];
|
||||||
if (waypoint) {
|
if (waypoint) {
|
||||||
let marker = this.markers[waypoint._data.index];
|
let marker = this.markers[waypoint._data.index];
|
||||||
if (this.map.project(marker.getLngLat()).dist(this.map.project(e.lngLat)) > 100) {
|
if (marker) {
|
||||||
|
if (this.map.project(marker.getLngLat()).dist(this.map.project(e.lngLat)) > 100) {
|
||||||
|
this.hideWaypointPopup();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
this.hideWaypointPopup();
|
this.hideWaypointPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -131,7 +131,8 @@
|
|||||||
lon: longitude
|
lon: longitude
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// TODO get elevation for waypoint
|
waypoint.ele =
|
||||||
|
get(map)?.queryTerrainElevation([longitude, latitude], { exaggerated: false }) ?? 0;
|
||||||
dbUtils.applyToFiles(
|
dbUtils.applyToFiles(
|
||||||
Array.from(fileIds),
|
Array.from(fileIds),
|
||||||
(file) => file.replaceWaypoints(file.wpt.length, file.wpt.length, [waypoint])[0]
|
(file) => file.replaceWaypoints(file.wpt.length, file.wpt.length, [waypoint])[0]
|
||||||
|
Reference in New Issue
Block a user