title: Cluster Google Maps Marker after pulling coordinates from MySQL Database
body: <p>What I basically have is a Map that displays simple Google markers.</p>
  
  <p>The Location of the markers is stored in a MySQL database. Now I want to use MarkerCluster to get things organized. However, I am having trouble. Although the guidelines seem fine ( <a href="http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/examples.html" rel="nofollow">http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/docs/examples.html</a> ) I really can't get it to work.</p>
  
  <p>Currently my markers are defined as:</p>
  
  <pre><code>// Change this depending on the name of your PHP file
      GDownloadUrl("gen.php", function(data) {
        var xml = GXml.parse(data);
        var markers = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i &lt; markers.length; i++) {
          var name = markers[i].getAttribute("name");
          var address = markers[i].getAttribute("address");
          var type = markers[i].getAttribute("type");
          var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                  parseFloat(markers[i].getAttribute("lng")));
          var marker = createMarker(point, name, address, type);
          map.addOverlay(marker);
        }
      });
    }
  }
  </code></pre>
  
  <p>Now in the example for MarkerCluster I am supposed to define my markers like this:</p>
  
  <pre><code>var markers = [];
  for (var i = 0; i &lt; 100; ++i) {
    var latlng = new GLatLng(data.photos[i].latitude, data.photos[i].longitude);
    var marker = new GMarker(latlng);
    markers.push(marker);
  }
  var markerCluster = new MarkerClusterer(map, markers);
  </code></pre>
  
  <p>However I have no idea how to combine these two. Markers is already defined and I do not see how markerCluster is being called nor do I understand how I get the data into the markers in the example.</p>
  
  <p>Any pointer appreciated.
  Thanks.</p>
  
  <p>George</p>