title: How to get Latitude and Longitude Bounds from Google Maps x y and zoom parameters
body: <p>I have seen some questions with similar titles, but they seem to be referring to <code>x</code> and <code>y</code> pixel coordinates.  </p>
  
  <p>I am asking about the actual tile numbers of <code>x</code> and <code>y</code> from Google Maps <code>getTile()</code> function:</p>
  
  <p>To clarify the question...</p>
  
  <p>Given the x, y, and zoom parameters in the getTile() function, how can I find the latitude and longitude bounds of the tile?</p>
  
  <pre><code>CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
  
      var x = coord.x,
      y = coord.y,
      url = "http://mt1.google.com/vt/lyrs=y&amp;x="+x+"&amp;y="+y+"&amp;z="+zoom;
      //other stuff   
  }
  </code></pre>
  
  <p>The only reason at the moment that I need this is that I want to determine the maximum zoom level at this tile projection.  From this link: <a href="https://developers.google.com/maps/documentation/javascript/maxzoom" rel="noreferrer">Maximum Zoom</a>, it states that in order to find the maximum zoom, I will need a latitude and longitude value using <code>getMaxZoomAtLatLng()</code>.  So if I can get the bounds, then I can use any latitude and longitude points within the bounds to find my max Zoom.</p>
  
  <p>Alternatives I have thought of were creating an image and checking if the src url had an error (this seems like a terrible idea to me, as I would be making many bad requests just to check if imagery existed).</p>
  
  <pre><code>var img = new Image;
  img.onload = function() {/*imagery exists*/ }
  img.onerror = function() {/*past maximum zoom*/ }
  img.src = url;
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>After further investigation, I realize that the <code>getMaxZoomAtLatLng()</code> function is using an ajax call which will not fit into my plans.  But I still am interested in how to find the latitude and longitude boundaries of a given tile ( that could be useful for other applications ).</p>