How to add markers on Google Maps polylines based on distance along the line?
Posted
by mikl
on Stack Overflow
See other posts from Stack Overflow
or by mikl
Published on 2010-04-23T11:29:07Z
Indexed on
2010/04/23
11:33 UTC
Read the original article
Hit count: 549
I am trying to create a Google Map where the user can plot the route he walked/ran/bicycled and see how long he ran. The GPolyline
class with it’s getLength()
method is very helpful in this regard (at least for Google Maps API V2), but I wanted to add markers based on distance, for example a marker for 1 km, 5 km, 10 km, etc., but it seems that there is no obvious way to find a point on a polyline based on how far along the line it is. Any suggestions?
© Stack Overflow or respective owner