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);
    }
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);
    }
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 ) ; }
Returns the boundaries of an array of Polygon objects
@param Polygon[] $polygons array of Polygons
@param float $margin margin factor for the bounds
@throws \yii\base\InvalidParamException
@return LatLngBounds
Returns the boundaries of an array of Polygon objects