sorry, some of that didnt make sence to me, but I got it to remove the overlay now. But now its not clearing out the latlng from data2.xml now. So its mapping both data.xml and data2.xml...
On Apr 14, 2:30 pm, "[email protected]" <[email protected]> wrote: > On Apr 14, 12:05 pm, Mike <[email protected]> wrote: > > > Thanks for you reply. > > I did try that but it didnt work. > > I uploaded what I have done so far, for some reason it just wont > > remove the overlay. I just might not know what to put into the > > code.... > > 1. your map needs to be global (currently it is local to your load > function) > 2. datatype1(), datatype2() and centermap() are not defined. > 3. your datatyperef() and datatypecust() functions set the xml > variable, but do nothing else. You need to call something that > actuall does the GDownloadUrl if you want it to happen again... I > think the reason it happens at all is that your page is so simple that > the onload event occurs before the data comes back in the first call. > You should be calling GDownloadUrl the first time inside you load > function, not inline. > > -- Larry > > > > > On Apr 14, 11:20 am, Seb Ashton <[email protected]> wrote: > > > > not 100% but would putting map.removeOverlay(overlay) before each of > > > your GDownloadURL statements work? > > > > just an idea, might be worth a go - i am only new to this myself > > > > - Seb > > > > On Apr 13, 11:06 pm, Mike <[email protected]> wrote: > > > > > ok I got it to load the both XML files. Now I just need to figure out > > > > how to make sure that only one set of markers is mapped out at a > > > > time... > > > > > On Apr 13, 1:33 pm, Mike <[email protected]> wrote: > > > > > > thanks to both of you, I will try it out! > > > > > thanks again! > > > > > > On Apr 13, 1:08 pm, Rossko <[email protected]> wrote: > > > > > > > > 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- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
