Hi everyone,
After reading through the docs and searching around, I'm coming up empty-handed.
In short, I'd like to be able to keep a log of when users click individual markers (by keeping tabs of the lat/long, but a marker index ID would work as well, I suppose). Through something like the following, I can get lat/lng for all
map clicks, but I can't see to get this working for
marker clicks:
function onMapClick(e) {
console.log("You clicked the map at " + e.latlng.toString());
}
map.on('click', onMapClick);
Not sure if relevant or not, but my markers are built via a looped version of:
L.marker(
[51.941196,4.512291],
{
icon: L.AwesomeMarkers.icon({
icon: 'link',
prefix: 'glyphicon',
markerColor: 'red',
spin:true
})
}).addTo(map);
It seems that I'm missing something in my thinking, that this should be straight-forwarded in Leaflet.
Any suggestions or solutions? Thanks for your expertise!
JP