Skip to content Skip to sidebar Skip to footer

Unexplained Extra Polyline Drawn - Google Maps Api V3

I have a strange scenario with regards to a Polyline that is being drawn on the map. Before I post the code, I'll first demonstrate what happens when I make use of the normal direc

Solution 1:

Ok, so to solve the problem. Just remove the following line:

Reference: Google Documentation - Simple Polylines

enter image description here

And like that, the line is gone:

enter image description here

Solution 2:

Aren't you also drawing a line between the first and last poly? You should only draw lines between poly0 and poly1, poly1 and poly2 etc. but not poly100 and poly0 (if poly100 is the last one)

That would explain the straight line going from point B to A completing the shape. you don't want to complete the shape, so stop drawing. is there no function you can set to not complete the shape?

I only know of a very expensive work around and that is to trace back in reverse order from B to A along the same route. But that is probably not what you are looking for

Post a Comment for "Unexplained Extra Polyline Drawn - Google Maps Api V3"