title: Getting a GeoJSON from a Google Maps drawing manager polygon
body: <p>I'm building a React app which allows users to define plots through a Google Maps component by drawing overlay polygons. I'd like to push a GeoJSON up every time that the user draws a polygon. </p>
  
  <p>The documentation is vague on this point. I'm using this sort of function:</p>
  
  <pre><code>onPolygonComplete={polygon =&gt; {
                  console.log(JSON.stringify(polygon.getPaths().b[0].b));
              }}
  </code></pre>
  
  <p>...which produces this sort of thing:</p>
  
  <pre><code>[{"lat":32.22020791674245,"lng":35.22491455078125},{"lat":31.98754909816049,"lng":35.20294189453125},{"lat":32.0201569982896,"lng":35.43365478515625},{"lat":32.22485504316297,"lng":35.30731201171875}]
  </code></pre>
  
  <p>A good start-but is there anything built in that will produce an actual GeoJSON? </p>
  
  <p>I can always use .map to go through this array and vivsect an GeoJSON object out of it...but wanted to ask if anyone knew of something already baked into the API.</p>