|
|
@ -61,6 +61,7 @@ export class MapEditor extends Emitter { |
|
|
|
update(mapState: IMapState) { |
|
|
|
update(mapState: IMapState) { |
|
|
|
const { status, overlayType } = mapState; |
|
|
|
const { status, overlayType } = mapState; |
|
|
|
if (status === "createOverlay") { |
|
|
|
if (status === "createOverlay") { |
|
|
|
|
|
|
|
this.finishCreateOverlay(); |
|
|
|
this._currentOverlayEditor = this.overlayEditors.find( |
|
|
|
this._currentOverlayEditor = this.overlayEditors.find( |
|
|
|
(editor) => editor.getType() === overlayType |
|
|
|
(editor) => editor.getType() === overlayType |
|
|
|
); |
|
|
|
); |
|
|
@ -71,6 +72,7 @@ export class MapEditor extends Emitter { |
|
|
|
finishCreateOverlay() { |
|
|
|
finishCreateOverlay() { |
|
|
|
if (this._currentOverlayEditor == null) return; |
|
|
|
if (this._currentOverlayEditor == null) return; |
|
|
|
const target = this._currentOverlayEditor.finish(); |
|
|
|
const target = this._currentOverlayEditor.finish(); |
|
|
|
|
|
|
|
console.log(target); |
|
|
|
let evt: any = null; |
|
|
|
let evt: any = null; |
|
|
|
if (target != null) { |
|
|
|
if (target != null) { |
|
|
|
const id = getUuid(); |
|
|
|
const id = getUuid(); |
|
|
@ -80,7 +82,7 @@ export class MapEditor extends Emitter { |
|
|
|
type: this._currentOverlayEditor.getType(), |
|
|
|
type: this._currentOverlayEditor.getType(), |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
this.emit(EventTypes.FinishCreateOverlay, evt); |
|
|
|
evt && this.emit(EventTypes.FinishCreateOverlay, evt); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
initEditors() { |
|
|
|
initEditors() { |
|
|
|