Completed ground elevation provider and added to mouse info panel

This commit is contained in:
Pax1601
2023-09-22 15:03:35 +02:00
parent 7efa8eab18
commit 5810f9232a
6 changed files with 58 additions and 17 deletions

View File

@@ -631,18 +631,6 @@ export class Map extends L.Map {
/* Update the polygon being drawn with the current position of the mouse cursor */
this.getSelectedCoalitionArea()?.moveActiveVertex(e.latlng);
}
var xhr = new XMLHttpRequest();
xhr.open('GET', `api/elevation/${this.getMouseCoordinates().lat}/${this.getMouseCoordinates().lng}`, true);
xhr.responseType = 'json';
xhr.onload = () => {
var status = xhr.status;
if (status === 200)
console.log(xhr.response);
else
console.error(`Error retrieving country codes`)
};
xhr.send();
}
#onKeyDown(e: any) {