change the color of the polyline in DirectionsRenderer

前端 未结 4 1072
-上瘾入骨i
-上瘾入骨i 2021-02-09 17:29

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

4条回答
  •  一个人的身影
    2021-02-09 17:53

    At global declarations

    var polylineOptionsActual = new google.maps.Polyline({
        strokeColor: '#FF0000',
        strokeOpacity: 1.0,
        strokeWeight: 10
        });
    

    At initialise

    function initialize() {
       directionsDisplay = new google.maps.DirectionsRenderer({polylineOptions: polylineOptionsActual});    
    

提交回复
热议问题