Skip to content

描述 ​

接收任意数量的要素,返回一个包含所有顶点的矩形 Polygon。

参数 ​

名称类型描述
geojsonGeoJSON输入要素

返回值 ​

Feature<Polygon> 包含所有顶点的矩形 Polygon 要素

示例 ​

javascript
var features = turf.featureCollection([
  turf.point([-75.343, 39.984], { name: "Location A" }),
  turf.point([-75.833, 39.284], { name: "Location B" }),
  turf.point([-75.534, 39.123], { name: "Location C" }),
]);

var enveloped = turf.envelope(features);

安装 ​

javascript
$ npm install @turf/envelope

import { envelope } from "@turf/envelope";
const result = envelope(...);
javascript
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.envelope(...);