Is it possible to make a click event occur only on the tile layer on a Leaflet map?
I tried
var tiles= L.tileLayer(...).addTo(map);
tiles.on('click', function(e) { console.log('ok') });
but it doesn't do anything. I also tried
tiles.on({ click: console.log('ok') });
but it only triggers once when the map loads.
I'd like this event to occur only on tile layers, not when the user clicks on another layer.