Solved

Google Maps API - get 5 nearest zip codes

Posted on 2013-12-13
3
1,257 Views
Last Modified: 2013-12-19
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
Comment
Question by:saturation
  • 2
3 Comments
 
LVL 7

Expert Comment

by:dimmergeek
Comment Utility
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
 
LVL 7

Expert Comment

by:dimmergeek
Comment Utility
The querry could be edited to select just the top five results based on descending order of proximity to your starting zip code.
0
 
LVL 38

Accepted Solution

by:
Tom Beck earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now