> I have a toggle function that handles this:
>
>     function toggleTraffic (toggle, map) {
>         var trafficLayer = new google.maps.TrafficLayer();
>         if (toggle) {
>             trafficLayer.setMap(map);
>         } else {
>             alert("Should Work");
>             trafficLayer.setMap(null);
>         }
>     }
>
> I get the alert "Should Work", but the traffic layer persists.

Which layer?   Every time you run that function, you create a new
layer.  Creating a new layer and immediately 'hiding' it, won't change
anything about any layer you may have created before.

-- 
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.

Reply via email to