In this Google tutorial; https://developers.google.com/maps/articles/phpsqlajax_v3 in the ‘Loading the XML File’ section it talks about a function called “downloadUrl”. It says “url specifies the path to either your XML file or to the PHP script that generates the file, depending if you want the XML to be dynamically updated when your database changes. It’s usually easiest to have this reside in the same directory as the HTML so that you can just refer to it by filename.”
The problem is, if I use put a php url into the function it doesn’t work. If I put a direct link to the xml file it does. For example this call does not put the markers on the map.
downloadUrl(‘SCOTAxml.php?lat=39.4&lng=-94.6&dist=100’, function(data) { …
However this call does work.
downloadUrl(“testxml.xml”, function(data) { …
I used the SCOTAxml.php program to create the xml exactly as its done in the tutorial. I just copied it to testxml.xml afterword in order to test the downloadUrl function.
My question if you haven’t guessed yet is why won’t is this not working correctly according to the way the tutorial says it should?
Thoughts? Things to check? A solution?
Thanks in advance to all the great people who help resolve these simple issues.
I downloaded the tutorial and it doesn’t load properly due to the map icons. The link for them is dead. You will need to download your own icons. The icons used in the map can be obtained from Visual Case by clicking and saving.
As commented check you are generating valid XML from
SCOTAxml.php.EDIT
This is the XML file generated from tutorial as shown in browser.
I notice you are passing parameters (lat,lng & distance) which are not required in
phpsqlajax_genxml.php. This would indicate to me that you are mixing the tutorial Creating Store Locator with the one you indicated above.EDIT 2
To output XML content from PHP file the content-type header has to be set. This is so that the browser knows that the output content from PHP file is XML instead of default content-type header (text/html).
EDIT 3
the icon page on visual-case has been moved here: http://www.lass.it/Web/viewer.aspx?id=4