How Can I return a specific attribute using MarkerClusterGroup in Leaflet?

14 views
Skip to first unread message

Hmaidouch Zakaria

unread,
Jun 30, 2017, 5:26:10 AM6/30/17
to Leaflet

In leaflet there is a an extension called : Leaflet.markercluster In this extension, there is a function called markerClusterGroup that clusters and returns the count of multiple Markers (points). see example : Here.

In my example I'm doing the same thing for my polygons centroids, that I calculated using turf. Each of my polygon has an attribute "Inhabitants" which represents the total inhabitants in the polygon. (this looks like the example i'm working on)

The method markerClusterGroup returns the count of centroids in my example. Can I modify the method to modify the returned value into an aggregation of inhabitants ? If no, is there any library you know of capable of aggregating polygons on a specific attribute ?

Reply all
Reply to author
Forward
0 new messages