toMercator
描述
¥Description
将 WGS84 GeoJSON 对象转换为墨卡托 (EPSG:900913) 投影
¥Converts a WGS84 GeoJSON object into Mercator (EPSG:900913) projection
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
geojson | GeoJSON | 位置 | WGS84 GeoJSON 对象 |
options? | 对象 | 可选参数(默认 {}) |
options.mutate? | boolean | 允许 GeoJSON 输入发生修改(如果为 true,则性能显著提升)(默认为 false) |
返回
¥Returns
GeoJSON 投影 GeoJSON
¥GeoJSON Projected GeoJSON
示例
¥Examples
var pt = turf.point([-71, 41]);
var converted = turf.toMercator(pt);
安装
¥Installation
$ npm install @turf/projection
import { toMercator } from "@turf/projection";
const result = toMercator(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.toMercator(...);