weipengfei eccdb7bc24 更新
2024-02-19 18:00:04 +08:00

14 lines
340 B
JavaScript

const util = require('./WSCoordinate.js')
export const wgsToGcj = (data)=>{
try{
let d = data;
//将WGS-84(国际标准)转为GCJ-02(火星坐标)
let e = util.transformFromWGSToGCJ(data.latitude, data.longitude);
d.latitude = e.latitude;
d.longitude = e.longitude;
return d;
}catch(e){
return data;
}
}