change the color of the polyline in DirectionsRenderer

前端 未结 4 1060
-上瘾入骨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 18:00

    In answer marked as resolved I see that object Polyline used for polylineOptions. In my case I use the next code

    new google.maps.DirectionsRenderer({ suppressMarkers: true, polylineOptions: { strokeColor: '#5cb85c' } });
    

    The difference is that I assign polylineOptions, not Polyline object. Not sure it could be helpful, but decided to add these answer.

提交回复
热议问题