|
|
|
@ -52,7 +52,8 @@ export class EditorAction {
|
|
|
|
|
// 创建覆盖物结束
|
|
|
|
|
this.mapEditor.on(EventTypes.FinishEditOverlay, (overlay: IOverlay) => { |
|
|
|
|
this.dispatch(StoreAction.finishEditOverlay(overlay)); |
|
|
|
|
this.selectOverlay(overlay.id); |
|
|
|
|
// 创建或者编辑结束继续选中, 编辑选中保留不取消选中
|
|
|
|
|
this.selectOverlay(overlay.id, false); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -96,11 +97,13 @@ export class EditorAction {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
selectOverlay(id: string) { |
|
|
|
|
selectOverlay(id: string, reset = true) { |
|
|
|
|
const { selectedIds } = this.store.getState(); |
|
|
|
|
if (selectedIds.indexOf(id) >= 0) { |
|
|
|
|
this.mapEditor?.selectOverlays(); |
|
|
|
|
this.dispatch(StoreAction.selectOverlay()); |
|
|
|
|
if (reset) { |
|
|
|
|
this.mapEditor?.selectOverlays(); |
|
|
|
|
this.dispatch(StoreAction.selectOverlay()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
this.mapEditor?.selectOverlays([id]); |
|
|
|
|
this.dispatch(StoreAction.selectOverlay(id)); |
|
|
|
|