style: lint style

This commit is contained in:
2912401452 2021-09-22 20:11:38 +08:00
parent d7ea5e8294
commit ada18eb683
6 changed files with 20 additions and 17 deletions

View File

@ -335,7 +335,7 @@ export default class Scene extends EventEmitter implements ISceneService {
this.markerService.destroy();
// TODO: 销毁 container 容器
this.$container?.parentNode?.removeChild(this.$container)
this.$container?.parentNode?.removeChild(this.$container);
this.removeAllListeners();
this.inited = false;

View File

@ -417,9 +417,9 @@ export default class AMapService
public destroy() {
this.map.destroy();
// TODO: 销毁地图可视化层的容器
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer)
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer);
// @ts-ignore
delete window.initAMap;

View File

@ -511,8 +511,8 @@ export default class AMapService
this.map.destroy();
// TODO: 销毁地图可视化层的容器
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer)
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer);
// @ts-ignore
delete window.initAMap;
const $jsapi = document.getElementById(AMAP_SCRIPT_ID);

View File

@ -279,10 +279,9 @@ export default class L7MapService implements IMapService<Map> {
}
public destroy() {
// TODO: 销毁地图可视化层的容器
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer)
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer);
this.eventEmitter.removeAllListeners();
if (this.map) {
this.map.remove();

View File

@ -362,10 +362,9 @@ export default class MapboxService
}
public destroy() {
// TODO: 销毁地图可视化层的容器
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer)
this.$mapContainer?.parentNode?.removeChild(this.$mapContainer);
this.eventEmitter.removeAllListeners();
if (this.map) {
this.map.remove();

View File

@ -92,12 +92,17 @@ export default class Amap2demo_destroy extends React.Component {
bottom: 0,
}}
/>
<button style={{
position: 'absolute',
top: '0',
left: '0',
zIndex: 10
}} onClick={() => this.scene.destroy()}>destroy</button>
<button
style={{
position: 'absolute',
top: '0',
left: '0',
zIndex: 10,
}}
onClick={() => this.scene.destroy()}
>
destroy
</button>
</>
);
}