diff --git a/src/map/MapEditor.ts b/src/map/MapEditor.ts index 6febddd..3a52160 100644 --- a/src/map/MapEditor.ts +++ b/src/map/MapEditor.ts @@ -153,12 +153,14 @@ export class MapEditor extends Emitter implements IMapEditor { } createOverlay(type: OverlayTypes) { + this.finishEditOverlay(); this.currentOverlayEditor = this.getEditorByType(type!); this.currentOverlayEditor?.create(); this.editorStatus = "creating"; } selectOverlays(ids?: string[]) { + this.finishEditOverlay(); this.selectedIds?.forEach((id) => { const { target, type } = this.overlayMap[id]; target.setOptions(getOverlayOptions(type));