In order to determine, where the point lies, I'm using the following in conjunction with a GPS device, following a Google polyline:
1) Convert the polyline points to bitmap coordinates for the given zoom using the well known Mercator transformations 2) Determine the current pixel/meter ratio for the given zoom and latitude 3) Obtain the current GPS position, convert it into bitmap coordinates (like 1) 4) Make your GPS point a rect by adding a delta of your choice (I used +-20 m). For this you need to know 2) 5) Use Liang-Barsky line clipping algorithm in order to determine, whether and what current polyline segment is intersecting with the rect. Your result will be the start and end of the current polyline segment intersecting with your route. The rest is as described by Mike. There is some problems with the rect approach on winded roads, but probably a good starting point for further studies. Regards Mike Williams schrieb: > Once you've found the segment on which the point lies, you just add up > the lengths of the previous segments, plus the distance from the last of > those vertices to the point. > > The hard part is determining which segment the point lies on. I don't > know how to go about determining that. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
