diff --git a/public/config/project.config.json b/public/config/project.config.json index 41a78d4..115d931 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -10,7 +10,7 @@ "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", - "showAllWells": false, + "showAllWells": true, "provinceCode":"360000", "cityCode":"361000", "areaCode":"361024" diff --git a/public/config/project.config.json b/public/config/project.config.json index 41a78d4..115d931 100644 --- a/public/config/project.config.json +++ b/public/config/project.config.json @@ -10,7 +10,7 @@ "singleSys": true, "refreshType":"websocket", "showPointType":"massMarkers", - "showAllWells": false, + "showAllWells": true, "provinceCode":"360000", "cityCode":"361000", "areaCode":"361024" diff --git a/src/views/overview/overview3d.vue b/src/views/overview/overview3d.vue index e400c2b..1f9a309 100644 --- a/src/views/overview/overview3d.vue +++ b/src/views/overview/overview3d.vue @@ -64,6 +64,7 @@ var underground = null var line_layer = [] +var point_layer = [] export default { name: 'Overview3D', @@ -364,6 +365,7 @@ }, popup: 'all' }) + point_layer.push(point) const point3D = new mars3d.layer.GeoJsonLayer({ name: this.layerName[i], symbol: { @@ -389,7 +391,6 @@ point3D.load({ data: { features: null }}) return } - console.log(result) point.load({ data: result.geojson }) point3D.load({ data: result.geojson }) }, @@ -446,12 +447,9 @@ // 过滤图层 filterLayer(checkedLayer) { // 1.过滤井图层 - // if (this.type === 'massMarkers') { - // const wellTypes = checkedLayer.filter(item => item.indexOf('well-') > -1).map(item => item.substring(5)) - // if (wellTypes && wellTypes.length > 0) this.filterMassMarker({ wellTypes: wellTypes }) // 加载海量点 - // } else if (this.type === 'cluster') { - // this.filterClusters() // 加载聚合点 - // } + const wellTypes = checkedLayer.filter(item => item.indexOf('well-') > -1).map(item => item.substring(5)) + point_layer.filter((item) => wellTypes.indexOf(item.options.name) > -1).forEach(layer => { layer.show = true }) + point_layer.filter((item) => wellTypes.indexOf(item.options.name) === -1).forEach(layer => { layer.show = false }) // 2.选中or没选中报警图层 if (checkedLayer.indexOf('alarm') !== -1) { this.showAlarm = true @@ -462,7 +460,6 @@ // 切换底图 changeBaseMap(type) { this.baseLayer = type - console.log(type) if (type === 'gaode_vec') { window.map.basemap = 1112 if (this.bloomEffect !== null) { @@ -491,10 +488,16 @@ this.wellTypeList = [] // 如果该用户支持的点位类型只有一个,则不显示该筛选框 const supportWellTypes = this.$store.getters.wellTypes - debugger - this.wellTypeList = response.data.filter(wellType => { - return supportWellTypes.findIndex(item => item == wellType.value) > -1 + // this.wellTypeList = response.data.filter(wellType => { + // return supportWellTypes.findIndex(item => item == wellType.value) > -1 + // }) + this.wellTypeList = this.layerName.map((item, index) => { + return { + value: item, + name: item + } }) + this.wellTypeList.length = 8 const wellLayer = { id: 'well', name: '井图层', @@ -506,7 +509,7 @@ }) } this.layers.splice(0, 1, wellLayer) - if (this.baseConfig.showAllWell) { + if (this.baseConfig.showAllWells) { this.checkedLayer = [...this.checkedLayer, 'well', this.wellTypeList.map(item => 'well-' + item.value)] } else { this.checkedLayer = [...this.checkedLayer]