public static Map bd_encrypt(double gg_lat, double gg_lon) {
double x = gg_lon, y = gg_lat;
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * Math.PI);
double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * Math.PI);
double bd_lon = z * Math.cos(theta) + 0.0065;
double bd_lat = z * Math.sin(theta) + 0.006;
Map map = new HashMap();
map.put("bd_lon", bd_lon);
map.put("bd_lat", bd_lat);
return map;
}
本文介绍了一种将GPS坐标转换为百度地图坐标的方法。通过数学公式实现经纬度的转换,便于在百度地图上准确标注位置。

被折叠的 条评论
为什么被折叠?



