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?
 
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.
0
 
Ray PaseurCommented:
0
 
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.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
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
0
 
Ray PaseurCommented:
Very Cool!  Works well for me.  I guess you could add tool tips to the pointers, too.
0
 
fsouzaAuthor Commented:
Hi experts! PERFECT SOLUTIONS!!!!!! Thank you very much!
0
 
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.
0
 
Ray PaseurCommented:
Thanks for the points - glad to help, ~Ray
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.