0

I have a need to provide a widget on a webpage that allows a user to enter in a zipcode or suburb to determine if the website's business delivers to their area (basically are they inside of some range/radius).

Anyone know of any libraries (commercial or opensource that would help achieve this instead of writing my own bit of code. As it may be hosted on different platforms - the thought of a javascript/client side only solution would be best.

Thoughts?

Thanks!

  • Remember to upvote all useful answers and "check" the answer that best answers your question (if any). Check the earliest right answer in case of ties. – Larry K Oct 19 '10 at 02:42

2 Answers2

0

Also, Google Gears ( http://code.google.com/p/gears/wiki/LocationAPI?redir=1 ) has an API that allows you to pinpoint the location of your visitors, you should check it out.

Claudiu
  • 3,261
  • 1
  • 15
  • 27
0

You can create the service yourself by storing your store locations (lat/long) in your dbms (eg MySQL), then querying the database with the zip code/location.

You will need to convert the user's input (zip code or location) into lat/long. That's called geocoding. There are geocoding services on the net that you can use, but check the license terms.

Easier might be to only accept zip codes (if you're US only). Here's a zip code to an open source lat/long file.

Then query your database. This is a "Geospatial query" These days, it's not hard. A MySQL presentation. More info, a blog post, SO Answer.

Community
  • 1
  • 1
Larry K
  • 47,808
  • 15
  • 87
  • 140
  • Really appreciate your leads. Thanks! – sub.contact Oct 14 '10 at 03:58
  • I guess if the view is that it's very simple there may not be many products/services that just do it instead of rolling my own solution?? – sub.contact Oct 14 '10 at 03:59
  • There could be a library to help you. Or, as you say, it is pretty simple these days. The other way to look at it is that libraries do exist for the various parts of the puzzle: the geocoder in particular, and the dbms. – Larry K Oct 19 '10 at 02:41