maptalks / maptalks/maptalks.markercluster
maxClusterZoom 设置1时 ,缩放后 markers的第一个元素不触发点击事件
- Dominant language
- JavaScript
- Stars
- 49
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
问题:为了方便不使用聚合 maxClusterZoom 设置为 1;给每个marker 注册点击事件 ,发现缩放后总是第一个addTo的marker的click事件触发不了。(如果先点击第一个元素,再缩放,可以正常触发)。
我排查一阵没怎么看懂,但是在192行 if (maxClusterZoom && zoom > maxClusterZoom) 后加入代码 this._computeGrid(); 之后功能就正常了。不知道这个是什么原因?
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the marker-click failure with maxClusterZoom set to 1, then inspect the maxClusterZoom branch around line 192 and the _computeGrid() entry point. Verify the behavior after zooming and confirm that the first marker added receives its click event, including the case where it was not clicked before zooming.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100