I want to collapse a leaflet control on my map. I have the current code:
var legend = L.control({position: 'bottomright', collapsed:true});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
div.innerHTML = "<h6>DISCLAIMER:<br>text</h3><table></table>";
return div;
};
legend.addTo(map);
But I still cannot get it to collapse or appear on hover like my layers selection does. How do I need to adjust my code? I have visited the Leaflet examples but it seems like the collapse feature is only for layer elements and not simply for a control.