I'd like a javascript link that will remove the directions from my map.
Elsewhere on this forum Remove directions from google map api v3 someone asked a similar question and had a solution - but the solution doesn't work for me. Based on that I've tried:
function clearDirections() {
directionDisplay = new google.maps.DirectionsRenderer();
directionDisplay.suppressMarkers = true;
directionDisplay.setMap(null);
return false;
}
What am I doing wrong?