Thanks for the reply.  I see whet your saying, I need to know the
segment of the polyline to know when to break out of my loop when
adding up all the distance segments.

function handleMouseOverPolyLine()
{
     var nDistance = 0;
     var nLastVertex = 0;
     for(var i = 0; i < myPolyline.getVertexCount() && ([NOT THE
SEGEMENT THE MOUSE IS ON]); i++)
     {
           if(i > 0){ nDistance += myPolyline.getVertex(i).distanceFrom
(myPolyline.getVertex(i-1)); }
           nLastVertex = i;
     }
     nDistance += [distance from the myPolyline.getVertex(nLastVertex)
to the mouse point];
}

the handler receives 1 param of value 0, not sure what this does but
it doesn't help.
Hmm this looks really messy and far from an ideal solution. Perhaps I
should rethink what I am trying to do...


On Mar 23, 5:27 pm, Mike Williams <[email protected]> wrote:
> 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.
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to