mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-09-05 18:02:55 +00:00
add elevation tool
This commit is contained in:
@@ -261,14 +261,16 @@ export class GPXLayer {
|
||||
marker.on('dragend', (e) => {
|
||||
resetCursor();
|
||||
marker.getElement().style.cursor = '';
|
||||
dbUtils.applyToFile(this.fileId, (file) => {
|
||||
let latLng = marker.getLngLat();
|
||||
let wpt = file.wpt[marker._waypoint._data.index];
|
||||
wpt.setCoordinates({
|
||||
lat: latLng.lat,
|
||||
lon: latLng.lng
|
||||
getElevation([marker._waypoint]).then((ele) => {
|
||||
dbUtils.applyToFile(this.fileId, (file) => {
|
||||
let latLng = marker.getLngLat();
|
||||
let wpt = file.wpt[marker._waypoint._data.index];
|
||||
wpt.setCoordinates({
|
||||
lat: latLng.lat,
|
||||
lon: latLng.lng
|
||||
});
|
||||
wpt.ele = ele[0];
|
||||
});
|
||||
wpt.ele = getElevation(this.map, wpt.getCoordinates());
|
||||
});
|
||||
dragEndTimestamp = Date.now()
|
||||
});
|
||||
|
Reference in New Issue
Block a user