I had this, works fine:
google.maps.event.addListener(marker, 'rightclick', function(event) {
infowindow.close();
marker.setMap(null);
marker.solucionado = true;
cant_markers--;
cant_solucionados++;
});
But I want to do this:
google.maps.event.addListener(marker, 'rightclick', deleteMarker);
function deleteMarker(marker) {
infowindow.close();
marker.setMap(null);
marker.solucionado = true;
cant_markers--;
cant_solucionados++;
});
marker it's currently out of the scope, there is a way to send the marker object as a parameter?