title: Autocomplete polygons while drawing with drawingManager using the Google Maps API v3
body: <p>I have a basic Google Map, with a drawingManager, like this:</p>
  
  <pre><code>var mapOptions = {
      center: centroid,
      zoom: 14,
      scrollwheel: false,
      mapTypeId: google.maps.MapTypeId.HYBRID,
      mapTypeControlOptions: {
          mapTypeIds: [google.maps.MapTypeId.HYBRID, google.maps.MapTypeId.ROADMAP]
      }
  }
  
  var map = new google.maps.Map(document.getElementById("map"), mapOptions);
  
  var drawingManager = new google.maps.drawing.DrawingManager({
      drawingMode: google.maps.drawing.OverlayType.POLYGON,
      drawingControl: false,
  
      polygonOptions: {
          clickable: true,
          draggable: true,
          editable: true,
          fillColor: '#ffff00',
          fillOpacity: 0.8,
          strokeWeight: 5
      }
  });
  
  drawingManager.setMap(map);
  </code></pre>
  
  <p>Drawing polygons on the map works like a charm, except for one little thing. I have to explicitly close my polygon, either by clicking the first point, or by double clicking somewhere (or at least, I can't find another way). But I would like for my polygon to be closed at all times while drawing, a bit like this:</p>
  
  <p><a href="http://www.birdtheme.org/useful/v3tool.html" rel="nofollow">http://www.birdtheme.org/useful/v3tool.html</a></p>
  
  <p>(select 'polygon' in the first select box next to the title).</p>
  
  <p>Now I know this example doesn't use the drawingManager, but creates the polygon by hand, but I am wondering if something similar is possible using the drawingManager. I'm afraid there isn't, since I can't seem to find any reference to it in the manual, but that also kind of surprised about that, since I would think it is something that more people would like to have.</p>