标签:
//高德、谷歌转百度 locs[0]:lat locs[1]:lng function gd_bd(lng, lat) { var x =lng, y =lat; var z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi); var theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi); locs.push( z * Math.cos(theta) + 0.0065); locs.push( z * Math.sin(theta) + 0.006); return locs; } //百度转谷歌 百度转火星坐标 locs[0]:lat locs[1]:lng function bd_gg(lng, lat) { var x = lng - 0.0065, y = lat - 0.006; var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi); var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi); var locs = []; locs.push(z * Math.sin(theta)); locs.push(z * Math.cos(theta)); return locs; }
标签:
原文地址:http://www.cnblogs.com/fj99/p/5684928.html