Feature(clustering): fix count update on filters, fix hiding when zoomed out to much

This commit is contained in:
Pieter Vander Vennet 2025-07-24 19:28:34 +02:00
parent 0048c091d0
commit 63e9d20255
5 changed files with 26 additions and 21 deletions

View file

@ -388,20 +388,26 @@ export default class ShowDataLayer {
})
}
/**
* Show the data, unless they are clustered.
* This method does _not_ add the clusters themselves to the map,
* this should be done independently. In a themeViewGui, this is done by the 'addSpecialLayers'
* @see ClusterGrouping
* @param mlmap
* @param state
* @param options
*/
public static showLayerClustered(mlmap: Store<MlMap>,
state: { mapProperties: { zoom: UIEventSource<number> } },
options: ShowDataLayerOptions & { layer: LayerConfig }
) {
options.preprocessPoints = feats => {
const clustering = new ClusteringFeatureSource(feats, state.mapProperties.zoom.map(z => z + 2),
options.preprocessPoints = feats =>
new ClusteringFeatureSource(feats, state.mapProperties.zoom.map(z => z + 2),
options.layer.id,
{
cutoff: 7,
showSummaryAt: "tilecenter"
})
return clustering
}
new ShowDataLayer(mlmap, options)
}
@ -417,8 +423,6 @@ export default class ShowDataLayer {
})
}
public destruct() {}
private static zoomToCurrentFeatures(map: MlMap, features: Feature[]) {
if (!features || !map || features.length == 0) {
return