title: Choosing multiple markers in an array for marker clusterin in Google Maps v3 API
body: <p>This question is related to this post:</p>
  
  <p><a href="https://stackoverflow.com/questions/5258553/adding-simple-marker-clusterer-to-google-map">Adding simple marker clusterer to google map</a></p>
  
  <p>I'm wondering how to call markers in an array as simple as possible. Here is my code:</p>
  
  <pre><code>var map = null;
  
  function initialize() {
      var myOptions = {
          zoom: 8,
          center: new google.maps.LatLng(43.907787, -79.359741),
          mapTypeControl: true,
          mapTypeControlOptions: {
              style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
          },
          navigationControl: true,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      }
      map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  
      var mcOptions = {
          gridSize: 50,
          maxZoom: 15
      };
      var mc = new MarkerClusterer(map, [], mcOptions);
  
      google.maps.event.addListener(map, 'click', function() {
          infowindow.close();
      });
  
      // Add markers to the map
      // Set up three markers with info windows
  
      var point = new google.maps.LatLng(43.65654, -79.90138);
      var marker1 = createMarker(point, 'Abc');
  
      var point = new google.maps.LatLng(43.91892, -78.89231);
      var marker2 = createMarker(point, 'Abc');
  
      var point = new google.maps.LatLng(43.82589, -79.10040);
      var marker3 = createMarker(point, 'Abc');
  
      var point = new google.maps.LatLng(43.65654, -79.90138);
      var marker4 = createMarker(point, 'Abc');
  
      var point = new google.maps.LatLng(43.91892, -78.89231);
      var marker5 = createMarker(point, 'Abc');
  
      var point = new google.maps.LatLng(43.82589, -79.10040);
      var marker6 = createMarker(point, 'Abc');
  
      var markerArray = new Array(marker1, marker2, marker3, marker4, marker5, marker6);
  
      mc.addMarkers(markerArray , true);
  }
  
  var infowindow = new google.maps.InfoWindow({
      size: new google.maps.Size(150, 50)
  });
  
  function createMarker(latlng, html) {
      var contentString = html;
      var marker = new google.maps.Marker({
          position: latlng,
          map: map,
          zIndex: Math.round(latlng.lat() * -100000) &lt;&lt; 5
      });
  
      google.maps.event.addListener(marker, 'click', function() {
          infowindow.setContent(contentString);
          infowindow.open(map, marker);
      });
  
      return marker;
  }
  
  window.onload = initialize;
  </code></pre>
  
  <p>The problem is this part:</p>
  
  <pre><code>var markerArray = new Array(marker1, marker2, marker3, marker4, marker5, marker6);
  </code></pre>
  
  <p>Is it possible to avoid naming every marker and use something like</p>
  
  <pre><code>var markerArray = new Array(marker1-marker100);
  </code></pre>