How to get the baselayer selected in leaflet?

Listen for the baselayerchange event on your mapinstance: 
Fired when the base layer is changed through the layer control.
http://leafletjs.com/reference.html#map-baselayerchange
map.on('baselayerchange', function (e) {
    console.log(e.layer);
});
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