简体   繁体   中英

leaflet cluster marker with label(marker-label)

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM