work_order/utils/wgs.js

14 lines
340 B
JavaScript
Raw Permalink Normal View History

2024-01-11 19:12:26 +08:00
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;
}
}