First off, thanks for taking the time to consider my question and for your help.
I'm in the process of adding a map to a website using Google Maps API v3 and javascript.
I have a list of addresses and have successfully plotted them on the map. When the user types in a zip code, the map re-centers on their location showing the markers closest to that point. Now, I need to create a list view of the closest 3 or 5 locations to their zip code with links for driving direction. I'm stuck...and open for suggestions.
Thanks!
When you have the lat lng pair of a zipcode you can use the harversine formula to find the distance from your location.
The usual solution is to use the google.maps.geometry.spherical library computeDistanceBetween(from:LatLng, to:LatLng, radius?:number) method to reduce the number to about 10, then use the distance matrix return the driving distance to those locations so the results can be sorted by driving distance (actual travel distance), and reduced to the closest 3 to 5 locations by actual travel distance within the request limits.
example (finds the 3 closest places from a list) (data borrowed from the FusionTables "pizza store" example)
example above with "Get Directions" link in the infoWindow