Hey, After reading through loads of the "xml not loading" related problems, i still cant seem to find an answer, is there an error with my code or do i need to ask my host to configure the server to allow xml requests?
The map loads, but the markers dont show, I have validated the xml and it doesnt give me any errors, I have also substituted the xml with hard coded values and it works fine, which means theres an error somewhere in the xml. I am completely new to xml and the gmaps api so any help would be greatly appreciated here is a direct link to the page : http://chilternstravel.co.uk/xmlTest.aspx here is a direct link to the xml file : http://chilternstravel.co.uk/parks.xml Here is the code: XML - parks.xml ---------------------------------------- <?xml version="1.0" encoding="utf-8" ?> <parks> <park> <point lng="51.70278" lat="-0.70587" /> </park> <park> <point lng="51.70278" lat="-0.80587" /> </park> </parks> ---------------------------------------- CODE - xmlTest.aspx ---------------------------------------- <head runat="server"> <title></title> <script src="http://maps.google.com/maps? file=api&v=2&key=ABQIAAAAbk73jrvh7tlNLOUO2HZizBR5hBmf8yuuAVu3T1KX5bmyZdUF0RRKlpBE- xmqDrK4zh8J1WOjGsL2Cg&sensor=false" type="text/javascript"></script> <script type="text/javascript"> function initialize() { if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById ("map_canvas")); map.setCenter(new GLatLng(51.70278, -0.70587), 11); // SET UP MARKER POSITIONS function createMarker(point) { var marker = new GMarker(point); return marker; } var request = GXmlHttp.create(); request.open("GET", "parks.xml", true); request.onreadystatechange = function() { if (request.readystate == 4) { var xmlDoc = request.responseXML; var points = xmlDoc.documentElement.getElementsByTagName("point"); for (var i = 0; i < points.length; i++) { var point = new GLatLng(parseFloat(points [i].getAttribute("lat")), parseFloat(points[i].getAttribute("lng"))); var marker = createMarker(point); map.addOverlay(marker); } } } } } </script> </head> ---------------------------------------- Thanks in advance :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
