0

I am trying to change my google map markers so that when the zoom is < 5 they change from their custom markers to a star image. This is what I have so far (not working)

//zoom icons to stars at continent level
google.maps.event.addListener(busMap, 'zoom_changed', function() {
    var markerIconStar = google.maps.MarkerImage("icons/star.png");
    var currentZoom = busMap.getZoom();
    if (currentZoom < 5){
        markerSanFran.setIcon(markerIconStar);
        markerLA.setIcon(markerIconStar);
        markerHollywood.setIcon(markerIconStar);
        markerSantaCruz.setIcon(markerIconStar);
        markerSanDiego.setIcon(markerIconStar);
        markerLasVegas.setIcon(markerIconStar);
        markerGrandCan.setIcon(markerIconStar);
        markerMamLakes.setIcon(markerIconStar);
        markerYosemite.setIcon(markerIconStar);
      }

});

http://screamingeagle.travel/map/map2.html is a where you can see the rest of the code in action currently

4

1 に答える 1