Answer the question
In order to leave comments, you need to log in
How to get the name/ID of the current map layer in Leaflet?
How to get the name/ID of the current layer in Leaflet?
Tried like this, but the IDs are dynamic:
map.on('baselayerchange', function(e){
alert(e.layer._leaflet_id);
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question