Skip to content

KBE3D / KBCore / turf / square

函数: square()

square(bbox: BBox): BBox

Function

Takes a bounding box and calculates the minimum square bounding box that would contain the input.

参数

bbox

BBox

extent in [west, south, east, north] order

返回

BBox

a square surrounding bbox

示例

ts
const bbox = [-20, -20, -15, 0];
const squared = turf.square(bbox);

//addToMap
const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]

KBE3D @3.0.0 Copyright © 2024-present KBE3D