title: MarkerClusterer xml markers
body: <p>What I am trying to do is to add a markerclusterer to my actual code for a map integrated in a webpage. All the markers are created via an xml file generated somewhere else.
  The map is working fine and all is loaded well without markerclusterer.</p>
  
  <p>I cannot figure out what is wrong with my code. Maybe I didn't get how markerclusterer works correctly. I hope you can help me.</p>
  
  <p>What I added to my initial (working) code are 3 lines:</p>
  
  <ul>
  <li>var markersclust = [];</li>
  <li>markersclust.push(point);</li>
  <li>var markerCluster = new MarkerClusterer(map, markersclust);</li>
  </ul>
  
  <p>All is inside "script tags" but in a php file. </p>
  
  <pre><code>echo'
  function load() {
  var map = new google.maps.Map(document.getElementById("map"), {
  center: new google.maps.LatLng(40.8333,14.25),
  zoom: 5,
  mapTypeId: \'roadmap\'
  });
  var infoWindow = new google.maps.InfoWindow;  
  
  downloadUrl("xml_map_public.php", function(data) {
  var xml = data.responseXML;
  var markersclust = [];
  var markers = xml.documentElement.getElementsByTagName("marker");
  for (var i = 0; i &lt; markers.length; i++) {
  var name = markers[i].getAttribute("name");
  var uid = markers[i].getAttribute("uid");
  var address = markers[i].getAttribute("address");
  var point = new google.maps.LatLng(
  parseFloat(markers[i].getAttribute("lat")),
  parseFloat(markers[i].getAttribute("lng"));
  markersclust.push(point);
  var html = "&lt;a href=\"http://www.facebook.com/"+ uid +"\" target=\"_new\"&gt;&lt;b&gt;" + name + "&lt;/b&gt;&lt;/a&gt; &lt;br/&gt;" + address;
  var marker = new google.maps.Marker({
  map: map,
  position: point
  });
  bindInfoWindow(marker, map, infoWindow, html);
  }
  });
  var markerCluster = new MarkerClusterer(map, markersclust);
  }
  
  function bindInfoWindow(marker, map, infoWindow, html) {
  google.maps.event.addListener(marker, \'click\', function() {
  infoWindow.setContent(html);
  infoWindow.open(map, marker);
  });
  }
  
  function downloadUrl(url, callback) {
  var request = window.ActiveXObject ?
  new ActiveXObject(\'Microsoft.XMLHTTP\') :
  new XMLHttpRequest;
  
  request.onreadystatechange = function() {
  if (request.readyState == 4) {
  request.onreadystatechange = doNothing;
  callback(request, request.status);
  }
  };
  
  request.open(\'GET\', url, true);
  request.send(null);
  }
  
  function doNothing() {}
  
  ';
  </code></pre>