Functions
-
applyTransform(extent, transformFn, dest, stops){Extent}
extent.js, line 877 -
import {applyTransform} from 'ol/extent';Apply a transform function to the extent.
Name Type Description extentExtent Extent.
transformFnTransformFunction Transform function. Called with
[minX, minY, maxX, maxY]extent coordinates.destExtent | undefined Destination extent.
stopsnumber | undefined Number of stops per side used for the transform. By default only the corners are used.
Returns:
Extent.
-
boundingExtent(coordinates){Extent}
extent.js, line 24 -
import {boundingExtent} from 'ol/extent';Build an extent that includes all given coordinates.
Name Type Description coordinatesArray<Coordinate> Coordinates.
Returns:
Bounding extent.
-
buffer(extent, value, dest){Extent}
extent.js, line 55 -
import {buffer} from 'ol/extent';Return extent increased by the provided value.
Name Type Description extentExtent Extent.
valuenumber The amount by which the extent should be buffered.
destExtent | undefined Extent.
Returns:
Extent.
-
containsCoordinate(extent, coordinate){boolean}
extent.js, line 122 -
import {containsCoordinate} from 'ol/extent';Check if the passed coordinate is contained or on the edge of the extent.
Name Type Description extentExtent Extent.
coordinateCoordinate Coordinate.
Returns:
The coordinate is contained in the extent.
-
containsExtent(extent1, extent2){boolean}
extent.js, line 138 -
import {containsExtent} from 'ol/extent';Check if one extent contains another.
An extent is deemed contained if it lies completely within the other extent, including if they share one or more edges.
Name Type Description extent1Extent Extent 1.
extent2Extent Extent 2.
Returns:
The second extent is contained by or on the edge of the first.
-
containsXY(extent, x, y){boolean}
extent.js, line 156 -
import {containsXY} from 'ol/extent';Check if the passed coordinate is contained or on the edge of the extent.
Name Type Description extentExtent Extent.
xnumber X coordinate.
ynumber Y coordinate.
Returns:
The x, y values are contained in the extent.
-
createEmpty(){Extent}
extent.js, line 196 -
import {createEmpty} from 'ol/extent';Create an empty extent.
Returns:
Empty extent.
-
equals(extent1, extent2){boolean}
extent.js, line 286 -
import {equals} from 'ol/extent';Determine if two extents are equivalent.
Name Type Description extent1Extent Extent 1.
extent2Extent Extent 2.
Returns:
The two extents are equivalent.
-
extend(extent1, extent2){Extent}
extent.js, line 318 -
import {extend} from 'ol/extent';Modify an extent to include another extent.
Name Type Description extent1Extent The extent to be modified.
extent2Extent The extent that will be included in the first.
Returns:
A reference to the first (extended) extent.
-
getArea(extent){number}
extent.js, line 446 -
import {getArea} from 'ol/extent';Get the size of an extent.
Name Type Description extentExtent Extent.
Returns:
Area.
-
getBottomLeft(extent){Coordinate}
extent.js, line 460 -
import {getBottomLeft} from 'ol/extent';Get the bottom left coordinate of an extent.
Name Type Description extentExtent Extent.
Returns:
Bottom left coordinate.
-
getBottomRight(extent){Coordinate}
extent.js, line 470 -
import {getBottomRight} from 'ol/extent';Get the bottom right coordinate of an extent.
Name Type Description extentExtent Extent.
Returns:
Bottom right coordinate.
-
getCenter(extent){Coordinate}
extent.js, line 480 -
import {getCenter} from 'ol/extent';Get the center coordinate of an extent.
Name Type Description extentExtent Extent.
Returns:
Center.
-
getDifference(extent1, extent2){Array<Extent>}
extent.js, line 663 -
import {getDifference} from 'ol/extent';Get the difference between two extents, i.e. the area(s) of
extent1that are not covered byextent2. Returns an array of between 0 and 4 extents.When the extents do not intersect the returned array contains
extent1as its only element. Whenextent2completely containsextent1the returned array is empty. Otherwise up to four non-overlapping extents are returned that together cover exactly the parts ofextent1outsideextent2.The decomposition used is:
┌────┬─────────┬────┐ ← y2 │ │ top │ │ │ ├─────────┤ │ ← iy2 │left│ (gone) │right│ │ ├─────────┤ │ ← iy1 │ │ bottom │ │ └────┴─────────┴────┘ ← y1 x1 ix1 ix2 x2The left and right strips span the full height of
extent1while the top and bottom strips are clamped horizontally to the intersection, so the four rectangles tile perfectly without overlap or gaps.Name Type Description extent1Extent Extent to subtract from.
extent2Extent Extent to subtract.
Returns:
Remaining extents (0–4 elements).
-
getHeight(extent){number}
extent.js, line 581 -
import {getHeight} from 'ol/extent';Get the height of an extent.
Name Type Description extentExtent Extent.
Returns:
Height.
-
getIntersection(extent1, extent2, dest){Extent}
extent.js, line 603 -
import {getIntersection} from 'ol/extent';Get the intersection of two extents.
Name Type Description extent1Extent Extent 1.
extent2Extent Extent 2.
destExtent | undefined Optional extent to populate with intersection.
Returns:
Intersecting extent.
-
getSize(extent){Size}
extent.js, line 713 -
import {getSize} from 'ol/extent';Get the size (width, height) of an extent.
Name Type Description extentExtent The extent.
Returns:
The extent size.
-
getTopLeft(extent){Coordinate}
extent.js, line 723 -
import {getTopLeft} from 'ol/extent';Get the top left coordinate of an extent.
Name Type Description extentExtent Extent.
Returns:
Top left coordinate.
-
getTopRight(extent){Coordinate}
extent.js, line 733 -
import {getTopRight} from 'ol/extent';Get the top right coordinate of an extent.
Name Type Description extentExtent Extent.
Returns:
Top right coordinate.
-
getWidth(extent){number}
extent.js, line 743 -
import {getWidth} from 'ol/extent';Get the width of an extent.
Name Type Description extentExtent Extent.
Returns:
Width.
-
intersects(extent1, extent2){boolean}
extent.js, line 754 -
import {intersects} from 'ol/extent';Determine if one extent intersects another.
Name Type Description extent1Extent Extent 1.
extent2Extent Extent.
Returns:
The two extents intersect.
-
isEmpty(extent){boolean}
extent.js, line 769 -
import {isEmpty} from 'ol/extent';Determine if an extent is empty.
Name Type Description extentExtent Extent.
Returns:
Is empty.
Type Definitions
-
Corner{'bottom-left'} {'bottom-right'} {'top-left'} {'top-right'}
-
Extent corner.
-
Extent{Array.<number>}
-
An array of numbers representing an extent:
[minx, miny, maxx, maxy].