php - Searching record within latitude and longitude range -
Hello I'm using this map
I get latitude I can and I can get distance (radius) longitude of the required place. So I have a database in which each of my records has latitude and longitude. I want to find the record within the selected range on the map. How will SQL query work?
For better details, each of my records has a latitude and longitude User will select the map and I want to find the records in the selected category.
The way I always need you to draw a circle with the necessary circle Use the Maps API, find the long range of latitude of this circle and then ask the database:
SELECT * yourtable where between C and Leng between A and B and D < / Pre> Where A and B are the top coordinates and C and D are right below you.
Now when you have all the objects within your bounding box, you have to pass them back to your front end and determine whether they are in your radius or not. .
Comments
Post a Comment