use map layers for start/end/hover markers

This commit is contained in:
vcoppe
2026-02-01 17:18:17 +01:00
parent 9408ce10c7
commit 6f8c9d66db
14 changed files with 181 additions and 117 deletions

View File

@@ -197,6 +197,18 @@ export function getElevation(
);
}
export function loadSVGIcon(map: maplibregl.Map, id: string, svg: string) {
if (!map.hasImage(id)) {
let icon = new Image(100, 100);
icon.onload = () => {
if (!map.hasImage(id)) {
map.addImage(id, icon);
}
};
icon.src = 'data:image/svg+xml,' + encodeURIComponent(svg);
}
}
export function isMac() {
return navigator.userAgent.toUpperCase().indexOf('MAC') >= 0;
}