I have a map with approx 250 markers and I would like the markers to be in different colours based on a particular property of the markers.
When I run my code with just one custom marker everything displays perfectly but when I try to add a second marker colour none of the markers are displayed. My code is displayed below. Can anyone see what is wrong with it <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http:// www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/ > <title>IPW Mapping Function</title> <script src="http://maps.google.com/maps? file=api&v=2&key=ABQIAAAA4Rd9GhlL9e402g1WbioTSRTL9unIhIo6Wm3MJc7vLSngZ2lbcBSJLgx1SX_XUWnbv60TLxoc1meGiQ" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ https://lh10.dnsireland.com:2083/frontend/x3/filemanager/editit_code.html?__cpanel__temp__charset__=us-ascii&dir=%2fhome%2firishpro%2fpublic_html%2fbeta&file=FinalMap.php var SelectedLonigtude; SelectedLonigtude=<?php echo $Long?>; var SelectedLatitude; SelectedLatitude=<?php echo $Lat?>; var iconRed = new GIcon(); iconRed.image = 'http://labs.google.com/ridefinder/images/ mm_20_red.png'; iconRed.shadow = 'http://labs.google.com/ridefinder/images/ mm_20_shadow.png'; iconRed.iconSize = new GSize(12, 20); iconRed.shadowSize = new GSize(22, 20); iconRed.iconAnchor = new GPoint(6, 20); iconRed.infoWindowAnchor = new GPoint(5, 1); var iconYellow = new GIcon(); iconRed.image = 'http://labs.google.com/ridefinder/images/ mm_20_yellow.png'; iconRed.shadow = 'http://labs.google.com/ridefinder/images/ mm_20_shadow.png'; iconRed.iconSize = new GSize(12, 20); iconRed.shadowSize = new GSize(22, 20); iconRed.iconAnchor = new GPoint(6, 20); iconRed.infoWindowAnchor = new GPoint(5, 1); var customIcons = []; customIcons["Drop"] = iconRed; customIcons["NotDrop"] = iconYellow; function load() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(SelectedLonigtude, SelectedLatitude), 13); GDownloadUrl("MapTest.php", function(data) { var xml = GXml.parse(data); var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var Ext_ID= markers[i].getAttribute("Ext_ID"); var region= markers[i].getAttribute("Region"); var Beds= markers[i].getAttribute("Beds"); var Price= markers[i].getAttribute("Price"); var Address= markers[i].getAttribute("Address"); var NoDrops= markers[i].getAttribute("NoDrops"); var NoIncreases= markers[i].getAttribute("NoIncreases"); var ChangeType = markers[i].getAttribute("ChangeType"); var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = createMarker(point, region, Beds, Address, Price, NoDrops, NoIncreases, ChangeType); map.addOverlay(marker); } }); } } function createMarker(point, region, Beds, Price, Address, NoDrops, NoIncreases, ChangeType) { var marker = new GMarker(point, customIcons[ChangeType]); var html = "<b>" + Price+ "</b> <br/>" + region + "</b> <br/ >Price €" + Address + "</b> <br/>Drops " + NoDrops+ "</b> <br/ >Increases " + NoIncreases; GEvent.addListener(marker, 'click', function() { marker.openInfoWindowHtml(html); }); return marker; } //]]> </script> </head> <body onload="load()" onunload="GUnload()"> <div id="map" style="width: 700px; height: 350px"></div> </body> </html> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
