i\'ve integrated a map and i want to display the route directions between two locations. everything is working fine and the directions is displayed perfectly , but i want to cha
Using setOptions(options:DirectionsRendererOptions) makes code more readable. The coding would be:
At global level:
var directionsDisplay;
Inside initialize()
method:
var polyline = new google.maps.Polyline({
strokeColor: '#C00',
strokeOpacity: 0.7,
strokeWeight: 5
});
directionsDisplay = new google.maps.DirectionsRenderer();
directionsDisplay.setOptions({polylineOptions: polyline});
now directionDisplay can be used in any method with the custom poly line.