使用yii2-google-map-library从数据库显示多边形


i have problem when i'm trying to show polygon from database using yii2-google-maps-library. i've table tb_wilayah with field (id, label, lat, lng) and then i try to show the polygon on map with this code :

$data = AreaWilayah::find()->all();
    $paths = [];
    foreach ($data as $value){
        $koord = new LatLng([
            'lat' => $value->lat,
            'lng' => $value->lng
        ]);
        array_push($paths, $koord);
    }
    $coords = [$paths];
    $polygon = new Polygon([
        'paths' => $coords
    ]);
    $map->addOverlay($polygon);

unfortunatelly i've error message Argument 1 passed to dosamigos\google\maps\overlays\PolygonOptions::addCoord() must be an instance of dosamigos\google\maps\LatLng, array given, called in C:\xampp\htdocs\project\vendor\2amigos\yii2-google-maps-library\overlays\PolygonOptions.php on line 120 and defined

could someone help me? or if someone could provide a tutorial, that would be a real help.

Thx for the above code. That pointed me in the right direction. This worked for me:

foreach ($ismalls as $mall) {
    $poly_json = json_decode($mall->polygonpoints, true);
    $coords = [];
    //echo print_r($poly_json);
    foreach ($poly_json as $points) {
        $koord = new LatLng([
            'lat' => $points[1],
            'lng' => $points[0]
        ]);
        array_push($coords, $koord);
    }
   $polygon = new Polygon([
        'paths' => $coords
    ]);

    // Add a shared info window
    $polygon->attachInfoWindow(new InfoWindow([
        'content' => '<p>'.$mall->display_name.'</p>'
        ]));

    // Add it now to the map
    $map->addOverlay($polygon);
}