Igor-Vladyka / leaflet.browser.print

A leaflet plugin which allows users to print the map directly from the browser
https://igor-vladyka.github.io/leaflet.browser.print/
MIT License
154 stars 76 forks source link

customize iconCreateFunction for markerCluster can't be shown in the print. #71

Closed LXMin closed 5 years ago

LXMin commented 5 years ago

Hi,

Thank you for your browser print plugin, it's really so nice. As I am using the marker cluster to show some markers on the map. And I configured the iconCreateFunction for customizing the icon, but in the print preview, the icon is still the default style of marker cluster, it's not been changed. I tried the register the marker cluster again, but it didn't a success. Can you pls help to check about this? I just modify the index.html file, shown below.

... ... var cities = L.markerClusterGroup({ iconCreateFunction: function(cluster) { return L.divIcon({ html: '<b>' + cluster.getChildCount() + '</b>' }); } }); ... ...

just add the configure function for the marker cluster, regards for your help. thank you.

Igor-Vladyka commented 5 years ago

Hi there.

Yes, thank you. There was an issue with passing arguments. Fixed in latest version. Also, please take into account that MarkerClusterGroup is moved out of the plugin in latest release and you will need to register it on your own/copy-paste it from plugin documentation.

Regards, Igor