Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1707
  • Last Modified:

Google Maps API - get 5 nearest zip codes

I'm looking for a very basic API call to the Google Maps API (preferably in Javascript) that gets the 5 nearest zip codes to a zip code passed in as a parameter. I can't seem to find anything on the Internet. Does anyone have an example or a link to do something like this?
0
saturation
Asked:
saturation
  • 2
1 Solution
 
dimmergeekCommented:
Working code and an old database can be downloaded at git hub here: https://github.com/Jakobovski/Simple-Zip-Code-Script

Per the code author:
Find all the zip codes in a radius of x miles from a another zip code, or find the distance between two zip codes. The script uses the most up-to-date database provided by the U.S government with 42,000+ records. Using it is as simple as calling a PHP function. This program was written with simplicity in mind. It is very easy to use and install. This script can be used alone or easily integrated with other projects such as a store locator.
0
 
dimmergeekCommented:
The querry could be edited to select just the top five results based on descending order of proximity to your starting zip code.
0
 
Tom BeckCommented:
Maybe this can help. I answered a similar question in June and provided a working example that sorts through 10 locations to find the two closest to a zip code entered. It also lists the 10 locations and the number of miles each is from the zip code.

http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28161118.html
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now