Skip to content

KBE3D / KBCore / turf / bbox

函数: bbox()

bbox(geojson: AllGeoJSON, options?: { recompute?: boolean; }): BBox

Function

Calculates the bounding box for any GeoJSON object, including FeatureCollection. Uses geojson.bbox if available and options.recompute is not set.

参数

geojson

AllGeoJSON

any GeoJSON object

options?

Optional parameters

recompute?

boolean

Whether to ignore an existing bbox property on geojson

返回

BBox

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

示例

ts
var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
var bbox = turf.bbox(line);
var bboxPolygon = turf.bboxPolygon(bbox);

//addToMap
var addToMap = [line, bboxPolygon]

KBE3D @3.0.0 Copyright © 2024-present KBE3D