Namespace: limit

FlatView.limit

Factory functions for view limiters. See FlatViewLimiter.

Methods

(static) letterbox() → {FlatViewLimiter}

Returns a view limiter that constrains the zoom parameter such that zooming out is prevented beyond the point at which the image is fully visible. Unless the image and the viewport have the same aspect ratio, this will cause bands to appear around the image.

Returns:
Type
FlatViewLimiter

(static) resolution(size) → {FlatViewLimiter}

Returns a view limiter that prevents zooming in beyond the given resolution.

Parameters:
Name Type Description
size number

The image width in pixels.

Returns:
Type
FlatViewLimiter

(static) visibleX(min, max) → {FlatViewLimiter}

Returns a view limiter that constrains the values of the x parameter that are inside the viewport.

Parameters:
Name Type Description
min number

The minimum x value.

max number

The maximum x value.

Returns:
Type
FlatViewLimiter

(static) visibleY(min, max) → {FlatViewLimiter}

Returns a view limiter that constrains the values of the y parameter that are inside the viewport.

Parameters:
Name Type Description
min number

The minimum y value.

max number

The maximum y value.

Returns:
Type
FlatViewLimiter

(static) x(min, max) → {FlatViewLimiter}

Returns a view limiter that constrains the x parameter.

Parameters:
Name Type Description
min number

The minimum x value.

max number

The maximum y value.

Returns:
Type
FlatViewLimiter

(static) y(min, max) → {FlatViewLimiter}

Return a view limiter that constrains the y parameter.

Parameters:
Name Type Description
min number

The minimum y value.

max number

The maximum y value.

Returns:
Type
FlatViewLimiter

(static) zoom(min, max) → {FlatViewLimiter}

Returns a view limiter than constrains the zoom parameter.

Parameters:
Name Type Description
min number

The minimum zoom value.

max number

The maximum zoom value.

Returns:
Type
FlatViewLimiter