It's probably not worth the hassle.

If you really feel the need, then I'd suggest using two GDirections 
instances, one for driving and one for walking, with separate directions 
panels. Use getPolyline() to fetch a reference to the polyline and 
getMarker() to fetch a reference to each marker.

When you toggle the directions mode, hide the directions panel of the 
inactive mode,show the directions panel of the new mode, and call 
.hide() on the old polyline and markers.

Once you have both sets of directions you can show and hide them at 
will.

Note: You do need two GDirections instances to do this, since each 
instance knows about the data that it plotted, and will remove that data 
when it gets called again.

Hint: careful choice of polyline colours, widths and opacities would 
make it reasonable to display both polylines at the same time. The 
awkward thing is that some walking routes might share considerable 
portions of the driving route, and you may not be in complete control of 
which polyline is plotted above the other. You might set one line to be 
wide and partially transparent and the other to be opaque and narrow, so 
that you can always see both lines when they coincide.

-- 
Mike Williams
http://econym.org.uk/gmap


--

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.


Reply via email to