Hi Gil
to do what you want to do you probably need to understand the
DirectionsResult well (which is what comes back from a
DirectionsService request, if status==OK).
re - meaning of Route
The API v3 reference, at DiectionsResult, and the Services document at
DirectionsResult are worth reading and re-reading! I'm trying to get
up to speed on this at the moment, and my understanding is that the
result is a JSON object consisting of the following:
* one or more Routes - a route is the full journey A-B, and there may
be more than one good way of getting from A to B
* each Route contains one or more DirectionsLeg objects
* each DirectionsLeg contains one or more DirectionsStep objects (and
each part of the text based directions instructions)
Step is essentially the lowest level, but each DirectionsStep contains
a path which is an array of latlng points that describe the straight
line segments that make up that step. When you make them visible on a
map (by for instance placing a marker at each latlng point in the
step), you can see how bends in a road are navigated with a series of
straight lines.
So at the bottom of it all, a windy wiggly route is just a bunch of
staight lines, - quite short ones for tight bends.
The following example was for me a great start to get an understanding
of rendering the DirectionsResult components - look at the source,
where he iterates through the legs and steps:
http://www.geocodezip.com/v3_directions_custom_iconsC.html
re your problem.
What sgiddings was saying then, is to go through all the straight line
segments that are in DirectionsStep, for each, you need to do a
calculation to see if your point lies on that line (or better, lies
close enough to a point on the line). I've seen examples of how to
do that, but right now can't remember where.
Hope thats useful
...stu