Forum Moderators: open

Message Too Old, No Replies

Google maps API: color & size of routes

how can i change the color and width of a route in google maps?

         

StarCoder

8:06 am on May 6, 2008 (gmt 0)

10+ Year Member



probably a simple question, but i coudnt find a solution at the google maps code examples.
i have a simple map with a route like this one here:
[code.google.com...]

i need more than just one color on my routes and a variable width for each route, how can i change that?

i checked the reference at [code.google.com...] , but it seems like there is no method or property that could be used to change color and line width.

any suggestions?
im not good at js; im more the sql and php guy...

httpwebwitch

8:17 pm on May 6, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



looks like you can use "getPolyline()" to get the line as an object.

See if it has any properties, writable ones.

// Gdirection is the object returned from the class GDirections...
var gp = Gdirection.getPolyline();
for(var i in gp){
alert(i);
}

maybe there are properties like "color" or "weight" in there... in the absense of good documentation, all you can do is poke around and see what you can find. the for/in loop is handy for that.