坐标转换

Apr 25, 2017

CoordsTransform 坐标转换


一个提供了百度坐标(BD09)、国测局坐标(火星坐标,GCJ02)、和WGS84坐标系之间的转换的工具模块。

当前互联网地图的坐标系现状

地球坐标 (WGS84)

火星坐标 (GCJ-02)也叫国测局坐标系

###百度坐标 (BD-09)

开发过程需要注意的事


示例用法(Example&Usage)

6
1
2
3
4
5
6
7
import CoordsTransform from './CoordsTransform'
let coordsT = new CoordsTransform();
console(coordsT.wgs84togcj02(116.404, 39.915)) // [ 116.41024449916938, 39.91640428150164 ]
console(coordsT.gcj02towgs84(116.404, 39.915)) // [ 116.39775550083061, 39.91359571849836 ]
console(coordsT.gcj02tobd(116.404, 39.915)) // [ 116.41036949371029, 39.92133699351021 ]
console(coordsT.bdtogcj02(116.404, 39.915)) // [ 116.39762729119315, 39.90865673957631 ]