This is a mySQL approach. It assumes you know all of the coordinates nearby and are in your data..
I've done something similar with a selling houses app, ordering by distance from a given point, place this in your SQL select statement:
((ACOS(SIN(' . **$search_location['lat']** . ' * PI() / 180) * SIN(**map_lat** * PI() / 180) + COS(' . **$search_location['lat']** . ' * PI() / 180) * COS(**map_lat** * PI() / 180) * COS((' . **$search_location['lng']** . ' - **map_lng**) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS "distance"
Replace $search_location with your relevant lat/lng values and the map_lat/map_lng values are the SQL columns which contain the lat/lng values. You can then order the results by distance and either use a where or having clause to filter our properties within a 50km range.
On Wed, Mar 15, 2017 at 12:23 AM, < mbsoftwaresolutions@mbsoftwaresolutions.com> wrote:
(to be done in VFP9SP2 existing app)
Customer need: to grab/query towns near a certain zip code or city name, akin to like when you use an app where you're looking for a car and say "show me matches within 50 miles." I'm thinking latitude/longitude and google somehow, but I thought I'd poll the community to see what you'd recommend.
Thanks! --Mike
[excessive quoting removed by server]