Commit a62b5276 authored by xxx's avatar xxx

修改

parent c595e7fd
......@@ -95,6 +95,10 @@ import smallWindow from './components/smallWindow/index.vue' //小窗口车辆
import mars3dViewerMap from '../../components/mars3d/Map.vue' //地图
import ElectricQuantity from '../../components/electricity/index.vue' //电池组件
let x_PI = 3.14159265358979324 * 3000.0 / 180.0;
let PI = 3.1415926535897932384626;
let a = 6378245.0;
let ee = 0.00669342162296594323;
export default {
components: {
startOrderReceiving,
......@@ -144,7 +148,7 @@ export default {
if(this.equipmentName){
this.getCarLoaction();
}
}, 3000)
}, 2000)
this.zongTimer2 = setInterval(() => {
if(this.carnumber == ''){
return
......@@ -174,14 +178,14 @@ export default {
this.$notify({
title: (item.type == 1 ? "限入" : item.type == 2 ? '限出' : item.type == 4 ? '防碰撞' : '') + (item.areaName == undefined ? '' : item.areaName) + '报警',
type: 'warning',
duration: 10000,
duration: 5000,
dangerouslyUseHTMLString: true,
});
}else if(this.carclass != '铲车'){
this.$notify({
title: (item.type == 1 ? "限入" : item.type == 2 ? '限出' : (item.type == 3 && this.carclass != '铲车') ? '无故停车' : item.type == 4 ? '防碰撞' : '') + (item.areaName == undefined ? '' : item.areaName) + '报警',
type: 'warning',
duration: 10000,
duration: 5000,
dangerouslyUseHTMLString: true,
});
}
......@@ -194,7 +198,7 @@ export default {
}
});
}, 15000)
}, 8000)
},
methods:{
......@@ -276,10 +280,13 @@ export default {
//locationSuccess 获取成功的话
function(position) {
//console.log(position.coords.longitude,position.coords.latitude);
console.log(that.wgs84togcj02(position.coords.longitude, position.coords.latitude));
let LoaObj1 = {};
let LoaObj1xy = {};
LoaObj1xy.x = position.coords.longitude;
LoaObj1xy.y = position.coords.latitude;
// LoaObj1xy.x = that.wgs84togcj02(position.coords.longitude, position.coords.latitude)[0];
// LoaObj1xy.y = that.wgs84togcj02(position.coords.longitude, position.coords.latitude)[1];
LoaObj1.gndRate = '';
LoaObj1.location = LoaObj1xy;
LoaObj1.name = that.equipmentName;
......@@ -300,6 +307,53 @@ export default {
);
}
},
/**
* WGS84转GCj02
* @param lng
* @param lat
* @returns {*[]}
*/
wgs84togcj02(lng, lat) {
if (this.out_of_china(lng, lat)) {
return [lng, lat]
}
else {
let dlat = this.transformlat(lng - 105.0, lat - 35.0);
let dlng = this.transformlng(lng - 105.0, lat - 35.0);
let radlat = lat / 180.0 * PI;
let magic = Math.sin(radlat);
magic = 1 - ee * magic * magic;
let sqrtmagic = Math.sqrt(magic);
dlat = (dlat * 180.0) / ((a * (1 - ee)) / (magic * sqrtmagic) * PI);
dlng = (dlng * 180.0) / (a / sqrtmagic * Math.cos(radlat) * PI);
let mglat = lat + dlat;
let mglng = lng + dlng;
return [mglng, mglat]
}
},
/**
* 判断是否在国内,不在国内则不做偏移
* @param lng
* @param lat
* @returns {boolean}
*/
out_of_china(lng, lat) {
return (lng < 72.004 || lng > 137.8347) || ((lat < 0.8293 || lat > 55.8271) || false);
},
transformlat(lng, lat) {
let ret = -100.0 + 2.0 * lng + 3.0 * lat + 0.2 * lat * lat + 0.1 * lng * lat + 0.2 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lat * PI) + 40.0 * Math.sin(lat / 3.0 * PI)) * 2.0 / 3.0;
ret += (160.0 * Math.sin(lat / 12.0 * PI) + 320 * Math.sin(lat * PI / 30.0)) * 2.0 / 3.0;
return ret
},
transformlng(lng, lat) {
let ret = 300.0 + lng + 2.0 * lat + 0.1 * lng * lng + 0.1 * lng * lat + 0.1 * Math.sqrt(Math.abs(lng));
ret += (20.0 * Math.sin(6.0 * lng * PI) + 20.0 * Math.sin(2.0 * lng * PI)) * 2.0 / 3.0;
ret += (20.0 * Math.sin(lng * PI) + 40.0 * Math.sin(lng / 3.0 * PI)) * 2.0 / 3.0;
ret += (150.0 * Math.sin(lng / 12.0 * PI) + 300.0 * Math.sin(lng / 30.0 * PI)) * 2.0 / 3.0;
return ret
},
//接受派单
IntelligentDisFn(){
if(this.orderReceiving){
......
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