最佳答案
var map = L.map('map');
var marker = L.marker([10.496093,-66.881935]).on('click', onClick);
function onClick(e) {alert(e.latlng);}
marker.addTo(map)
When I do click in the marker, the alert message is: undefined
But if I put it in the variable map, it works! (shows latitude and longitude)
map.on('click', onClick);
Does someone know why it doesn't work in the marker?