Module: ol/extent

ol/extent


import * as olExtent from 'ol/extent';

函数s

applyTransform(extent, transformFn, dest, stops){Extent}

import {applyTransform} from 'ol/extent';

对范围应用变换函数。

Name Type Description
extent Extent

范围。

transformFn Transform函数

变换函数。 以 [minX, minY, maxX, maxY] 范围坐标作为参数调用。

dest Extent | undefined

目标范围。

stops number | undefined

变换时每边使用的采样点数。 默认仅使用角点。

返回值:
范围。

boundingExtent(coordinates){Extent}

import {boundingExtent} from 'ol/extent';

构建包含所有给定坐标的范围。

Name Type Description
coordinates Array<Coordinate>

坐标。

返回值:
Bounding extent.

buffer(extent, value, dest){Extent}

import {buffer} from 'ol/extent';

返回按提供值扩展后的范围。

Name Type Description
extent Extent

范围。

value number

范围的缓冲量。

dest Extent | undefined

范围。

返回值:
范围。

containsCoordinate(extent, coordinate){boolean}

import {containsCoordinate} from 'ol/extent';

检查传入的坐标是否包含在范围内或位于范围边界上。

Name Type Description
extent Extent

范围。

coordinate Coordinate

坐标。

返回值:
The coordinate is contained in the extent.

containsExtent(extent1, extent2){boolean}

import {containsExtent} from 'ol/extent';

检查一个范围是否包含另一个范围。

如果一个范围完全位于另一个范围内,包括共享一条或多条边的情况,则被视为包含。

Name Type Description
extent1 Extent

范围 1。

extent2 Extent

范围 2。

返回值:
The second extent is contained by or on the edge of the first.

containsXY(extent, x, y){boolean}

import {containsXY} from 'ol/extent';

检查传入的坐标是否包含在范围内或位于范围边界上。

Name Type Description
extent Extent

范围。

x number

X 坐标。

y number

Y 坐标。

返回值:
The x, y values are contained in the extent.

createEmpty(){Extent}

import {createEmpty} from 'ol/extent';

创建空范围。

返回值:
Empty extent.

equals(extent1, extent2){boolean}

import {equals} from 'ol/extent';

判断两个范围是否等价。

Name Type Description
extent1 Extent

范围 1。

extent2 Extent

范围 2。

返回值:
The two extents are equivalent.

extend(extent1, extent2){Extent}

import {extend} from 'ol/extent';

修改范围以包含另一个范围。

Name Type Description
extent1 Extent

要修改的范围。

extent2 Extent

将被包含在第一个范围中的范围。

返回值:
A reference to the first (extended) extent.

getArea(extent){number}

import {getArea} from 'ol/extent';

获取范围的面积。

Name Type Description
extent Extent

范围。

返回值:
Area.

getBottomLeft(extent){Coordinate}

import {getBottomLeft} from 'ol/extent';

获取范围的左下角坐标。

Name Type Description
extent Extent

范围。

返回值:
Bottom left coordinate.

getBottomRight(extent){Coordinate}

import {getBottomRight} from 'ol/extent';

获取范围的右下角坐标。

Name Type Description
extent Extent

范围。

返回值:
Bottom right coordinate.

getCenter(extent){Coordinate}

import {getCenter} from 'ol/extent';

获取范围的中心坐标。

Name Type Description
extent Extent

范围。

返回值:
中心。

getHeight(extent){number}

import {getHeight} from 'ol/extent';

获取范围的高度。

Name Type Description
extent Extent

范围。

返回值:
Height.

getIntersection(extent1, extent2, dest){Extent}

import {getIntersection} from 'ol/extent';

获取两个范围的交集。

Name Type Description
extent1 Extent

范围 1。

extent2 Extent

范围 2。

dest Extent | undefined

可选的用于填充交集的范围。

返回值:
Intersecting extent.

getSize(extent){Size}

import {getSize} from 'ol/extent';

获取范围的尺寸(宽度,高度)。

Name Type Description
extent Extent

范围。

返回值:
The extent size.

getTopLeft(extent){Coordinate}

import {getTopLeft} from 'ol/extent';

获取范围的左上角坐标。

Name Type Description
extent Extent

范围。

返回值:
Top left coordinate.

getTopRight(extent){Coordinate}

import {getTopRight} from 'ol/extent';

获取范围的右上角坐标。

Name Type Description
extent Extent

范围。

返回值:
Top right coordinate.

getWidth(extent){number}

import {getWidth} from 'ol/extent';

获取范围的宽度。

Name Type Description
extent Extent

范围。

返回值:
宽度。

intersects(extent1, extent2){boolean}

import {intersects} from 'ol/extent';

判断一个范围是否与另一个范围相交。

Name Type Description
extent1 Extent

范围 1。

extent2 Extent

范围。

返回值:
The two extents intersect.

isEmpty(extent){boolean}

import {isEmpty} from 'ol/extent';

判断范围是否为空。

Name Type Description
extent Extent

范围。

返回值:
Is empty.

Type Definitions

Corner{'bottom-left'} {'bottom-right'} {'top-left'} {'top-right'}

范围角。

Extent{Array.<number>}

表示范围的数字数组:[minx, miny, maxx, maxy]