how to build a cluster marker? the data comes on the fly as xml 'phpsqlajax_genxml3.php'. i add the these lines
markers.push(marker); } var markerCluster = new MarkerClusterer(map, markers); but nothing happend. need helf for this result http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/examples/simple_example.html or http://gmaps-utility-library.googlecode.com/svn/trunk/markerclusterer/1.0/examples/advanced_example.html ------------------------------------------------- var iconBlue = new GIcon(); iconBlue.image = 'http://labs.google.com/ridefinder/images/ mm_20_blue.png'; //iconBlue.shadow = 'http://labs.google.com/ridefinder/images/ mm_20_shadow.png'; iconBlue.iconSize = new GSize(12, 20); iconBlue.shadowSize = new GSize(22, 20); iconBlue.iconAnchor = new GPoint(6, 20); iconBlue.infoWindowAnchor = new GPoint(5, 1); var iconRed = new GIcon(); //iconRed.image = 'http://labs.google.com/ridefinder/images/ mm_20_red.png'; iconRed.image = 'bullet_red-16x16.png'; //iconRed.shadow = 'http://labs.google.com/ridefinder/images/ mm_20_shadow.png'; iconRed.iconSize = new GSize(16, 16); //iconRed.shadowSize = new GSize(22, 20); iconRed.iconAnchor = new GPoint(6, 20); iconRed.infoWindowAnchor = new GPoint(5, 1); var customIcons = []; customIcons["restaurant"] = iconBlue; customIcons["bar"] = iconRed; function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(50.972264, 9.788818), 6, G_NORMAL_MAP); // Change this depending on the name of your PHP file GDownloadUrl("phpsqlajax_genxml3.php", function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var address = markers[i].getAttribute("address"); var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = createMarker(point, address); //map.addOverlay(marker); markers.push(marker); } var markerCluster = new MarkerClusterer(map, markers); }); } } function createMarker(point, address) { var marker = new GMarker(point, iconRed); /* var html = "<b>" + address + "</b>"; //extra herausgenommen, hier können sämtliche daten hinterlegt werden GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); */ return marker; } -- You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.
