On Oct 3, 10:15 am, Esteve Graells <esteve.grae...@gmail.com> wrote: > We are a kid association for trekking outdoors. We'd like to offer dads the > change to know when kids will arrive at the end of a route. > > Using google maps api v3, we draw a polyline to show the route, let's say > it's from a point A in the forest to point Z a bit far with waypoints around > (B, C, D, E...). > > As one of our teachers is carrying a nexus one, we know, where they are and > the speed they go (usually very very slow ;-) ). > > Here is the question: > > *How can we know how long far is from the current position to the end of the > route follwing our path route? Not straight direction (may be the mountain > does not allow us), no driving.* > > So in fact it is quite simple: *How to know distance from point X to Y > following a custom route*.
Actually it is a little more complicated than that. There is no guarantee that the arbitrary point that you get from the nexus one is on the polyline. So you first need to find the closest point on the polyline to the position of the nexus one, then find the distance along the polyline from that point to the end of the polyline. All the pieces exist, you just need to put them together. -- Larry > > I've checked the API, but couldn't find any function to do that. > > Thanks in advance, > Esteve. -- 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.