get waypoint elevation
This commit is contained in:
parent
b29500cfeb
commit
639586d5ac
2 changed files with 7 additions and 2 deletions
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue