Clear inactive clusters on view switch
All checks were successful
Build Docker Image / build (push) Successful in 4m27s
All checks were successful
Build Docker Image / build (push) Successful in 4m27s
This commit is contained in:
@@ -800,12 +800,11 @@ const initServerClusteringLayersByType = async (map: MapboxMapType) => {
|
||||
const features = map.queryRenderedFeatures(e.point, { layers: [clusterLayerId] })
|
||||
const feature = features[0]
|
||||
if (!feature) return
|
||||
const clusterId = feature.properties?.cluster_id
|
||||
const source = map.getSource(sourceIdByType) as mapboxgl.GeoJSONSource
|
||||
source.getClusterExpansionZoom(clusterId, (err, zoom) => {
|
||||
if (err) return
|
||||
const geometry = feature.geometry as GeoJSON.Point
|
||||
map.easeTo({ center: geometry.coordinates as [number, number], zoom: zoom || 4 })
|
||||
const expansionZoom = feature.properties?.expansionZoom
|
||||
const geometry = feature.geometry as GeoJSON.Point
|
||||
map.easeTo({
|
||||
center: geometry.coordinates as [number, number],
|
||||
zoom: expansionZoom || map.getZoom() + 2
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user