How to create a Polygons Array?

0

I get several polygon arrays, each polygon has its latlng and information like ID, TYPE, and so on.

How do I create these polygons on the map? I already tried to use the for but it is giving error, saying that it is not an array.

for(let i in this.polygonOBJ){
    let polygon = new google.maps.MVCArray();
    polygon[i] =
        this.polygonOBJ[i] = new google.maps.Polygon({
            id: this.polygonOBJ[i].shapeUid,
            type: this.polygonOBJ[i].shapeType,
            dateCreate: this.polygonOBJ[i].shapeDates,
            map: GoogleMaps.MapObj,
            paths: new google.maps.LatLng({ lat: -15, lng: -1 }),
            visible: true,
            strokeColor: '#FF0000',
            strokeOpacity: 0.8,
            strokeWeight: 2,
            fillColor: '#FF0000',
            fillOpacity: 0.35
        });
}
    
asked by anonymous 01.02.2018 / 14:00

0 answers