Is it possible create a cluster source with tiles?
With geojson works perfectly but I would like to work with a tile source.
map.on('load', function () {
// add source
map.addSource('geosjonsource', {
'type': 'geojson',
'data': 'https://docs.mapbox.com/mapbox-gl-js/assets/earthquakes.geojson',
'cluster': true,
'clusterMaxZoom': 14,
'clusterRadius': 50,
});
// add layer
map.addLayer({
'id': 'prueba',
'source': 'geosjonsource',
'type': 'circle',
'filter': ['has', 'point_count'],
'paint': {
'circle-color': ['step', ['get', 'point_count'], '#51bbd6', 100, '#f1f075', 750, '#f28cb1' ],
'circle-radius': ['step', ['get', 'point_count'], 20, 100, 30, 750, 40 ]
},
'layout': {}
});
}
I've created a vector tile server to render pbf sources and I would like work with this source:
map.addSource('vectorsource', {
'type': 'vector',
'tiles': ['http://192.168.240.71:8090/tile/earthquakes/{z}/{x}/{y}.pbf'],
'cluster': true,
'clusterMaxZoom': 14,
'clusterRadius': 50,
});