Skip to content

KBE3D / KBCore / turf / bboxPolygon

函数: bboxPolygon()

bboxPolygon<P>(bbox: BBox, options?: { properties?: P; id?: Id; }): Feature<Polygon, P>

Function

Takes a bbox and returns an equivalent polygon.

类型参数

P

P extends GeoJsonProperties = GeoJsonProperties

参数

bbox

BBox

extent in [minX, minY, maxX, maxY] order

options?

Optional parameters

properties?

P

Translate properties to Polygon

id?

Id

Translate Id to Polygon

返回

Feature<Polygon, P>

a Polygon representation of the bounding box

示例

ts
var bbox = [0, 0, 10, 10];

var poly = turf.bboxPolygon(bbox);

//addToMap
var addToMap = [poly]

KBE3D @3.0.0 Copyright © 2024-present KBE3D