Showing the functionality of toggling layers in Leaflet while preserving their reference for later usage (i.e. turning the layer back on). This is useful when working with many layers in leaflet and turning opacity to 0 won’t cut it because it can have negative effects when hover and click events require properly layered DOM elements.
Important takeaways:
removeLayer()
method.addLayer()
method.