You need to sign in to do that
Don't have an account?

How can i apply multiple filters on markerCluster ?
I used this
var markers = L.markerClusterGroup.layerSupport( {
chunkedLoading: true,
renderer: myRenderer,
iconCreateFunction: function (cluster) {
var childCount = cluster.getChildCount();
var c = ' marker-cluster-';
if (childCount < 10) {
c += 'small';
}
else if (childCount < 100) {
c += 'medium';
}
else {
c += 'large';
}
return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>',
className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });
}
}),
group1 = L.layerGroup(),
group2 = L.layerGroup(),
group3 = L.layerGroup(),
group4 = L.layerGroup(),
control = L.control.layers(null, null, { collapsed: true }),
groupActive = L.layerGroup(),
groupInactive = L.layerGroup(),
controlStatus = L.control.layers(null, null, { collapsed: true });
markers.checkIn([group1, group2, group3, group4]);
control.addOverlay(group1, 'apples');
control.addOverlay(group3, 'bananas');
control.addOverlay(group2, 'cars');
control.addOverlay(group4, 'windows');
which is good but not good enough , i need to be able to filter dinamically based on text input because if i use groups i will end up with 40 groups which is not good
var markers = L.markerClusterGroup.layerSupport( {
chunkedLoading: true,
renderer: myRenderer,
iconCreateFunction: function (cluster) {
var childCount = cluster.getChildCount();
var c = ' marker-cluster-';
if (childCount < 10) {
c += 'small';
}
else if (childCount < 100) {
c += 'medium';
}
else {
c += 'large';
}
return new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>',
className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });
}
}),
group1 = L.layerGroup(),
group2 = L.layerGroup(),
group3 = L.layerGroup(),
group4 = L.layerGroup(),
control = L.control.layers(null, null, { collapsed: true }),
groupActive = L.layerGroup(),
groupInactive = L.layerGroup(),
controlStatus = L.control.layers(null, null, { collapsed: true });
markers.checkIn([group1, group2, group3, group4]);
control.addOverlay(group1, 'apples');
control.addOverlay(group3, 'bananas');
control.addOverlay(group2, 'cars');
control.addOverlay(group4, 'windows');
which is good but not good enough , i need to be able to filter dinamically based on text input because if i use groups i will end up with 40 groups which is not good