public static function getCenterOfCoordinates($coords)
    {
        $cnt = count($coords);
        if ($cnt == 0) {
            return null;
        }

        $centerLat = $centerLng = 0;

        foreach ($coords as $coord) {
            if (!($coord instanceof LatLng)) {
                throw new InvalidParamException('$coord must be an array of "' . self::className() . '" objects');
            }
            $centerLat += $coord->getLat();
            $centerLng += $coord->getLng();
        }

        return new self([
            'lat' => ($centerLat / $cnt),
            'lng' => ($centerLng / $cnt)
        ]);
    }