PDA

View Full Version : Making a search feature (possibly) using Google API


harbingerOTV
07-31-2008, 12:55 AM
Before I start this off, this is not a request for someone to build this for me so no pointing to the paid work offers board. What I am looking for is a close example if you know any or at least some direction to make sue I'm going about this the right way. Plus, I'm pretty anal about diving in myself on things like this to learn more so, paying for help is always the last resort ;)

My goal:
1) A user will sign up and give their location.

2) When someone uses the member search form, it will have an option to search within 100 miles (or so). Using an option box to select form like 0-100 miles in increments.

3) This will hit my MySQL DB. The results will appear on a map (ala Google) but also in a list below it. The list should be sorted in closest to farthest.

My thoughts on going about this:
1) Registering and entering information into the form and database shouldn't be an issue. What i assume needs to happen is that on submission, the Lat. and Lon. are found for that location and also stored so the next step will work.

2) I've seen this function in a lot of places but not finding any documentation on how to do it. Obviously the script will need to take the distance variable and then check the database fro all relevant entries.

3) The map I'm sure isn't a huge issue once the rest is written as Google has good documentation and working out the finer points can be done with some trial and error. The sorting should be easy with PHP just sorting my the number.


edit:
I have found http://www.movable-type.co.uk/scripts/latlong.html which may or may not be a starting point

bazz
07-31-2008, 01:14 AM
Hi,

I have been looking into this myself lately. Whilst I have used lat and long so far, google and the people who provide them with the mapping capability, use GPS. grid refs, don't work globally and so each country has its own grid system. In the USA, there are several because of the earth's curvature. (I think it's flat but curvature makes for a money making opportunity :D )

So if I find anything, I'll let you know.

bazz