Friday, May 14, 2010

Re: Toogle overlays with checkboxes

> Here is a link to my map :http://orphee5.free.fr/map/map-test.htm

I get a simple script error in my browser on this line, don't you?
arbreOverlay = new arbreOverlay();
arbreOverlay is not a class that you have defined, so you can't have a
'new' one.

arbreOverlay is a GGroundOverlay that you defined in your load()
function, but you defined it in local scope to load(). That means you
can't refer to it later.
http://econym.org.uk/gmap/scope.htm

If you make it global you could re-use it later, in the checkbox code.
// outside of any functions
var arbreOverlay;

// inside your load() function
arbreOverlay = new GGroundOverlay( ....

In your addarbreOverlay() function, you might want to hide and show
the overlay, it is less overhead than adding it and removing it.
http://code.google.com/apis/maps/documentation/reference.html#GGroundOverlay.hide
arbreOverlay.hide();
arbreOverlay.show();

--
You received this message because you are subscribed to the Google Groups "Google Maps API" group.
To post to this group, send email to google-maps-api@googlegroups.com.
To unsubscribe from this group, send email to google-maps-api+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-maps-api?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate