Ok I have a database with about 1800 rows, each has a column lat
and long
, what I am trying to do, it query against Google Maps V3 .getBounds
The result is something like ((33.564398518424134, -79.38014701875002), (35.375726155241175, -76.08424858125002))
What I want to do, is get every record whose lat & lng in the database is within those bounds. Any suggestions?
Im thinking I would have to extrapolate the other 2 corners of the map, since .getBounds
only contains 2 points (2 corners of the map I suppose), and I would want to be within 4 points. If I did that I would end up with an array something like...Now correct me if I am wrong but this should be NW, NE, SW, SE corners of the map, in lat-lng.
33.564398518424134, -79.38014701875002
33.564398518424134, -76.08424858125002
35.375726155241175, -79.38014701875002
35.375726155241175, -76.08424858125002
Ok, so If I have this data, how would I build a query to get the rows that are within these coordinates? Table is called tilistings
- columns are lat
and lng
...also if there is an easier way, or I am just crazy with my methodology, please feel free to let me know.
Thanks