public static function getBoundsOfPolygons($polygons, $margin = 0.0)
    {
        $coords = [];
        /** @var Polygon $polygon */
        foreach ($polygons as $polygon) {
            if (!($polygon instanceof Polygon)) {
                throw new InvalidParamException('"$polygons" must be an array of "' . Polygon::className() . '" objects');
            }
            // merge LatLng arrays
            $coords = ArrayHelper::merge($coords, $polygon->paths);
        }

        return LatLngBounds::getBoundsOfCoordinates($coords, $margin);
    }