function WGS84ToMercator(lonlat){ const coord = { lat:0, lng:0 }; const earthRad = 6378137.0; //地球半径 coord.lat = lonlat.lng * Math.PI / 180 * earthRad; const param = lonlat.lat * Math.PI / 180; coord.lng = earthRad / 2 * Math.log((1.0 + Math.sin(param)) / (1.0 - Math.sin(param))); return coord; }
标签:coord,4326,3857,lonlat,坐标,lng,param,Math,earthRad From: https://www.cnblogs.com/zmh-980509/p/16635948.html