title: A better way of using one array of points to populate multiple google maps
body: <p>Is there a more efficient way of doing the following? This is just an example, there is over ten different maps in total.</p>
  
  <p>Specifically iterating so I dont need to do it separately for every map?</p>
  
  <p>I've got a javascript array I want to map to multiple google maps depending on the shire/council</p>
  
  <p>eg.</p>
  
  <pre><code>var locations [
  ['Shaws Bay - East', 'Far North Coast', 'Ballina Shire Council', -28.86, 153.58],
  ['Shelly Beach', 'Far North Coast', 'Ballina Shire Council', -28.86, 153.59],
  ['The Serpentine', 'Far North Coast', 'Ballina Shire Council', -28.86, 153.57],
  ['Tallow Beach', 'Far North Coast', 'Byron Shire', -28.64, 153.63],
  ['Wategos Beach', 'Far North Coast', 'Byron Shire', -28.63, 153.63],
  ['Clarkes Beach', 'Far North Coast', 'Byron Shire', -28.64, 153.62],
  ['Main Beach (Byron Bay)', 'Far North Coast', 'Byron Shire', -28.64, 153.61]
  //much, much more 
  ];
  </code></pre>
  
  <p>I've got it working using this:</p>
  
  <pre><code>//byron shire   
  map = new google.maps.Map(document.getElementById('map_canvas'), {
      zoom: 12,
      center: new google.maps.LatLng(-28.59, 153.56),
      mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  var infowindow = new google.maps.InfoWindow();
  var marker, i;
  for (i = 0; i &lt; locations.length; i++) {
      var eyetwo = locations[i][2];
      if (eyetwo == "Byron Shire") {
          marker = new google.maps.Marker({
              position: new google.maps.LatLng(locations[i][3], locations[i][4]),
              map: map
          });
      }
  }
  //ballina shire  
  map2 = new google.maps.Map(document.getElementById('map_canvas2'), {
      zoom: 12,
      center: new google.maps.LatLng(-28.83, 153.57),
      mapTypeId: google.maps.MapTypeId.ROADMAP
  });
  var infowindow = new google.maps.InfoWindow();
  var marker, i;
  for (i = 0; i &lt; locations.length; i++) {
      var eyetoo = locations[i][2];
      if (eyetoo == "Ballina Shire Council") {
          marker = new google.maps.Marker({
              position: new google.maps.LatLng(locations[i][3], locations[i][4]),
              map: map2
          });
      }
  }
  //others too
  </code></pre>
  
  <p>Thanks for your help</p>