forked from MapComplete/MapComplete
Feature(clustering): fix count update on filters, fix hiding when zoomed out to much
This commit is contained in:
parent
0048c091d0
commit
63e9d20255
5 changed files with 26 additions and 21 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue