I have the North, East, South and West values of a Rectangular location, how can I search only those locations (Latitude/Longitude) that are within the bounds of that Rectangular location?
Please note that I need to search the Locations (Latitude/Longitude) within a database. I need to find the locations in the database which are in the bounds of a given rectangular and I will draw markers for them on the map.
I am not talking about Google search, the APIs for search already support passing the rectangular bound to filter the search.
The googlemaps
APIs can do this for me like:
var request = {
bounds: myMapObject.getBounds(), // Search only within the Bound of the Map
query: someTextToFind
};
OR
var isWithInMapsBounds = myMapObject.getBounds().contains(myLocation);
But I need to do it while getting the locations from database, I mean on Server side.
Can someone guide me in the right direction, how to achieve this functionality?
EDIT:
I want to search within database; so I need an SQL solution.