@@ -232,9 +232,8 @@ function preloadPointIcons() {
|
|||||||
function updateIconsOnMap(map: maplibregl.Map, typeId: PointGeotypeId) {
|
function updateIconsOnMap(map: maplibregl.Map, typeId: PointGeotypeId) {
|
||||||
if (!map || !map.getStyle()) return;
|
if (!map || !map.getStyle()) return;
|
||||||
try {
|
try {
|
||||||
for (const variant of ["default", "draft"] as const) {
|
const iconId = getPointIconId(typeId);
|
||||||
const iconId = getPointIconId(typeId, variant);
|
const imageData = createPointIconImageData(typeId);
|
||||||
const imageData = createPointIconImageData(typeId, variant);
|
|
||||||
if (imageData) {
|
if (imageData) {
|
||||||
if (map.hasImage(iconId)) {
|
if (map.hasImage(iconId)) {
|
||||||
map.updateImage(iconId, imageData);
|
map.updateImage(iconId, imageData);
|
||||||
@@ -242,7 +241,6 @@ function updateIconsOnMap(map: maplibregl.Map, typeId: PointGeotypeId) {
|
|||||||
map.addImage(iconId, imageData, { pixelRatio: 2 });
|
map.addImage(iconId, imageData, { pixelRatio: 2 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(`Failed to update icon ${typeId} on map:`, err);
|
console.warn(`Failed to update icon ${typeId} on map:`, err);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user