|
|
@ -67,7 +67,7 @@ export class MapEditor extends Emitter implements IMapEditor { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this._map = new AMap.Map(this.dom); |
|
|
|
this._map = new AMap.Map(this.dom); |
|
|
|
this.autoComplete = new AMap.AutoComplete({}); |
|
|
|
this.autoComplete = new AMap.AutoComplete({}); |
|
|
|
this.placeSearch = new AMap.PlaceSearch(this._map); |
|
|
|
this.placeSearch = new AMap.PlaceSearch({ map: this._map }); |
|
|
|
this.initEditors(); |
|
|
|
this.initEditors(); |
|
|
|
// Space的key是空字符串, 这就离谱.
|
|
|
|
// Space的key是空字符串, 这就离谱.
|
|
|
|
registerHotkey(" ", { callback: this.finishEditOverlay.bind(this) }); |
|
|
|
registerHotkey(" ", { callback: this.finishEditOverlay.bind(this) }); |
|
|
@ -233,6 +233,11 @@ export class MapEditor extends Emitter implements IMapEditor { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
moveTo(item: AMap.SearchResultItem) { |
|
|
|
|
|
|
|
this.placeSearch?.setCity(item.adcode); |
|
|
|
|
|
|
|
this.placeSearch?.search(item.name); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
_buildFromOverlay(overlay: IOverlay) { |
|
|
|
_buildFromOverlay(overlay: IOverlay) { |
|
|
|
const { type, id } = overlay; |
|
|
|
const { type, id } = overlay; |
|
|
|
const editor = this.overlayEditors.find( |
|
|
|
const editor = this.overlayEditors.find( |
|
|
|