I got it pretty much working, but I have two problems: the zip database I got from USPS does not seem to be very accurate, it (obviously) does not include Canadian postal codes, and for some reason, some zip codes either do not exist on the database, or the distance is not registered for some reason (making it seem as if that particular zip code is nowhere to be found).
I am using the following to find the distance in miles between one longitude/latitude and another
$distance = ( acos ( cos ( $lat1 ) * cos ( $lon1 ) * cos ( $lat2 ) * cos ( $lon2 ) + cos ( $lat1 ) * sin ( $lon1 ) * cos ( $lat2 ) * sin ( $lon2 ) + sin ( $lat1 ) * sin ( $lat2 ) ) * $r);
For example, Biltrite should show up with a zip of 53220, but it does not show up until you change the distance selection to 40 miles.
Not only would I like to just implement the GMaps API, instead of digging through my code to find the culprit; I would also like to make the search much more accurate, which is not possible with the zips DB I have currently.
Thanks for the help!
__________________ Jason Corradino
Applications Developer, Interactive Support - Tribune Technology
J2EE Development, Script Tinkering - Develop, Support, and Maintain Tribune websites.
Last edited by jcorradino : 10-30-2008 at 01:38 PM.