Merge branch '329-add-basic-automatic-firefight' into 407-create-a-simple-plugin-to-manage-units-database

This commit is contained in:
Pax1601
2023-09-28 09:09:02 +02:00
29 changed files with 6483 additions and 52 deletions

View File

@@ -398,4 +398,19 @@ export function getCheckboxOptions(dropdown: Dropdown) {
values[key] = value;
}
return values;
}
export function getGroundElevation(latlng: LatLng, callback: CallableFunction) {
/* Get the ground elevation from the server endpoint */
const xhr = new XMLHttpRequest();
xhr.open('GET', `api/elevation/${latlng.lat}/${latlng.lng}`, true);
xhr.timeout = 500; // ms
xhr.responseType = 'json';
xhr.onload = () => {
var status = xhr?.status;
if (status === 200) {
callback(xhr.response)
}
};
xhr.send();
}