You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
featuresAt works fine after adding about 50,000 symbols in a small cluster. If I implement a click to center (e.g. https://www.mapbox.com/mapbox-gl-js/example/center-on-symbol/ ), each click centers perfectly. However, when rapidly adding and removing elements to the layer's source, some calls to featuresAt do not return any features, even when clicking over several symbols. It works, but intermittently.
Steps to reproduce:
1). Open Chrome Dev Tools and open the plunkr
2). Ensure the line startJittering(); is not commented out. Observe the thousands of gray symbols, and notice that they seem to "shimmer" slightly due to elements being added and removed very quickly.
3). Click inside the cluster of gray symbols. Note that some clicks do not center, and a log is shown in the developer console that says "EMPTY CLICK DETECTED".
Expected behavior: featuresAt returns several features over the cluster, even when elements have been added and removed.
To stop the bug and see correct behavior, comment out the line startJittering(); Clicking anywhere in the cluster now works perfectly.
All that startJittering does is create a setInterval that adds and removes data from the source. I assume this is considered correct use of the API.
The text was updated successfully, but these errors were encountered:
featuresAt
works fine after adding about 50,000 symbols in a small cluster. If I implement a click to center (e.g. https://www.mapbox.com/mapbox-gl-js/example/center-on-symbol/ ), each click centers perfectly. However, when rapidly adding and removing elements to the layer's source, some calls tofeaturesAt
do not return any features, even when clicking over several symbols. It works, but intermittently.Here is a plunkr that reproduces this issue:
https://plnkr.co/edit/3COaxhnCjlLTr1YQt2nW?p=preview
Steps to reproduce:
1). Open Chrome Dev Tools and open the plunkr
2). Ensure the line
startJittering();
is not commented out. Observe the thousands of gray symbols, and notice that they seem to "shimmer" slightly due to elements being added and removed very quickly.3). Click inside the cluster of gray symbols. Note that some clicks do not center, and a log is shown in the developer console that says "EMPTY CLICK DETECTED".
Expected behavior:
featuresAt
returns several features over the cluster, even when elements have been added and removed.To stop the bug and see correct behavior, comment out the line
startJittering();
Clicking anywhere in the cluster now works perfectly.All that
startJittering
does is create asetInterval
that adds and removes data from the source. I assume this is considered correct use of the API.The text was updated successfully, but these errors were encountered: