update
Build and Release / release (push) Successful in 36s

This commit is contained in:
anhncd
2026-05-23 13:46:44 +07:00
parent 051835b9bd
commit 82dfd7fa56
+7 -9
View File
@@ -232,15 +232,13 @@ 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); } else {
} else { map.addImage(iconId, imageData, { pixelRatio: 2 });
map.addImage(iconId, imageData, { pixelRatio: 2 });
}
} }
} }
} catch (err) { } catch (err) {