Omni
Omni

Reputation: 47

Google Maps Driving Directions, change Stroke Color?

I have something very similar to this example:

https://developers.google.com/maps/documentation/javascript/examples/directions-simple

All I am trying to do it change the stroke of the line from one city to another city, which is currently a purple color?

I tried putting strokeColor in myOptions, but no luck:

      var myOptions = {
        zoom:1,
        strokeColor: "#000000",
        mapTypeId: google.maps.MapTypeId.ROADMAP
      }

Upvotes: 2

Views: 6946

Answers (2)

Dongolo Jeno
Dongolo Jeno

Reputation: 444

You can use polylineOptions to change the color of the line

polylineOptions: { strokeColor: '#0088FF', // red strokeWeight: 4, strokeOpacity: 0.6 },

Upvotes: 0

Related Questions