Created
June 4, 2018 20:04
-
-
Save jeff-hager-dev/cc7c72060616d2d461ad841b1fa343f0 to your computer and use it in GitHub Desktop.
[Spiderifying Clustered Layers in Mapbox-GL: Unspidering the data] #geospark-blog-post
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| map.on('click', closeSpideredFeatures); | |
| function closeSpideredFeatures(e) { | |
| if (e.originalEvent.target.className.indexOf('spider') <= -1) { | |
| var mapContainer = e.target._container.id; | |
| unspiderFeatures(mapContainer); | |
| } | |
| } | |
| function unspiderFeatures(mapContainer) { | |
| if (spiderifier) { | |
| spiderifier.unspiderfy(); | |
| spiderifier = null; | |
| map.off('click', closeSpideredFeatures); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment