Returning nearest locations

I have a database with various geographic codes and i have geocode or zipcode the logged user and i need return only 25 locations nearest him.

how can i use google maps api to return this with my webservice function in php?

Thank you,
Felipe
fsouzaAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ray PaseurCommented:
Dave BaldwinFixer of ProblemsCommented:
Here https://developers.google.com/maps/articles/phpsqlsearch_v3 is the Google Store Locator application that will do it.  You can modify it to your needs.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ray PaseurCommented:
I just read the Google dev guide, and it looks pretty good.  The one thing I would want to consider goes to the number of store locations and distances from the client.  What if there were 14,000 stores?  That's why I use a "downselect" into a temporary table before computing the distances from client to nearest stores.  You can minimize the processing.

It's also worth considering what happens if the client said, "within 20 miles" and the nearest store was 20.1 miles away.  Obviously the client would want to know that, rather than just get a null response.
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Dave BaldwinFixer of ProblemsCommented:
When I used it I modified it in several ways.  I put the askers location on the map in part to make sure there was never a NULL response.  I also added code to make sure the result area wasn't too small.  If you have only one result, the standard map is zoomed in to that neighborhood so you have no idea where it is.  You can see it here if you want to: http://www.darkhorsecrankworks.com/dealer.html
Ray PaseurCommented:
Very Cool!  Works well for me.  I guess you could add tool tips to the pointers, too.
fsouzaAuthor Commented:
Hi experts! PERFECT SOLUTIONS!!!!!! Thank you very much!
Dave BaldwinFixer of ProblemsCommented:
It's set up so you have to click on the markers to get the text.  Otherwise, you would find the screen suddenly filled with text blocks stepping all over each other in dense areas.
Ray PaseurCommented:
Thanks for the points - glad to help, ~Ray
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.