Hola, tengo un problemita, cuando cambio el zoom del mapa solo me cambia el tamaño del último registro del array y no de todos los markers. Podrian ayudarme para que cambie el tamaño de todos?
Se vé que me falta alguna funcion para recorrer cada uno de los datos y cambiarle el tamaño del marker, pero no se como hacerlo.
Muchas gracias.

Código HTML :

<div align="center" id="map1"></div>
   <script type="text/javascript">
   function initMap() {
   var map = new google.maps.Map(document.getElementById('map1'), {
   mapTypeControl: false,
   streetViewControl: false,
   zoom: 14,
   zoomControl: true,
   zoomControlOptions: {
   style: google.maps.ZoomControlStyle.SMALL
   },
   center: {lat:-34.828379,lng:-57.966273}
   });
 
 
   var accidentes = [
   <?php
      for ($i=0; $i<$CantidadDeLineas; $i++)
      {echo "['ACCIDENTE: ".$observa[$i]."', ".$lat[$i].",".$lng[$i]."],";}?>
   ];
 
 
 
   function setMarkers(map) {
   var markerImage = new google.maps.MarkerImage(
    'img/accidente.png',
    new google.maps.Size(30.5,30.5), //size
    null,//new google.maps.Point(0,0), // origin
    null,//new google.maps.Point(285,325), 
    new google.maps.Size(30.5,30.5) //scale
   );
 
 
   for (var i = 0; i < accidentes.length; i++) {
   var accidente = accidentes[i];
 
   var marker = new google.maps.Marker({
   position: {lat: accidente[1], lng: accidente[2]},
   map: map,
   icon: markerImage,
   //animation: google.maps.Animation.DROP,
   title: accidente[0]
   });
}
google.maps.event.addListener(map, 'zoom_changed', function() {
zoom=map.getZoom();
if(zoom==21){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(1900, 1900)));}
if(zoom==20){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(950, 950)));}
if(zoom==19){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(550, 550)));}
if(zoom==18){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(242, 242)));}
if(zoom==17){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(120, 120)));}
if(zoom==16){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(61, 61)));}
if(zoom==15){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(30.5, 30.5)));}
if(zoom==14){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(15, 15)));}
if(zoom==13){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(9, 9)));}
if(zoom==12){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(4, 4)));}
if(zoom==11){marker.setIcon(new google.maps.MarkerImage('img/accidente13.png', null, null, null, new google.maps.Size(1, 1)));}
});
}
 
setMarkers(map);}
   </script>