Merge branch 'feixian' of http://123.132.248.154:10000/xujingliang/Fei_Xian_Lin_Ye_Fang_Huo into feixian
commit
792d33810b
File diff suppressed because it is too large
Load Diff
|
|
@ -14,13 +14,13 @@ export default {
|
||||||
return {
|
return {
|
||||||
map: null,
|
map: null,
|
||||||
clockInList: [],
|
clockInList: [],
|
||||||
markerArr:[]
|
markerArr: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
rowkey: function (e) {
|
rowkey: function (e) {
|
||||||
console.log('123',e)
|
console.log("123", e);
|
||||||
this.getClockInList()
|
this.getClockInList();
|
||||||
},
|
},
|
||||||
lnglat: function (e) {},
|
lnglat: function (e) {},
|
||||||
flyCenter: function (e) {
|
flyCenter: function (e) {
|
||||||
|
|
@ -45,13 +45,13 @@ export default {
|
||||||
getMethodCommon("/FireGrid/GetTotalCheckPoint").then((res) => {
|
getMethodCommon("/FireGrid/GetTotalCheckPoint").then((res) => {
|
||||||
this.clockInList = res.result;
|
this.clockInList = res.result;
|
||||||
for (var i = this.markerArr.length - 1; i >= 0; i--) {
|
for (var i = this.markerArr.length - 1; i >= 0; i--) {
|
||||||
this.markerArr[i].remove();
|
this.markerArr[i].remove();
|
||||||
}
|
}
|
||||||
this.addPointLayer();
|
this.addPointLayer();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
addPointLayer() {
|
addPointLayer() {
|
||||||
let _this = this
|
let _this = this;
|
||||||
this.clockInList.forEach((item) => {
|
this.clockInList.forEach((item) => {
|
||||||
console.log("iii", item);
|
console.log("iii", item);
|
||||||
let el = document.createElement("img"); //这里可以是任意标签
|
let el = document.createElement("img"); //这里可以是任意标签
|
||||||
|
|
@ -59,15 +59,19 @@ export default {
|
||||||
el.src = "/img/dakadian.png"; //图片路径赋值
|
el.src = "/img/dakadian.png"; //图片路径赋值
|
||||||
el.style.width = "40px";
|
el.style.width = "40px";
|
||||||
// el.onclick = function(){
|
// el.onclick = function(){
|
||||||
|
|
||||||
// console.log('123item',item)
|
// console.log('123item',item)
|
||||||
// _this.$emit("editClock",item)
|
// _this.$emit("editClock",item)
|
||||||
// }
|
// }
|
||||||
|
console.log(item)
|
||||||
|
const popup = new mapboxgl.Popup({ offset: 25 }).setHTML(`${item.pointname }<br />${item.usernames}`);
|
||||||
// 添加自定义标记点
|
// 添加自定义标记点
|
||||||
let marker = new mapboxgl.Marker(el).setLngLat([item.lng, item.lat]).addTo(this.map);
|
let marker = new mapboxgl.Marker(el)
|
||||||
this.markerArr.push(marker)
|
.setLngLat([item.lng, item.lat])
|
||||||
|
.setPopup(popup)
|
||||||
|
.addTo(this.map);
|
||||||
|
marker
|
||||||
|
this.markerArr.push(marker);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
initMap(url, jwd) {
|
initMap(url, jwd) {
|
||||||
|
|
@ -85,14 +89,17 @@ export default {
|
||||||
this.loadMengban();
|
this.loadMengban();
|
||||||
this.loadZhenJieLayer();
|
this.loadZhenJieLayer();
|
||||||
this.loadXianJieLayer();
|
this.loadXianJieLayer();
|
||||||
|
|
||||||
this.getClockInList();
|
this.getClockInList();
|
||||||
});
|
});
|
||||||
this.map.on("click", (e) => {
|
this.map.on("click", (e) => {
|
||||||
this.$emit("getLocation", e);
|
this.$emit("getLocation", e);
|
||||||
});
|
});
|
||||||
|
this.map.on("contextmenu", (e) => {
|
||||||
|
this.$emit("rightClick", e);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
loadMengban() {
|
loadMengban() {
|
||||||
this.map.addLayer({
|
this.map.addLayer({
|
||||||
//蒙版图层 //通过边界数据反选 达到挖洞效果
|
//蒙版图层 //通过边界数据反选 达到挖洞效果
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue