how to change the color of route in google maps v3

前端 未结 2 488
长情又很酷
长情又很酷 2020-12-05 10:10

I am using this code to get directions between two points. Is it possible to change the color of the route from blue? I am not using polyline in my code.

Thanx in ad

2条回答
  •  盖世英雄少女心
    2020-12-05 10:25

    You can specify the color of the line when you create the DirectionsRenderer, using the optional DirectionsRendererOptions struct.

    This works for me, simply changing the line where the DirectionsRenderer object is created:

    
    
      
        
        
        Directions service
        
        
        
      
      
        
    Start: End:

提交回复
热议问题