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 change the color of the Polyline direction ,i’ve tried this code like the documentation says :
//polyline options
var pOptions = {
map: map,
strokeColor: "#2249a3",
strokeOpacity: 0.9 ,
strokeWeight: 12,
z-index: 99
};
logJava(polylineOptions);
//directionsRenderer options
var mDirectionsRendererOptions = {
map: map,
suppressMarkers: true,
suppressInfoWindows: true,
polylineOptions: pOptions
};
logJava(mDirectionsRendererOptions);
directionsDisplay = new google.maps.DirectionsRenderer(mDirectionsRendererOptions);
but when i add this code , it stops the map , and it displays nothing, when i comment it , everything is working fine .
what is wrong with this code, and how to change the color of the polyline with google maps javascript api v3 ?
Thanks in advance,
At global declarations
At initialise