title: Can't save polygon in google maps
body: <p>I have a google maps polygon object:</p>
  
  <pre><code>var poly = new google.maps.Polygon({
    paths: [
      new google.maps.LatLng(25.774252, -80.190262),
      new google.maps.LatLng(18.466465, -66.118292),
      new google.maps.LatLng(32.321384, -64.75737)
    ]
  });
  </code></pre>
  
  <p>I'm trying to send it to MySQL db via jquery's AJAX:</p>
  
  <pre><code>$.post("savePolygon.php", {polygon: poly});
  </code></pre>
  
  <p>I get this error in console: </p>
  
  <pre><code>TypeError: Cannot call method 'lat' of undefined
  </code></pre>
  
  <p>I've seen some other posts about saving polygons, and they all say to extract the latLng's from the poly's and save them in a db. When I do this though:</p>
  
  <pre><code>var latLngs = poly.getPath().getArray();
  $.post("savePolygon.php", {polygon: latLngs});
  </code></pre>
  
  <p>I get the same error. It seems there is a function in array's prototype called 'lat'. I'd like to know how exactly can I extract those values and send them via AJAX, and also why do I get this error?</p>