title: Changing marker at certain zoom level - Google Maps API 3
body: <p>I have a map that loads and displays (correctly) a bunch of markers. The amount of markers are unlimited, so they are created before the map is initialized by running a bit of PHP in the javascript (the markers come from a database).</p>
  
  <p>I want to know, if it is possible to change the marker from a simple dot, to something else when a certain zoom level is reached?</p>
  
  <p>Here is some code:</p>
  
  <pre><code>&lt;script&gt;
      var &lt;?php echo $clinic_string; ?&gt;; //string with marker names
      var map;
  
      function initialize() {
          var kzn = new google.maps.LatLng(-28.459033,30.217037);
          var mapOptions = {
              zoom: 7,
              center: kzn,
              mapTypeId: google.maps.MapTypeId.ROADMAP 
          }
          map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
  
          &lt;?php foreach($jsdata as $data) : ?&gt;
              marker_&lt;?php echo $data['id'];?&gt; = new google.maps.Marker({
                  position: new google.maps.LatLng(&lt;?php echo $data['location'];?&gt;),
                  map: map,
                  icon: 'images/reddot.gif'
              });
          &lt;?php endforeach; ?&gt;
      }
      google.maps.event.addDomListener(window, 'load', initialize);
  &lt;/script&gt;
  </code></pre>
  
  <p>Let's say my zoom level reaches level 15, it needs to change the <code>icon</code> to <code>images/clinic.gif</code>.</p>
  
  <p>Is this possible? And if so, how can I achieve this?</p>