Fix newly created markers/shapes not being added to the map

This commit is contained in:
James Lyne 2020-12-18 18:02:01 +00:00
parent cad535365b
commit fd26eee713
4 changed files with 18 additions and 4 deletions

View File

@ -80,7 +80,13 @@ export default defineComponent({
if(update.removed) { if(update.removed) {
deleteArea(update.id); deleteArea(update.id);
} else { } 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);
} }
} }

View File

@ -83,9 +83,10 @@ export default defineComponent({
const layer = updateCircle(layers.get(update.id), update.payload as DynmapCircle, converter) const layer = updateCircle(layers.get(update.id), update.payload as DynmapCircle, converter)
if(!layers.has(update.id)) { if(!layers.has(update.id)) {
layers.set(update.id, layer);
props.layerGroup.addLayer(layer); props.layerGroup.addLayer(layer);
} }
layers.set(update.id, layer);
} }
} }

View File

@ -83,9 +83,10 @@ export default defineComponent({
const layer = updateLine(layers.get(update.id), update.payload as DynmapLine, converter) const layer = updateLine(layers.get(update.id), update.payload as DynmapLine, converter)
if(!layers.has(update.id)) { if(!layers.has(update.id)) {
layers.set(update.id, layer);
props.layerGroup.addLayer(layer); props.layerGroup.addLayer(layer);
} }
layers.set(update.id, layer);
} }
} }

View File

@ -79,7 +79,13 @@ export default defineComponent({
if(update.removed) { if(update.removed) {
deleteMarker(update.id); deleteMarker(update.id);
} else { } 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);
} }
} }