master
lion 3 years ago
parent fdb20d52dc
commit c07b021aec

@ -4,7 +4,7 @@
</template>
<script>
import echarts from 'echarts'
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'

@ -22,7 +22,8 @@ const CONFIGS = [
// layerType: "TD地图",
// opacity: 1,
// url: "http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=82526d64e8504a0341f775c087863825"
// },
// },
{
title: "水利图",
id: "S1",
@ -47,12 +48,23 @@ const CONFIGS = [
title: "高清影像",
id: "M1",
type: "overlay",
visible: true,
visible: false,
projection: "EPSG:4490",
layerType: "地图",
opacity: 1,
url: "http://192.168.60.22:6080/arcgis/rest/services/szhd/xmqyx4490/MapServer"
},
{
title: "高清影像改版",
id: "M11",
type: "overlay",
visible: true,
projection: "EPSG:4490",
layerType: "地图",
opacity: 1,
url: "http://192.168.60.22:6080/arcgis/rest/services/szhd/yx449010/MapServer"
},
{
title: "路网",
id: "L1",

@ -159,7 +159,6 @@
Circle as sCircle
} from "ol/style";
import proj4 from 'proj4'
import {
@ -204,13 +203,16 @@
id: "H1",
title: "河道图"
}],
checkList: ['M1', 'L1'],
checkList: ['M11', 'L1'],
mapCheckList: [{
id: "M1",
title: "高清影像"
}, {
id: "M11",
title: "高清影像精简"
},{
id: "L1",
title: "路网"
},{
id: "M1",
title: "高清影像"
}],
configs: CONFIGS,
mapConfigs: MAPCONFIGS,
@ -241,7 +243,7 @@
code: this.mapConfigs.Map_Code,
units: this.mapConfigs.Map_units,
axisOrientation: this.mapConfigs.Map_axisOrientation,
global: this.mapConfigs.Map_global,
global: this.mapConfigs.Map_global
});
addProjection(this.projection);
// this.initMap();
@ -255,7 +257,7 @@
this.$nextTick(function() {
this.showmap = true
this.showMap = 'M2'
this.checkList = ['M1', 'L1']
this.checkList = ['M11', 'L1']
this.showMaps()
})
}
@ -460,7 +462,6 @@
changeMap(val) {
for (var m of this.mapRadioList) {
if (m.id == val) {
console.log("val", val)
this.checkLayers(val, true)
} else {
this.checkLayers(m.id, false)
@ -472,32 +473,23 @@
for (var m of this.mapCheckList) {
this.checkLayers(m.id, false)
}
} else if (val.length == this.mapCheckList.length) {
console.log(val)
for (var m of this.mapCheckList) {
this.checkLayers(m.id, true)
}
} else {
for (var m of this.mapCheckList) {
if (m.id == val[0]) {
this.checkLayers(m.id, true)
} else {
this.checkLayers(m.id, false)
}
}
} else {
for (var m of this.mapCheckList) {
this.checkLayers(m.id, false)
}
for(var k of val){
this.checkLayers(k, true)
}
}
},
//
checkLayers(id, bool) {
let layers = this.map.getLayers().getArray();
for (let i = 0; i < layers.length; i++) {
if (layers[i].get("id") == id) {
if (bool) {
console.log(id)
layers[i].setVisible(true);
} else {
layers[i].setVisible(false);

@ -203,13 +203,16 @@
id: "H1",
title: "河道图"
}],
checkList: ['M1', 'L1'],
checkList: ['M11', 'L1'],
mapCheckList: [{
id: "M1",
title: "高清影像"
}, {
id: "M11",
title: "高清影像精简"
},{
id: "L1",
title: "路网"
},{
id: "M1",
title: "高清影像"
}],
configs: CONFIGS,
mapConfigs: MAPCONFIGS,
@ -258,7 +261,7 @@
this.$nextTick(function() {
this.showmap = true
this.showMap = 'M2'
this.checkList = ['M1', 'L1']
this.checkList = ['M11', 'L1']
this.showMaps()
})
}
@ -384,7 +387,8 @@
projection: result.projection
}),
});
this.map.addLayer(layer);
this.map.addLayer(layer);
}
}
@ -489,24 +493,18 @@
}
},
changeCheck(val) {
if (val.length == 0) {
for (var m of this.mapCheckList) {
this.checkLayers(m.id, false)
}
} else if (val.length == this.mapCheckList.length) {
console.log(val)
for (var m of this.mapCheckList) {
this.checkLayers(m.id, true)
}
} else {
for (var m of this.mapCheckList) {
if (m.id == val[0]) {
this.checkLayers(m.id, true)
} else {
this.checkLayers(m.id, false)
}
}
}
if (val.length == 0) {
for (var m of this.mapCheckList) {
this.checkLayers(m.id, false)
}
} else {
for (var m of this.mapCheckList) {
this.checkLayers(m.id, false)
}
for(var k of val){
this.checkLayers(k, true)
}
}
},
@ -518,7 +516,6 @@
if (layers[i].get("id") == id) {
if (bool) {
console.log(id)
layers[i].setVisible(true);
} else {
layers[i].setVisible(false);

@ -420,6 +420,8 @@
//reject(error)
})
}
// return
console.log("that.formdetail",that.formdetail)
// return
update(that.formdetail).then(response => {
this.$Message.success('操作成功');

Loading…
Cancel
Save