Search code examples
google-mapsgoogle-maps-api-3polyline

How do I draw two parallel poly lines based on only two points (similar to google maps traffic)


I have a Polyline that is drawn from point A to point B, I'm trying to figure out how to draw two lines of a constant width that appear something like this image.

enter image description here

I only have two points, rather than four, I thought maybe there was a way to create four points, based on the two and then draw the corresponding lines, but I cant seem to get my head around it.

Any suggestions


Solution

  • I am currently trying to achieve the same thing, have two parallel polylines, but with different colors.

    Have you seen this:

    http://wtp2.appspot.com/ParallelLines.htm

    It uses Google Maps v2 API, but it seems quite simple to convert it to API v3.