title: Uncaught InvalidValueError: not an Array
body: <p>I wonder if someone can point me to right direction here, I'm working with Google maps trying to shade assigned Post Code areas to a user, if I hardcode the <strong>latitude</strong> and <strong>longitude</strong> it works perfect like this; </p>
  
  <pre><code>var triangleCoordsLS12 = [
          {lng: -1.558585,  lat: 53.796545}, 
          {lng: -1.558585,  lat: 53.796545},
          .....
  ];
  </code></pre>
  
  <p>but I'm trying to get the information from MySQL database vis PHP and JSON like this;</p>
  
  <pre><code>$.ajax({
            type:'POST',
            url:'test.php',
            success:function(data){
               var resultArray = JSON.parse(data);
                 for (var i=0; i&lt;resultArray.length; i++) {
                    var triangleCoordsLS12 = new google.maps.LatLng(resultArray[i].lat, resultArray[i].lng);
  
            if(location.uname == 'John Smith'){
              bermudaTriangleLS12 = new google.maps.Polygon({
                  paths: triangleCoordsLS12,
                  strokeColor: '#ff0000',
                  strokeOpacity: 0.8,
                  strokeWeight: 1,
                  fillColor: '#ff0000',
                  fillOpacity: 0.30
              });
             bermudaTriangleLS12.setMap(map);
          } else if(location.uname == 'Bruce Brassington'){
               bermudaTriangleLS12 = new google.maps.Polygon({
                 paths: triangleCoordsLS12,
                 strokeColor: '#FFcc00',
                 strokeOpacity: 0.8,
                 strokeWeight: 1,
                 fillColor: '#FFcc00',
                 fillOpacity: 0.25
               });
              bermudaTriangleLS12.setMap(map);                 
          }
        } 
      }
   })  
  </code></pre>
  
  <p>I get an error <code>Uncaught InvalidValueError: not an Array</code> on these lines:-</p>
  
  <pre><code>bermudaTriangleLS12 = new google.maps.Polygon({
  </code></pre>
  
  <p>I know error says not an <code>Array</code> so how do I put the points in array? I'd be very grateful for your help.</p>