Is it possible to add a simple show/hide button on the leaflet map which will allow the user to see the legend on choice?
Here is my code for the legend:
var legend0 = L.control({});
legend0.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend'),
grades = ["Localisation", "Orientation"],
labels = ["icon-gamze/location1-zoom1.png", "icon-gamze/location2-zoom1.png"];
div.innerHTML += '<b>Localisation</b><br>'
for (var i = 0; i < grades.length; i++) {
div.innerHTML +=
(" <img src="+ labels[i] +" height='20' width='20'>") + grades[i] +'<br>';
}
return div;
};
legend0.addTo(map);