antvis / antvis/L7

L7 创建-销毁时序问题

Open
#2,173 2 comments 0 reactions 1 assignee Claimed by @heiyexing View on GitHub
🌟 star bug
Dominant language
TypeScript
Stars
4.1k
Forks
656
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

如果在调用L7 Scene 初始化后, Scene "onload" 之前,执行scene的destory(), scene 不能正常销毁,留下L7相关的dom 不能正常销毁。
![image](https://github.com/antvis/L7/assets/9842242/682406cb-d242-40b8-ba11-08d4f421f0fe)

### 重现链接

https://codesandbox.io/p/sandbox/eager-orla-rt8pym?file=%2Findex.ts%3A13%2C22

### 重现步骤

1.打开dom 链接。
2.查看地图没有被正常销毁。
表现为L7 和高德地图创建的dom在宿主dom 下没有正常移除掉。

### 预期行为

调用了scene的destory 操作以后,如果L7没有正常load, 不要不做后续的操作,保证L7 scene实例相关资源不遗留在宿主dom 上。

### 平台

- 操作系统: [Windows]
- 网页浏览器: [Google Chrome]

### 屏幕截图或视频(可选)

遗留的L7创建的Dom
![image](https://github.com/antvis/L7/assets/9842242/deaf79b7-7c66-41f3-86f4-6d652bfeef89)

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.