> When I run the html in Firefox and use the error console the only
> error it comes up with it is "map is not defined". this error only
> comes up when I try to run the script with two xml files.
As you can guess, that's quite important; your 'map' object is defined
locally in your load() function. After that function finishes, the
object 'map' is not available to other functions, like the
GDownloadUrl callback function which runs a long time after load() is
finished.
Change -
function load() {
var map = new GMap2(....
to
var map;
function load() {
map = new GMap2(...
to make 'map' a global object.
That'll fix the error, but not fix the two-XML issue.
You need to look at what your buttons do. They just set a data item
called 'xml', they don't trigger any fetch and display of data.
One approach might be to put your GDownloadUrl() call and its callback
parser into a new function of some kind, myXMLfetch() say, and trigger
that function from your buttons with an appropriate url value.
For the IE problem, your maps <div> size is expressed as a percentage;
when the map is built that gives a size which is a percentage of
something undefined. (None of its parents <html>,<body>,<form> have
specified sizes) Try setting a fixed div size for now
<div id="map" style="width: 600px; height: 400px; ....
You'll find this a useful resource -
http://econym.org.uk/gmap/
cheers, Ross K
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---