> Another try I've made, and maybe is possible, is trying to check > whether the distance between a point and a polyline is zero. The only > problem is that I don't know if it will work when the street is curved > (because I need the line between the polyline points will be a curved > line according to the street and not a straight line between the > points).
I think that is the way you need to go. Don't look for a 'zero' distance from point to line, you wouldn't want to reject some point if it was 3mm off track. To account for the width of streets you might want something like "within 25m" but that's up to you. As you say, you'd need to get the polyline associated with a route, not just waypoints, to account for curves and doglegs. http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GDirectionsOptions.getPolyline Take care with storing Google's directions results, the terms allow you to access their data for display on the map, storing for other purposes may be a problem. This thread will be of interest for distance calculation http://groups.google.com/group/google-maps-api/browse_thread/thread/224da190b393a34a/3a1d642ccfa9490c Bill Chadwick's example. -- 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.
