Wasn't it Neil.Young who wrote:
>And there is another fact, driving me crazy a bit: Even if ActiveX
>support is disabled and GDownloadUrl fails, GDirections works without
>any problems. On what track is GDirections running?
GDirections can't use anything remotely like GDownloadUrl or
XMLHttpRequest or ActiveX, because it has to work cross domain. Those
techniques are limited to accessing data from the same domain, for
security reasons.
GDirections, and all the other cross-domain API services, ends up using
a <script src="..."> tag to fetch Javascript code. That will work across
domains, and I believe that it will work in any environment where
Javascript is enabled.
If you want to try that, you need to rewrite your data as Javascript
code, which could be as simple as gluing your existing data onto a
single line and then putting it into a string, like
var data = '<markers> <marker lat="43.1" lng="-79.2"> ... </markers>'
Note: watch out for the fact that there's now an *extra* level of
quotes.
Process it like this:
document.write('<' + 'script src="' + url + '"' +
' type="text/javascript"><' + '/script>');
I guess it's synchronous, in which case you can immediately write
if (data) {
var xmlData = GXml.parse(data);
...
}
If you find that it's asynchronous, I guess you could put the Javascript
code that processes the data into the file itself
var data=' ... ';
var xmlData = GXml.parse(data);
var markers = xmlDoc.documentElement.getElementsByTagName("marker");
for (var i = 0; i < markers.length; i++) {
...
var marker = createMarker(point,label,html);
map.addOverlay(marker);
}
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---