On Sep 5, 2:28 am, Rossko <ros...@culzean.clara.co.uk> wrote: > > What I thought I could do is find the distance along the route of the > > first marker/latlng, then do the same with the second and animate > > between the two distances, but I can't find a way of getting the > > distance along the polyline of a given latlng. > > You might use the GetPointAtDistance() method of v3_epoly
I was hoping to find a more efficient approach but what you suggested did the trick. I traverse the polyline once from start to finish, at each stage checking whether the current lat/lng is also a marker's location - if it is then I store the distance as part of the marker object. Then the animation is just a case of several more GetPointAtDistance() calls, with the value of distance bounded by the two markers. Thank you for your help. -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to google-maps-js-api-v3@googlegroups.com. To unsubscribe from this group, send email to google-maps-js-api-v3+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.