title: Search a rectangle on googlemaps
body: <p>We have <code>Locations</code> data in Sql server database. Four points (<code>bounding rectangle</code>) are defined for each <code>Location</code>. Four points are <code>Bottom Latitude, Top Latitude, Left Longitude, Right Longitude</code>. If googlemaps falls within any area of the bounding rectangle, a marker will be plotted for that location.</p>
  
  <p>We have some other locations in the database for which we have stored only <code>Lat Lng</code> and we are searching them using below query and it works!</p>
  
  <pre><code>SELECT   *
  FROM     SomeOtherLocationsTable
  WHERE    LocationLatitude &gt;= @bottomlat  AND
           LocationLatitude &lt;= @toplat AND
           LocationLongitue &gt;= @leftlang AND
           LocationLongitue &lt;= @rightlng
  </code></pre>
  
  <p>How we can search locations having four points defined for them?</p>