1. Bill Chadwick has an extension that will calculate the distance of a 
point from a polyline at the bottom of this page:

http://www.bdcc.co.uk/Gmaps/BdccGmapBits.htm


2. Build a list of distances from your search result to all other 
markers, using GLatLng.distanceFrom. .sort() that list, then read the 
first few items from the sorted list.

[If you're an old-school programmer, like me, you might be a little 
afraid of performing sorts in a script language. I remember writing 
Bubble Sort algorithms in BASIC that took hours to sort modest numbers 
of elements. But the Array.sort() call turns out to be blindingly fast.]

-- 
Mike Williams
http://econym.org.uk/gmap



--~--~---------~--~----~------------~-------~--~----~
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