get waypoint elevation

This commit is contained in:
vcoppe
2024-06-13 17:52:36 +02:00
parent b29500cfeb
commit 639586d5ac
2 changed files with 7 additions and 2 deletions

View File

@@ -338,7 +338,11 @@ export class GPXLayer {
let waypoint = get(currentPopupWaypoint)?.[0];
if (waypoint) {
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();
}
}