New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sum of values of a point in a cluster #363
Comments
That does not sound as a feature of markelcluster, you would probably be forced to write a custom solution, or use another plugin. |
This is pretty easy. var markers = new L.MarkerClusterGroup({
iconCreateFunction: function(cluster) {
var children = cluster.getAllChildMarkers();
var sum = 0;
for (var i = 0; i < children.length; i++) {
sum += children[i].someNumber;
}
return new L.DivIcon({ html: '<b>' + sum + '</b>' });
}
}); |
Hello danzel, I don't have any experience with JS. Can you please help me how do I implement the above function in R using leaflet? Specifically I'm struggling to understand how to record a value against the marker in the cluster. |
@pitKay Hi, great to hear that you find Leaflet useful! However, this issue tracker is used for reporting bugs and discussing new features. For questions on using Leaflet, please use gis.stackexchange.com or stackoverflow. If you are really sure that this is a bug in leaflet, or a feature request, please change the wording to make it look like a bug report. |
Hi
is there a way to count and show in the icon the Sum of the values per point instead of count of child's
ex:
for the data -
[-37.8211946833, 175.2213655333, "1"],
[-37.8209458667, 175.2214051333, "5"],
[-37.8208292333, 175.2214374833, "7"],
[-37.8325816, 175.2238798667, "537"]
=> the values on cluster icon for those points will show 550 (instead of 4)
The text was updated successfully, but these errors were encountered: