forked from MapComplete/MapComplete
Automatically cluster maps with more then 250 elements
This commit is contained in:
parent
46b05d7410
commit
4dacfd157a
5 changed files with 19 additions and 13 deletions
|
@ -42,7 +42,7 @@ export default class ShowDataLayer {
|
|||
|
||||
const feats = features.data.map(ff => ff.feature);
|
||||
let geoLayer = self.CreateGeojsonLayer(feats)
|
||||
if (layoutToUse.clustering !== undefined) {
|
||||
if (layoutToUse.clustering.minNeededElements <= features.data.length) {
|
||||
const cl = window["L"];
|
||||
const cluster = cl.markerClusterGroup({ disableClusteringAtZoom: layoutToUse.clustering.maxZoom });
|
||||
cluster.addLayer(geoLayer);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue