In Leaflet I want to add a legend when I turn on an overlay, then when I turn off that overlay I want the legend to disappear and when I turn on a second overlay I want a second legend to appear. I have 2 png legends that I am using. I'm using 'overlayadd' & 'overlayremove' but can't get it working
Perhaps use DOM methods to replace the contents of the div. http://leafletjs.com/examples/choropleth.html look at the info.update function which sets the innerHTML.