unbam / Leaflet.SlideMenu

A simple slide menu for Leaflet.
BSD 2-Clause "Simplified" License
58 stars 19 forks source link

Customize icon for button menu and new methods #7

Closed dczunigap closed 6 years ago

dczunigap commented 6 years ago

I added an option for customize icon. The option need the icon name from FontAwesome, for example: fa fa-map-signs

Then you should set the option like this: L.control.slideMenu('<p>test</p>', {icon: 'fa-map-signs', width: '200px'}).addTo(map);

I added two methods and 1 new parameter for hide and show the icon menu.

var slideMenud = L.control.slideMenu('<p>test</p>', {icon: 'fa-map-signs', width: '200px', hidden: true}).addTo(map);

And when you want hide/show programatically, you can use: slideMenu.show() or slideMenu.hide()

unbam commented 6 years ago

Thank you for pull request :)