Created
June 4, 2018 19:57
-
-
Save jeff-hager-dev/2b4edd0578e19a3e9e2a3af7d4b5fe89 to your computer and use it in GitHub Desktop.
[Spiderifying Clustered Layers in Mapbox-GL: Pulling data from the Clustered feature] #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
//Example of a function for getting all features in a current cluster | |
var getFeaturesFromCluster = function(mapZoom, sourceId, clusterId){ | |
var sourceCluster = layerClusters[sourceId]; // Objected holding all superclusters instances keyed off source id | |
var zoomLevel = Math.floor(mapZoom); // current zoom level | |
return sourceCluster.getLeaves(clusterId, zoomLevel, Infinity); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment