Wasn't it Region 3 DFG who wrote:
>
>so how do you use it? it works cleanly for the tile overlays but seems
>to cause havoc with the kml.
>
>here is the current app i am working on..
>
>http://region3.dfg.googlepages.com/r3starter1_5.html?kml=http://ftp.dfg
>.ca.gov/Public/R3_BDR/gis_exports/dfg_lands_r3.kmz
I'd suggest not adding the unchecked overlays until the first time that
the user ticks the corresponding box.
The problem is that addOverlay(geoXml) is asynchronous. You can't
.hide() it until it's finished loading. Even if you do wait for it to
finish loading it won't look right because the various elements that the
KML file mentions will appear one by one, then when you issue the
.hide() will all disappear.
So. In your addLayer() function you would call new GGeoXml, but not
perform
map.addOverlay(geoXml);
geoXml.hide();
instead, add a flag that reminds you that it has not been addOverlayed
layers[id].added = false;
Then in your togXML() function, if the box is selected but the xml
hasn't been added, you addOverlay it rather than .show() it, and
remember that you have added it:
if (checked) {
if (layers[id].added) {
daobj.show()
} else {
map.addOverlay(daobj)
layers[id].added = true;
}
}
It would be most efficient to do the same delayed first addOverlay() for
all types of objects, but simply setting layers[id].added=true when you
do addOverlay() them would work too.
--
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
-~----------~----~----~----~------~----~------~--~---