hellomello
hellomello

Reputation: 8597

google maps and stored address in mysql database radius search similar

Lets say I have a large amount of data with addresses. If I'm searching for a certain store, and I want to see nearby similar stores, does google maps need to query through my entire database to search for an address that is within the radius of the certain store? Would that take forever? What would be the most efficient way of showing similar stores? I currently have a script that shows a location of a specific store based on an address.

Thanks

Upvotes: 1

Views: 1652

Answers (1)

CodeFuze
CodeFuze

Reputation: 371

Google maps doesn't make the query. You would need to set the nearby stores while executing the search function and pass it to google maps. Then create a function in the infowindow click event that will filter the nearby stores based off the same category/similarities. I suggest passing the info through a json call and storing it somewhere. You can find an example of the database radius query here - http://code.google.com/apis/maps/articles/phpsqlsearch.html#findnearsql. How are you getting the data from your database to your javascript app?

Upvotes: 1

Related Questions