0

In my web application I have a list of businesses/clients and their information, including their address. I'd like to mark one of them, then get the other businesses/clients that are in a X km radius.

I'd prefer to control the X with a slider, and I'd prefer to display the results on a map as well, but neither point is crucial. How should I go about this? Would Google Maps be a good tool? Where can I find more information, or an example of this?

4 Answers4

1

Google Maps API should work well for this.

In fact combine it with Fusion tables, is even better. FT will host your database, and make making 'spatial' queries against your data easy (ie results within X of Y). FT is even intergrated with the Maps API to display the results of your query direct on the map.

barryhunter
  • 20,886
  • 3
  • 30
  • 43
0

If you want to use an Open Source Javascript library with possibly a bit more flexibility than google maps' API, use OpenLayers - and if you dont want to have to pay the new Google Maps API fees, you can use OpenStreetMap for your background layers. Make your slider with something like jQuery UI or Dojo and link them with some event handling. Job done.

What's your back end application written in? There's assorted geospatial libraries that make spatial queries nice n easy in most languages. A bit of googling should bring them up. I doubt you'll need to go for a full spatial database, but if you do then check out PostGIS - that can do stuff like find all the businesses within Xkm of a major road (once you've got all the data into it of course!).

www.osgeo.org is the best start for open source geospatial software. Lots of web, database, and desktop tools there.

Spacedman
  • 92,590
  • 12
  • 140
  • 224
0

Google Maps doesn't support a local search. It provide only an API to find and set marker and get a direction. It has some beautiful maps, too. What you want is the harvesine formula to look for close targets. Alernatively you can use a spatial extension and search for tiles or cluster of targets. It's just an approximation. I don't thin that FT support the former or the latter. It's just a Sqlite-alike database to store your markers.

Micromega
  • 12,486
  • 7
  • 35
  • 72
0

Try mysql spatial extensions.If you cannot implement Radius Query which i think you cannot consider strongly to switch to postgresql+postgis.Once you migrate this problem will be solved in 5 minutes.

Also for a custom solution take a look at this answer

Cheers

Community
  • 1
  • 1
Argiropoulos Stavros
  • 9,436
  • 11
  • 61
  • 79