Nicholas-c
Nicholas-c

Reputation: 123

Postcode/Location search - PHP

Sorry for this one but I'm lost. I'm trying to build a search page that uses either a UK Postcode or location to find an airsoft site (Lets call them "stores" so I don't have to explain to those who don't know what airsoft is), every store I have included a column Geo_location_lat & Geo_location_long alongside postcode, county, town/city and address where possible.

However I'm struggling to figure out how I go about taking the user input of "London" or "ST15" convert that to long/lat and search for all stores that fall within "X" radius. I have done a fair bit of googling and one or two scripts that are incomplete or require license.

Seen I can do it via Google API but they all involve markers and so on and I don't require maps etc... Unless I am missing a trick somewhere...

TL;DR - I need a store locator, all "stores' have long/lat stored already however not sure how to do the search.

Upvotes: 1

Views: 1773

Answers (2)

Curtis Mattoon
Curtis Mattoon

Reputation: 4742

Google's API should do the trick for you. You want the geocoding API, not the maps one.

https://developers.google.com/maps/articles/geocodestrat

Upvotes: 0

Alfie
Alfie

Reputation: 2350

Have a look at Ordnance Survey's OpenData API. Code-Point Open looks like it might be good for you: http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/index.html

Upvotes: 2

Related Questions