From eaa83986e35d478bdfef55b49941fc6b4b86d95e Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Fri, 13 Aug 2021 09:46:23 +0800
Subject: [PATCH] 地图及部分配置修改
---
mapWz/js/vueMain.js | 37 +++++++++++++------------------------
1 files changed, 13 insertions(+), 24 deletions(-)
diff --git a/mapWz/js/vueMain.js b/mapWz/js/vueMain.js
index ea6babe..0385bd7 100644
--- a/mapWz/js/vueMain.js
+++ b/mapWz/js/vueMain.js
@@ -25,7 +25,7 @@
resultFeedbackPopupShow: false,
popupDisplay: "none",
userId: null,
-
+ geolocation: null
},
methods: {
@@ -44,7 +44,7 @@
resultData.push(item)
}
})
- }
+ }
this.map = this.beginMap(this.map, resultData); //创建并接受map
this.move = new myDomMove('#seedata', '.title', '#map');
@@ -62,7 +62,8 @@
return null;
},
beginMap(map, data) {
- var that = this, center = [28.708432053474827, 115.85883507433789];
+ var that = this,
+ center = [28.708432053474827, 115.85883507433789];
// url = `http://s16s652780.51mypc.cn/api/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
// url = `http://localhost:89/alarm/alarm/APP-getAlarm?id=${data[0].id}`;
this.nowPosition = center;
@@ -170,6 +171,10 @@
});
this.nowPosition = center;
+
+
+ this.getLocationData(this.geolocation);
+
return map; //抛出map
},
getDHLine(x, y) {
@@ -316,9 +321,8 @@
upData() {
console.log('上传信息成功')
},
- getLocationData() {
+ getLocationData(geolocation) {
var that = this;
- var geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
var positionNum = 0;
var options = {
timeout: 8000
@@ -331,22 +335,6 @@
var addr = position.addr; //详细地址
that.lat = position.lat; //
that.lng = position.lng; //火星坐标 //TODO 实现业务代码逻辑
-
-
- console.log(adCode, position, addr, 15145)
-
-
- axios.post("http://223.82.109.183:2080/api/liveLocation/saveLiveLocationAndLocus", {
- type: 1,
- workerId: that.userId,
- longitude: position.lng,
- latitude: position.lat,
- location: addr == '' ? position.province + position.city : addr
- }).then((res) => {
-
- console.log(res, 4848)
-
- })
if (that.LXdhStart != null) {
that.map.removeLayer(that.LXdhStart);
@@ -384,16 +372,17 @@
},
created() {},
mounted() {
+ this.geolocation = new qq.maps.Geolocation("T7RBZ-62U3X-RSQ4P-ZZVCB-WE7JT-HRBOG", "mapqq");
+
this.beginCome();
- this.getLocationData();
var that = this;
setInterval(() => {
- that.getLocationData();
+ that.getLocationData(that.geolocation);
- }, 10000);
+ }, 30000);
},
wacth: {}
})
\ No newline at end of file
--
Gitblit v1.9.3