Commit 494aa191 authored by mahui's avatar mahui

数据更新

parent 1edd46f6
......@@ -1852,7 +1852,7 @@
// self.map.openInfoWindow(infoWindow, coordinate); //开启信息窗口
});
},
getBoundary: function (map, bool, index) {
getBoundary(map, bool, index) {
let self = this;
let bdary = new BMap.Boundary();
bdary.get('临安区', function (rs) {       //获取行政区域       
......@@ -1879,8 +1879,10 @@
map.addOverlay(ply);
}
let marker;
let position='';
for (let item of self.search_data) {
marker = new BMap.Point(item.position.split(',')[0], item.position.split(',')[1]);
position = self.bd_encrypt(item.position.split(',')[0], item.position.split(',')[1]);
marker = new BMap.Point(position.split(',')[0], position.split(',')[1]);
self.mapShow(marker, item, item.type == '横畈' ? 2 : 1);
// if(Array.isArray(item.data)){
// for(let j of item.data){
......@@ -1891,6 +1893,15 @@
// }
}
});
},
bd_encrypt(gg_lng, gg_lat) {
var X_PI = Math.PI * 3000.0 / 180.0;
var x = gg_lng, y = gg_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);
var bd_lng = z * Math.cos(theta) + 0.0065;
var bd_lat = z * Math.sin(theta) + 0.006;
return bd_lng+','+bd_lat;
}
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment