I'm using Leaflet's Sidebar V2 plugin and it's working great, but I would like to have it open by default. So when the page loads, the sidebar is open but can be collapsed rather than the other way around. Is there a way this can be done?
Thank you in advance!
Just after you add the sidebar to the map, use the method open().
The argument of the method is the name of the tab.
var sidebar = L.control.sidebar('sidebar').addTo(map);
sidebar.open('home');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With