Module: ol/geom/Polygon

ol/geom/Polygon


Classes

Polygon

函数s

circular(center, radius, n, sphereRadius){Polygon}

import {circular} from 'ol/geom/Polygon';

在球面上创建圆的近似多边形。

Name Type Description
center Coordinate

中心([经度, 纬度],单位为度)。

radius number

从圆心到多边形顶点的大圆距离(米)。

n number | undefined

生成多边形可选的顶点数。默认为 32

sphereRadius number | undefined

可选的球体半径(默认为使用 WGS84 椭球体的地球平均半径)。

返回值:
The "circular" polygon.

fromCircle(circle, sides, angle){Polygon}

import {fromCircle} from 'ol/geom/Polygon';

从圆创建正多边形。

Name Type Description
circle Circle

圆形几何对象。

sides number | undefined

多边形的边数。默认为 32。

angle number | undefined

多边形第一个顶点的起始角度(逆时针弧度)。0 表示东方。默认为 0。

返回值:
多边形几何对象。

fromExtent(extent){Polygon}

import {fromExtent} from 'ol/geom/Polygon';

从范围创建多边形。使用的布局为 XY

Name Type Description
extent Extent

范围。

返回值:
多边形。