diff --git a/src/components/map/vector/Areas.vue b/src/components/map/vector/Areas.vue index fcb06da..a80b37f 100644 --- a/src/components/map/vector/Areas.vue +++ b/src/components/map/vector/Areas.vue @@ -80,7 +80,13 @@ export default defineComponent({ if(update.removed) { deleteArea(update.id); } else { - layers.set(update.id, updateArea(layers.get(update.id), update.payload as DynmapArea, converter)); + const layer = updateArea(layers.get(update.id), update.payload as DynmapArea, converter) + + if(!layers.has(update.id)) { + props.layerGroup.addLayer(layer); + } + + layers.set(update.id, layer); } } diff --git a/src/components/map/vector/Circles.vue b/src/components/map/vector/Circles.vue index f13ebbc..657fc06 100644 --- a/src/components/map/vector/Circles.vue +++ b/src/components/map/vector/Circles.vue @@ -83,9 +83,10 @@ export default defineComponent({ const layer = updateCircle(layers.get(update.id), update.payload as DynmapCircle, converter) if(!layers.has(update.id)) { - layers.set(update.id, layer); props.layerGroup.addLayer(layer); } + + layers.set(update.id, layer); } } diff --git a/src/components/map/vector/Lines.vue b/src/components/map/vector/Lines.vue index 65fc0a1..e0e2350 100644 --- a/src/components/map/vector/Lines.vue +++ b/src/components/map/vector/Lines.vue @@ -83,9 +83,10 @@ export default defineComponent({ const layer = updateLine(layers.get(update.id), update.payload as DynmapLine, converter) if(!layers.has(update.id)) { - layers.set(update.id, layer); props.layerGroup.addLayer(layer); } + + layers.set(update.id, layer); } } diff --git a/src/components/map/vector/Markers.vue b/src/components/map/vector/Markers.vue index c711fd8..0030441 100644 --- a/src/components/map/vector/Markers.vue +++ b/src/components/map/vector/Markers.vue @@ -79,7 +79,13 @@ export default defineComponent({ if(update.removed) { deleteMarker(update.id); } else { - layers.set(update.id, updateMarker(layers.get(update.id), update.payload as DynmapMarker, projection)); + const layer = updateMarker(layers.get(update.id), update.payload as DynmapMarker, projection); + + if(!layers.has(update.id)) { + props.layerGroup.addLayer(layer); + } + + layers.set(update.id, layer); } }