I have a google map using API v3 which gets directions from one location to another. The app works great but the window which gets the directions is an overlay on the map. I'd like it so when this window is closed directions are removed from the map but other markers remain.
I have tried the following:
$('#content .close').live('click', function() {
$('#content').hide();
directionDisplay = new google.maps.DirectionsRenderer();
directionDisplay.suppressMarkers = true;
directionDisplay.setMap(map);
return false;
});
This seems to hide the window as expected but doesn't do anything regards with removing directions from the map.
Any help is much appreciated.
Dave.
question from:
https://stackoverflow.com/questions/5645920/remove-directions-from-google-map-api-v3 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…