Reputation: 2920
I'm using leaflet markercluster to display a high amount of markers in a nice and more performant way when zooming out. I load the markers from an array. Each marker has x and y coordinates as well as a block-id. Unfortunately the clustering plugin creates the clustering not like I want.
Let's take this as an example:
The diamonds are markers and the red boxes are blocks, meaning markers in the same red box have the same block-id. I want the clustered by the block when I zoom out, but they are clustered in an other way (yellow boxes).
Is there any way to achieve what I want?
Upvotes: 1
Views: 235
Reputation: 10329
I would try to create one MarkerClusterGroup
per block id; that way, clusters in each group will only contain markers from the same block id.
Upvotes: 2