Commit 515634d7 authored by xiexingan's avatar xiexingan

tj

parent 5dcc9ecb
This diff is collapsed.
...@@ -128,7 +128,6 @@ export default { ...@@ -128,7 +128,6 @@ export default {
boxBean: {}, //防区对象 boxBean: {}, //防区对象
imgLayerList: [], imgLayerList: [],
controlList: [], controlList: [],
imgurl: '',
transformationSta: 1, transformationSta: 1,
isCollapse: true, isCollapse: true,
dataList: [], dataList: [],
...@@ -223,16 +222,12 @@ export default { ...@@ -223,16 +222,12 @@ export default {
}, },
methods: { methods: {
// 初始化地图 // 初始化地图
initMap(url) { initMap() {
this.clearLayer()
this.resolutions = [] this.resolutions = []
this.imgLayerList = []
this.controlList = []
let mapList = this.mapList let mapList = this.mapList
let mapsrcList = []
if (mapList != null && mapList.length > 0) {
mapsrcList = mapList.map((e) => e.readPath)
}
// console.log(mapsrcList,'111图片地址集合') //图片
this.imgurl = url
// 计算静态地图映射到地图上的范围 // 计算静态地图映射到地图上的范围
let extent = [-1100, 110, 1460, 820] let extent = [-1100, 110, 1460, 820]
...@@ -278,7 +273,7 @@ export default { ...@@ -278,7 +273,7 @@ export default {
this.resolutions.push(resolutionItem) this.resolutions.push(resolutionItem)
} }
} }
console.log('imgLayerList', this.imgLayerList)
let zoomControl = new Zoom({ let zoomControl = new Zoom({
delta: 0.2, delta: 0.2,
zoomInTipLabel: '', zoomInTipLabel: '',
...@@ -799,6 +794,7 @@ export default { ...@@ -799,6 +794,7 @@ export default {
this.changeVectorLayer(this.list) this.changeVectorLayer(this.list)
}, },
initStation(id) { initStation(id) {
this.clearLayer()
console.log('22222222222222') console.log('22222222222222')
this.$http({ this.$http({
url: this.$http.adornUrl(`/liStation/getId/${id}`), url: this.$http.adornUrl(`/liStation/getId/${id}`),
...@@ -885,7 +881,6 @@ export default { ...@@ -885,7 +881,6 @@ export default {
this.map.addControl(this.controlList[srcIndex]) this.map.addControl(this.controlList[srcIndex])
for (var k = 0; k < this.imgLayerList.length; k++) { for (var k = 0; k < this.imgLayerList.length; k++) {
if (this.imgLayerList[k].values_.id == id) { if (this.imgLayerList[k].values_.id == id) {
// that.imgurl=map.readPath
this.imgLayerList[k].setVisible(true) this.imgLayerList[k].setVisible(true)
} else { } else {
this.imgLayerList[k].setVisible(false) this.imgLayerList[k].setVisible(false)
...@@ -964,9 +959,7 @@ export default { ...@@ -964,9 +959,7 @@ export default {
console.log('选中节点的层级', node) console.log('选中节点的层级', node)
if (node.level === 3) { if (node.level === 3) {
//切换根节点 //切换根节点
this.clearLayer() this.initStation(id)
this.initStation(id)
console.log(this.mapList)
} else if (node.level === 4) { } else if (node.level === 4) {
this.map.removeLayer(this.boxVectorLayer) this.map.removeLayer(this.boxVectorLayer)
......
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