title: Best fixed rectangular area fit over points
body: <p>I'm using Google Maps and I'm trying to work out the maximum number of points visible in the viewport at a given zoom level.</p>
  
  <p>My naive approach is to get the viewing area (in coordinates) and use that as a "fitting rectangle" and see how many points fit in the area.
  I had a look around but I couldn't find any algorithm for "best fit" of random points in a rectangular area. </p>
  
  <p>It seems a quite common problem so I probably don't know the right keywords to use.</p>
  
  <p>Any help in getting me to a solution would be appreciated.</p>
  
  <p><strong>EDIT:</strong> thanks for the answers but I'm afraid I didn't make myself clear. Fitting a rectangle over ALL the points is pretty much a trivial affair (sort them all, get the min/max and voilà).<br>
  What I want to know is the maximum number of points that can be fit under a FIXED SIZED rectangle: I've got all my points and a "moving window" of fixed size and I want to know how many points I can fit in.<br>
  Sorry for the bad initial explanation.</p>
  
  <p>Cheers.</p>