I understand that if I have multiple markers on a map, and I need to handle clicks on them, I have to set up a handler for each marker like so:
// ...
var marker = new google.maps.Marker({position: new google.maps.LatLng(55, 37)});
marker.setMap(map);
var listener = google.maps.event.addListener(marker, 'click', function(event){
// my listener handler here
});
But if I have a lot of markers, wouldn't it bee too heavy? Can I somehow set one handler and figure out which marker was clicked inside it?