> If I try moving the
> var geoXmlElection=new GGeoXml("http://www.energyjustice.net/map/kml/
> ecounties-out.kmz");
> line into the function (before the "if" statement) it will add it, but
> not remove it.
Scope.
var creates a local variable, when the function completes it is not
accessible anymore ... such as next time the toggle function is run.
You might create a global empty var, and populate when required.
var someKml ;
function bananas() {
if (!someKml) {
someKml = new GGeoXml("url") ; etc
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.