> var map;
Thats an empty variable called 'map' in global scope
> function initialize() {
...
> var map = new google.maps.Map(document.getElementById('map'),
Thats a map object called 'map' in the scope of initialize(), when
initialize() completes it won't be accessible to other code
> function toggleLayer(overlay, checked) {
...
> overlay.setMap(map);
This attempts to add an overlay to the empty variable in global scope.
No javascript error reported?
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.