masajid390 / BeautifyMarker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change icon size dynamically

xSoham opened this issue · comments

Hello!
First of all let me thank you for this really useful package of custom leaflet markers. I have been working with leaflet for sometime and I am stuck in one problem regarding the BeautifyMarker.

I have a leaflet map with some normal leaflet Circlemarkers and some beautify markers. Now, basically what I want to do is change the size of the markers based on a slider on the map. So I have implemented a function based on L.Control.Range plugin of leaflet. Now inside this function I can change the size of a normal Circlemarker(not a beautify marker) with just the 'setStyle' method of leaflet.

However, I am not being able to do the same for the Custom markers created with the BeautifyMarker. I am defining the sizes of the markers based on the BorderWidth attribute and I am using a 'rectangle-dot' marker. Do you think that is the problem ? Shall I do it with the iconSize attribute ? If yes then I have to change the slider function to give out an array of output and not just a single output.

So if someone can help me out with this issue, it would be great.

Thanks