title: Google Maps API v3: Getting geometry of a drawn shape
body: <p>I'm currently working with the Google Maps API v3.13. I have come to a halt in my coding though and the documentation doesn't really help me anymore.</p>
  
  <p>What I have done is that I've implemented the DrawingLibrary and I can draw shapes on the map. What I would like to do when I've finished drawing something, is to get the bounding box/corners of the shape that was drawn (I have only activated polyline and rectangle).</p>
  
  <p>I then want to use this area to see if any markers are within it, and then make them "bouncy" or something similar. So my question is, how do I get the area that the user drew? In which format is this data? Coordinates for each corner? Do I have to combine the functionality of the DrawingLibrary with the GeometryLibrary to do this?</p>
  
  <p>I have checked these documentations but still haven't been able to find a solution.
  <a href="https://developers.google.com/maps/documentation/javascript/geometry" rel="nofollow">https://developers.google.com/maps/documentation/javascript/geometry</a>
  <a href="https://developers.google.com/maps/documentation/javascript/drawing" rel="nofollow">https://developers.google.com/maps/documentation/javascript/drawing</a></p>
  
  <p>This is what I have so far:</p>
  
  <pre><code>function bindOverlayFinishedEvents() {
  google.maps.event.addListener(drawingManager, 'overlaycomplete', function(event) {
      if (event.type == google.maps.drawing.OverlayType.POLYGON) {
          //bounds = event.overlay.getBounds();
      }
      else if (event.type == google.maps.drawing.OverlayType.RECTANGLE) {
          //bounds = event.overlay.getBounds();
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>Any help would be greatly appreciated!</p>