3
votes

I am using leaflet library to show objects that have image icons and labels. For now I'am creating that object via 2 markers(one for image, second for divIcon text) with same position and want to cluster them like one object. But Leaflet.clustermarker allows only cluster every marker on map, even if I add them as group. And I didn't find the solution.

It could be done if Leaflet.clustermarker has an option like minClusterMarkerCount. Or to not cluster markers with same position.

So the question is: how to cluster markers as one object or to make one marker with several icons or at least with label in it?

1
Would Leaflet tooltip fit your need, instead of trying to achieve the result with a 2nd "dummy" marker?ghybs
@ghybs, interesting feature, less flexible then divIcon, but worth to try it. Thanks for your reply.kukuruzo91

1 Answers

0
votes

I would set a class to the L.divIcon and change its background image. This way you have one marker with label and icon.