It seems that the above solutions only return marker coordinates, which does not solve my problem. Maybe I'm doing something wrong.
However, as I decided, itβs just adding a property to a marker like this
function createMarker(latlng,name) { var marker = new GMarker(latlng);
Strike> UPDATE: The aboves solves it one way, but the easiest way is to attach an event to a map, as indicated in the comments
GEvent.addListener(map, "click", function(marker, point){ alert(marker); });
source share