Zip Code Distance

Hello, is there a way to add a search feature that will give a geo-location of the zip codes entered? I would like to have a customer come to my site and say find Public Notary within 25 miles of zip code entered. This is much needed for this plugin I believe. I found this http://www.micahcarrick.com/php5-zip-code-range-and-distance.html it doesn't seem too hard, but it is to me a non-programmer:slight_smile:. Thanks!

  • Kimberly
    • Champion of Loops

    atlanteavila,

    Great request!

    I'm not sure that Directory would be the best place for that functionality, so I will change this to plugin reference to Google Maps and see if I can get some dialog started on the feasibility of a feature like this.

    Ve: if Google Maps is not the place for something like this, let me know and I'll go directly to uservoice :slight_smile:

    Thanks!

  • fitoussi
    • The Incredible Code Injector

    Hi Atlante,
    This is an interesting link you a posted. I've been working and still looking around to archive the exact thing you want. There is a tutorial I found but cant pull the link at the moment that shows step by step how to get it done. I haven't start the tutorial yet but when ever I will know if it works I will definitely share it with you.

    Right now I can display posts and markers on the map of a certain zipcode that I enter in a search box. But I'd like to have resaults whitin a certain range.

    It is not very easy task as first I need to find an up to date zipcode database and add it to my site database. Then I created custom field to hold the zipcode of each listing. In the end I will have to add the code from the tutorial that find the different zipcodes within a certain area from the zipcode I provided in the search box. Then it will display the posts with the same zipcodes from the search resaults. Moreover, some coding in the google map plugin will display the markers of those posts.

    Not easy but definitely a great challenge.

  • Christopher Price
    • The Incredible Code Injector

    I would try to integrate a google (or mapquest) map search or (free) api call to accomplish a simple thing like plotting notary offices. Now if you want to start discriminating by which notaries are willing to pay a fee or some such, that's when things get more difficult.

    http://wordpress.org/extend/plugins/search.php?q=google+maps+api finds 160 ready-to-go plugins. Hopefully one of those will suit your case.

  • atlanteavila
    • Flash Drive

    Thanks but if that were the case I wouldn't even think about paying $500 for someone to create a simple free api call. That would render me an ROI of $0. I obviously need a search feature that searches for addresses found in the Directory plugin within the proximity of the zip code entered by the user. Thanks though.

  • fitoussi
    • The Incredible Code Injector

    Hold tight Atlanteavila, i am getting there.
    i already got the zip code database into my website database. i added a search box for the zip code and drop down menu to choose the distance in miles (5, 10,50,100). i also added a function that calculate the radius around a zip code by its Latitude and Longitude. pretty much now i can populate an array of zip codes within a radius of the zip code i entered. now i just need to take this array and display the posts with the same zip codes.

  • fitoussi
    • The Incredible Code Injector

    Hi atlanteavila,
    What I have now is a search box to enter a zip code and a drop down menu to choose the distance. Once you enter a zipcode and press search it will bring up results ( directory posts) with zipcodes within a radius from your zipcode. The Results will show the title, address, and the distance in mile ordered by the distance (nearest first).the Only thing I am still looking to get is the map to display the markers of those results but I am not sure if i can get it to work.
    If you have some knowledge in programming I can post a tutorial here for you to try to do it.

  • atlanteavila
    • Flash Drive

    Wow, a tutorial would be great, I know basic PHP, but this was way out of my league. I would love to see how it works. I was recently working with Google's API: https://developers.google.com/maps/articles/phpsqlsearch. I have been trying to add this functionality to the directory plugin but like I said, way out of my league.. That tutorial shows you how to add the markers.

    Please keep me posted on new developments! I would be willing to pay like I said.

    Thanks a bunch!

  • fitoussi
    • The Incredible Code Injector

    atlanteavila,
    i am almost there, i am just working with the code right now making it better. instead of uploading a zip codes database (with 40,000) zip codes and make the function go through all of them every time i need to search. now with every new post that i create i use a function that take the address, convert it to latitude and longitude and add them as custom fields. this way when searching it will search only though existing posts in my site instead of going though 40,000 zip codes. i also got google maps to display the markers of the posts from the search result but i still got a problem when trying to search too many zip codes. i am trying to figure it out.

    how much time do you have?
    i also need to know few things about the project your working on so see we could make it work. do you want to drop an email where i can contact you?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.