I turned on the map, and I want to display the routes between two points. everything works fine, and the directions are displayed fine, but I want to change the color of the Polyline direction, I tried this code, as 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 doesnโt display anything, when I comment on it, everything works fine.
what is wrong with this code and how to change the color of a polyline using google maps javascript api v3 ?
Thanks in advance,
source share