mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-03-13 16:22:59 +00:00
use map layers for start/end/hover markers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user