Is it possible to recreate the click to zoom on clustering like Craigslist Mapview does with MapBox? When you click, it zooms to the area those location dots are contained in.
Here's my clustering code:
map.on('load', function() {
map.addSource("location", {
type: "geojson",
data: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/73873/test.geojson",
cluster: true,
clusterMaxZoom: 14,
clusterRadius: 100
});
map.addLayer({
id: "clusters",
type: "circle",
source: "location",
filter: ["has", "point_count"],
paint: {
"circle-color": {
property: "point_count",
type: "interval",
stops: [
[0, "#71AAC6"],
[100, "#71AAC6"],
[750, "#71AAC6"],
]
},
"circle-radius": {
property: "point_count",
type: "interval",
stops: [
[0, 20],
[100, 30],
[750, 40]
]
}
}
});
Here's my demo