title: How can I display this polygon on a Google Map?
body: <p>I have some MultiPolygon data (the USA state of California) which I'm trying to display on a Google Map (v3 JavaScript API).</p>
  <p>So I've tried to make it into some JSON data, and then display that MultiPolygon on a Google Map. It hangs and doesn't work.</p>
  <p>Here's the jQuery I've used:</p>
  <pre><code>function getTestData() {
      // Grab the California state data.
      var request = $.getJSON(&quot;/Foo/Bar?format=json&quot;, function (results) {
              // map it.
              var polygon = createGeoJsonPolygon(results, &quot;#FF7800&quot;, &quot;#46461F&quot;);
              polygon.setMap(map);
      });
  }
  
  function createGeoJsonPolygon(geojson, strokeColour, fillColour) {
      var coords = geojson.coordinates; // Array of polygons.
      var paths = [];
     
      $.each(coords, function (i, n) {
          $.each(n, function (j, o) {
              var path = [];
              $.each(o, function (k, p) {
                  var ll = new google.maps.LatLng(p[1], p[0]);
                  path.push(ll);
              });
              paths.push(path);
          });
      });
  
      return new google.maps.Polygon({
          paths: paths,
          strokeColor: strokeColour,
          strokeOpacity: 1,
          strokeWeight: 2,
          fillColor: fillColour,
          fillOpacity: 0.25
      });
  }
  </code></pre>
  <p>How can I draw my sample data on a Google Map? I'm not sure if my code is wrong or the data has been extracted incorrectly.</p>