🤔 [QUESTION] how to remove the click listener on the layer when removing the layer
- Dominant language
- TypeScript
- Stars
- 87
- Forks
- 34
- PR merge metrics
- No merged PRs in 30d
Description
### 🐛 Question description [Please make everyone to understand it]
I build a new layer - PointLayer and subscribe to a click event.
```
layer.on('click', e => {
console.log('click',e);
const { lng, lat } = e.lngLat;
});
```
when remove this layer with `scene.remove(layer)`, wondering is there any method to unregister the click listener or the `scene.remove(layer)` can automatically do the job.
```
"@antv/l7": "^2.17.8",
"@antv/l7-core": "^2.21.8",
"@antv/l7-draw": "^3.1.3",
"@antv/l7-maps": "^2.17.8",
"@antv/larkmap": "^1.4.17",
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the PointLayer event entry point, the layer.on('click') registration, and scene.remove(layer) lifecycle behavior described in the issue. Check the L7 event and removal documentation or source to determine whether listeners are automatically unregistered; done means documenting or confirming the supported cleanup method.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- data-visualization, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100