From 28b3be6343168d07d5bd3783fd01388a18e90b8c Mon Sep 17 00:00:00 2001
From: 徐旺旺 <11530253@qq.com>
Date: 星期二, 06 四月 2021 15:25:14 +0800
Subject: [PATCH] 修改图层控制配置
---
src/conf/layers/LayerPipeLines.js | 4
src/conf/LayerTopic.js | 16 ++
src/conf/layers/LayerAirQuality.js | 20 ++
src/conf/LayerPipeLine.js | 13 +
src/views/MapTemplate.vue | 71 ----------
src/components/LayerController/LayerController.vue | 15 --
src/components/LayerController/modules/LcServiceLayer.vue | 12 +
src/conf/layers/LayerBasin.js | 44 ++++++
src/views/baseInfoMgr/pipeline/PipeLineIndex.vue | 13 -
src/conf/layers/LayerWasteSolid.js | 2
/dev/null | 21 ---
src/components/LayerController/service/WfsLayerService.js | 24 +-
src/conf/Constants.js | 12 +
src/conf/MapConfig.js | 12 -
src/conf/layers/LayerEnvRisk.js | 52 +++++++
src/conf/layers/LayerSoilGroundWater.js | 52 +++++++
16 files changed, 240 insertions(+), 143 deletions(-)
diff --git a/src/components/LayerController/LayerController.vue b/src/components/LayerController/LayerController.vue
index 0d010eb..9536833 100644
--- a/src/components/LayerController/LayerController.vue
+++ b/src/components/LayerController/LayerController.vue
@@ -11,7 +11,6 @@
<script>
import '@assets/css/map/magic.min.css'
-import presets from './layerControllerPresets'
import iconSetting from '@/assets/images/map-pages/icon/setting.png'
import LcServiceLayer from './modules/LcServiceLayer'
@@ -57,20 +56,6 @@
methods: {
showPanel () {
this.layerControllerVisible = !this.layerControllerVisible
- },
- init () {
- this.initPreset()
- },
- initPreset () {
- if (this.preset !== 'default') {
- const prmPreset = presets[this.preset]
- Object.assign(this.layerControllerVisible, prmPreset) // 闃叉棰勮鍙傛暟涓庨粯璁ゅ弬鏁颁笉涓�鑷村鑷存姤閿欙紝濡傛灉娌℃湁鎸夌収鎮ㄧ殑閰嶇疆鍙戠敓鏀瑰彉锛岃妫�鏌ユ嫾鍐欐槸鍚︽纭�
- if (prmPreset === 'undefined') {
- console.log('璇ュ浘灞傛帶鍒堕潰鏉跨殑棰勮娌℃湁鎵惧埌锛岃妫�鏌ラ璁惧悕绉版槸鍚︽纭紒')
- } else {
- this.$store.commit('updateLayerControllerVisible', this.layerControllerVisible)
- }
- }
},
switchPanel () {
this.panelSwitch.main = !this.panelSwitch.main
diff --git a/src/components/LayerController/LayerController2.vue b/src/components/LayerController/LayerController2.vue
deleted file mode 100644
index 8f24ad7..0000000
--- a/src/components/LayerController/LayerController2.vue
+++ /dev/null
@@ -1,288 +0,0 @@
-<template>
- <div class="float-panel">
- <div class="title-text-border" @click="switchPanel">
- <div class="title-icon"></div>
- <div class="title-text">鍥惧眰鎺у埗</div>
- </div>
- <transition name="el-fade-in-linear">
- <div class="body-box" id="panelContent" :style="{ width:width }">
- <div v-show="isShow">
- <slot></slot>
- </div>
- </div>
- </transition>
- </div>
-</template>
-
-<script>
-import '@assets/css/map/magic.min.css'
-import presets from './layerControllerPresets'
-
-import iconSetting from '@/assets/images/map-pages/icon/setting.png'
-
-export default {
- name: 'LayerController',
- components: {},
- props: {
- preset: {
- type: String,
- default: 'default'
- }
- },
- computed: {
- map () {
- return this.$store.state.map.map
- },
- L () {
- return this.$store.state.map.L
- },
- layerHelper () {
- return this.$store.state.map.layerHelper
- },
- layerControllerVisible () {
- return this.$store.state.map.layerControllerVisible
- }
- },
- data () {
- return {
- width: '250px',
- isShow: true,
- icons: {
- setting: iconSetting
- },
- panelSwitch: {
- main: true // 涓荤獥鍙�
- }
- }
- },
- mounted () {
- this.$nextTick(function () {
- this.init()
- })
- },
- methods: {
- init () {
- this.initPreset()
- },
- initPreset () {
- if (this.preset !== 'default') {
- const prmPreset = presets[this.preset]
- Object.assign(this.layerControllerVisible, prmPreset) // 闃叉棰勮鍙傛暟涓庨粯璁ゅ弬鏁颁笉涓�鑷村鑷存姤閿欙紝濡傛灉娌℃湁鎸夌収鎮ㄧ殑閰嶇疆鍙戠敓鏀瑰彉锛岃妫�鏌ユ嫾鍐欐槸鍚︽纭�
- if (prmPreset === 'undefined') {
- console.log('璇ュ浘灞傛帶鍒堕潰鏉跨殑棰勮娌℃湁鎵惧埌锛岃妫�鏌ラ璁惧悕绉版槸鍚︽纭紒')
- } else {
- this.$store.commit('updateLayerControllerVisible', this.layerControllerVisible)
- }
- }
- },
- switchPanel () {
- this.panelSwitch.main = !this.panelSwitch.main
- if (this.panelSwitch.main) {
- this.width = '250px'
- this.isShow = true
- } else {
- this.width = '0px'
- this.isShow = false
- }
- }
- }
-}
-</script>
-
-<style lang="less">
-
-.float-panel {
- position: absolute;
- top: 120px;
- height: auto;
- font-size: 11px;
- z-index: 1000;
-
- div {
- color: #90c8e0;
- }
-
- .title-border {
- width: 100%;
- height: 28px;
- background: #10488c;
- -webkit-clip-path: polygon(0px 0px, 0px 28px, 230px 28px, 230px 9px, 95px 9px, 86px 0px);
- clip-path: polygon(0px 0px, 0px 28px, 230px 28px, 230px 9px, 95px 9px, 86px 0px);
- position: relative;
- }
-
- .title-border:before {
- content: "";
- display: block;
- position: absolute;
- width: 6px;
- height: 6px;
- top: 0;
- left: 0;
- background-color: #38c8ef;
- }
-
- .title-border:after {
- content: "";
- display: block;
- position: absolute;
- width: 6px;
- height: 6px;
- top: 9px;
- right: 0;
- background-color: #38c8ef;
- -webkit-clip-path: polygon(0px 0px, 0px 1px, 5px 1px, 5px 6px, 6px 6px, 6px 0px);
- clip-path: polygon(0px 0px, 0px 1px, 5px 1px, 5px 6px, 6px 6px, 6px 0px);
- }
-
- .title-text-border {
- width: 30px;
- height: 120px;
- float: left;
- background: #091331;
- // -webkit-clip-path: polygon(1px 1px, 1px 27px, 229px 27px, 229px 10px, 94px 10px, 85px 1px);
- // clip-path: polygon(1px 1px, 1px 27px, 229px 27px, 229px 10px, 94px 10px, 85px 1px);
- }
-
- .title-icon {
- float: left;
- width: 22px;
- height: 22px;
- margin-top: 4px;
- margin-left: 2px;
- background-image: url(../../assets/images/map-pages/icon/setting.png);
- }
-
- .title-text {
- width: 25px;
- color: #00d0f9;
- font-weight: bold;
- margin-top: 6px;
- text-align: center;
- font-size: 14px;
- filter: brightness(100%);
- text-shadow: 0 0 5px #00d0f9, 0 0 0 #00d0f9, 0 0 0 #00d0f9, 0 0 0 #0258c5, 0 0 0 #0258c5, 0 0 2px #0258c5, 0 0 5px #0258c5, 0 0 15px #0258c5;
- }
-
- .title-line {
- display: inline-block;
- width: 120px;
- height: 1px;
- // margin-top: 14px;
- margin-left: 4px;
- background-color: #04527f;
- line-height: 5px;
- vertical-align: middle;
- }
-
- .title-point {
- display: inline-block;
- width: 5px;
- height: 5px;
- // margin-top: 12px;
- background-color: #04527f;
- line-height: 5px;
- vertical-align: middle;
- }
-
- .title-button {
- float: right;
- width: 28px;
- height: 28px;
- cursor: pointer;
-
- :hover {
- font-weight: bold;
- color: white;
- }
- }
-
- .body-box {
- background-color: rgba(44, 62, 80, 0.6);
- border: 1px solid #10488c;
- margin-top: -1px;
- margin-left: 30px;
- height: auto;
- }
-
- .switch-head-up {
- width: 22px;
- height: 16px;
- float: right;
- margin-top: 10px;
- margin-right: 10px;
- cursor: pointer;
- background-image: url(../../assets/images/map-pages/icon/xljt1.png);
- transform: rotateX(0deg);
- transform-origin: 50% 50%;
- transition: transform 0.5s linear 0s;
- }
-
- .switch-head-down {
- transform: rotateX(180deg);
- transform-origin: 50% 50%;
- transition: transform 0.5s linear 0s;
- }
-
- select {
- background: transparent;
- margin: 6px;
- border: .5px solid #569EB7;
- width: 150px;
- color: #569EB7;
- padding: 0 16px;
- }
-
- .horn {
- width: 6px;
- height: 6px;
- float: left;
- position: absolute;
- }
-
- .horn-tl {
- background-image: url(../../assets/images/map-pages/cosmetics/horn_tl.png);
- left: -1px;
- top: -1px;
- }
-
- .horn-tr {
- background-image: url(../../assets/images/map-pages/cosmetics/horn_tr.png);
- right: -1px;
- top: -1px;
- }
-
- .horn-bl {
- background-image: url(../../assets/images/map-pages/cosmetics/horn_bl.png);
- left: -1px;
- bottom: -1px;
- }
-
- .horn-br {
- background-image: url(../../assets/images/map-pages/cosmetics/horn_br.png);
- right: -1px;
- bottom: -1px;
- }
-
- ::-webkit-scrollbar {
- width: 7px;
- height: 5px !important;
- }
-
- ::-webkit-scrollbar-thumb {
- /*婊氬姩鏉¢噷闈㈠皬鏂瑰潡*/
- border-radius: 10px;
- box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
- background: #0661AE;
- border: 1px solid transparent;
- }
-
- ::-webkit-scrollbar-track {
- /*婊氬姩鏉¢噷闈㈣建閬�*/
- // box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2);
- border-radius: 0px;
- background: #0E3565;
- }
-}
-
-</style>
diff --git a/src/components/LayerController/layerControllerPresets.js b/src/components/LayerController/layerControllerPresets.js
deleted file mode 100644
index a092886..0000000
--- a/src/components/LayerController/layerControllerPresets.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/**
- * 澶у浘鍥惧眰鎺у埗闈㈡澘鐨勬樉绀洪璁�
- */
-const bigmapPreset = { // 鍥惧眰鎺у埗闈㈡澘鐨勬樉绀虹姸鎬佲�衡��
- layerController: true // 鐖哥埜鏍忕洰锛氭槸鍚︽樉绀哄浘灞傛帶鍒堕潰鏉�
-}
-
-/**
- * 缁煎悎鎶ヨ鍥惧眰鎺у埗闈㈡澘鐨勬樉绀洪璁�
- */
-const warningPreset = { // 鍥惧眰鎺у埗闈㈡澘鐨勬樉绀虹姸鎬佲�衡��
- layerController: true // 鐖哥埜鏍忕洰锛氭槸鍚︽樉绀哄浘灞傛帶鍒堕潰鏉�
-}
-
-/**
- * 缁煎悎鎶ヨ鍥惧眰鎺у埗闈㈡澘鐨勬樉绀洪璁�
- */
-const vehicleWarningPreset = { // 鍥惧眰鎺у埗闈㈡澘鐨勬樉绀虹姸鎬佲�衡��
- layerController: true // 鐖哥埜鏍忕洰锛氭槸鍚︽樉绀哄浘灞傛帶鍒堕潰鏉�
-}
-
-export default {
- bigmapPreset,
- warningPreset,
- vehicleWarningPreset
-}
diff --git a/src/components/LayerController/modules/LcServiceLayer.vue b/src/components/LayerController/modules/LcServiceLayer.vue
index 6f43745..24dfc00 100644
--- a/src/components/LayerController/modules/LcServiceLayer.vue
+++ b/src/components/LayerController/modules/LcServiceLayer.vue
@@ -6,16 +6,28 @@
<div class="wms-panel">
<el-scrollbar class="wms-panel-scrollbar">
<div v-for="item in serviceLayers" :key="item.code" class="layerbox">
+ <!-- 涓�绾у浘灞傞亶鍘� -->
<div>
<input type="checkbox" :name="'wmsLayer_'+item.code" :checked="item.checked" :value="item.code" @change="swAllLayers(item)"/>{{ item.name }}
</div>
<div class="layerbox-item">
+ <!-- 浜岀骇鍥惧眰閬嶅巻 -->
<div class="basemap-layer-item" v-for="itm in item.layers" :key="itm.code">
<input type="checkbox"
:name="'wmsSublayers_'+item.code+'_'+itm.code"
:checked="itm.checked"
:value="itm.code"
@change="swWmsLayer(itm)"/>{{ itm.name }}
+ <!-- 涓夌骇鍥惧眰閬嶅巻 -->
+ <div style="width: 100%">
+ <div class="basemap-layer-item" v-for="layer in itm.layers" :key="layer.code">
+ <input type="checkbox"
+ :name="'wmsSublayers_'+item.code+'_'+layer.code"
+ :checked="layer.checked"
+ :value="layer.code"
+ @change="swWmsLayer(layer)"/>{{ layer.name }}
+ </div>
+ </div>
</div>
</div>
</div>
diff --git a/src/components/LayerController/service/WfsLayerService.js b/src/components/LayerController/service/WfsLayerService.js
index 8d55234..7f10aee 100644
--- a/src/components/LayerController/service/WfsLayerService.js
+++ b/src/components/LayerController/service/WfsLayerService.js
@@ -2,7 +2,7 @@
* 鍔犺浇涓氬姟鏁版嵁鍥惧眰
*/
-import styles from '../../../conf/Styles'
+import { STYLES } from '../../../conf/Constants'
import AjaxUtils from '../../../utils/AjaxUtils'
class WfsLayerService {
@@ -37,14 +37,14 @@
this.L.geoJSON(features, {
style: function (feature) {
return {
- fill: styles.defaultLineStyle.fill,
- weight: styles.defaultLineStyle.weight,
- fillColor: styles.defaultLineStyle.fillColor,
- color: styles.defaultLineStyle.color,
- fillOpacity: styles.defaultLineStyle.fillOpacity,
- opacity: styles.defaultLineStyle.opacity,
- dashArray: styles.defaultLineStyle.dashArray,
- dashSpeed: styles.defaultLineStyle.dashSpeed
+ fill: STYLES.FILL,
+ weight: STYLES.WEIGHT,
+ fillColor: STYLES.FILL_COLOR,
+ color: STYLES.COLOR,
+ fillOpacity: STYLES.FILL_OPACITY,
+ opacity: STYLES.OPACITY,
+ dashArray: STYLES.DASH_ARRAY,
+ dashSpeed: STYLES.DASH_SPPED
}
},
pointToLayer: (geoJsonPoint, latlng) => {
@@ -53,7 +53,7 @@
img: {
// url: 'assets/images/map/marker-icon.png',
url: '/assets/images/map/' + icon,
- size: styles.defaultLineStyle.size
+ size: STYLES.ICON_SIZE
}
})
},
@@ -94,13 +94,13 @@
const icon = this.config.icon
const type = e.target.feature.geometry.type
if (type === 'LineString' || type === 'MultiLineString') {
- layer.setStyle({ weight: styles.defaultLineStyle.weight, color: styles.defaultLineStyle.color })
+ layer.setStyle({ weight: STYLES.WEIGHT, color: STYLES.COLOR })
}
if (type === 'Point' || type === 'MultiPoint') {
layer.setStyle({
img: {
url: '/assets/images/map/' + icon,
- size: styles.defaultLineStyle.size
+ size: STYLES.ICON_SIZE
}
})
}
diff --git a/src/components/helpers/ServiceLayerHelper.js b/src/components/helpers/ServiceLayerHelper.js
deleted file mode 100644
index c53ff99..0000000
--- a/src/components/helpers/ServiceLayerHelper.js
+++ /dev/null
@@ -1,399 +0,0 @@
-/* eslint-disable no-debugger */
-/**
- * 鍒涘缓鍥惧眰鐩稿叧鐨勭被
- */
-import AjaxUtils from '@/utils/AjaxUtils'
-import store from '@/store'
-import styles from '@/conf/Styles'
-
-class ServiceLayerHelper {
- constructor (options) {
- this.map = options.map
- this.L = window.L
- this.loadedLayersMap = new Map()
- this.tileLayerWmslayerGroup = this.L.layerGroup().addTo(this.map)
- this.tileLayersWMTSArray = [] // 鍒濆鐨刉MTS闆�
- this.tileLayersTileArray = [] // 鍒濆鐨凾ile闆�
- this.tileLayersWMSArray = [] // 鍒濆鐨刉MS闆�
- this.layerArray = {} // key涓洪厤缃殑code锛屽姞杞界殑鍥惧眰瀵硅薄锛�
- this.regex = /\{(.+?)\}/g // 鍖归厤{}
- this.popupComp = null
- }
-
- getTileLayer (code) {
- return this.loadedLayersMap.get(code)
- }
-
- getByLayerId (layerId) {
- for (var k in this.layerArray) {
- var layerGroup = this.layerArray[k]
- var layers = layerGroup.getLayers()
- for (var m = 0; m < layers.length; m++) {
- var layer = layers[m]
- var feature = layer.feature
- if (feature.id === layerId) {
- return layer
- }
- }
- }
- return null
- }
-
- /**
- * 鎺у埗鏄剧ず鐨勭骇鍒�
- * @param layerConfig
- */
- initDisplayZoom (layerConfig) {
- var that = this
- that.map.on('zoomend ', function (e) {
- const zoom = that.map.getZoom()
- for (var i = 0, l = layerConfig.length; i < l; i++) {
- var config = layerConfig[i]
- var layers = config.layers
- for (var j = 0; j < layers.length; j++) {
- var layer = layers[j]
- if (layer.minZoom) {
- if (zoom > layer.minZoom) {
- var layerObj = that.layerArray[layer.code]
- layerObj && layerObj.addTo(that.map)
- } else {
- that.removeLayer(layer)
- }
- }
- }
- }
- })
- }
-
- /**
- * 鏍规嵁閰嶇疆鏂囦欢鍒濆鍖栦笟鍔″簳鍥�
- */
- initServiceLayers (layerConfig, popupComp) {
- this.layerConfig = layerConfig
- this.popupComp = popupComp
- store.commit('clearSewersDatas')
- store.commit('clearSewersLayers')
- this.loadLayers(layerConfig.mapConfig.Layers.LayerSewersLine)
- this.loadLayers(layerConfig.mapConfig.Layers.layerSewersPoint)
- this.initDisplayZoom(layerConfig.mapConfig.Layers.LayerSewersLine)
- this.initDisplayZoom(layerConfig.mapConfig.Layers.layerSewersPoint)
- }
-
- /**
- * 鎸夐厤缃枃浠跺姞杞戒笁绉嶄笉鍚岀被鍨嬬殑
- * @param {*} mapConfig
- * @param {*} isAddToMap
- */
- loadLayers (layerConfig, isAddToMap = true) {
- console.debug('ServiceLayerHelper鍔犺浇鍙傛暟锛�', layerConfig)
- for (let i = 0, len = layerConfig.length; i < len; ++i) {
- const opt = layerConfig[i]
- if (opt.type === 'wmts') {
- this.loadWmtsLayer(opt, isAddToMap)
- this.tileLayersWMTSArray.push(opt)
- } else if (opt.type === 'wms') {
- this.loadWmsLayer(opt, isAddToMap)
- this.tileLayersWMSArray.push(opt)
- } else if (opt.type === 'tile') {
- this.loadTileLayer(opt, isAddToMap)
- this.tileLayersTileArray.push(opt)
- } else if (opt.type === 'geojson') {
- this.loadGeojsonLayers(opt)
- }
- }
- }
-
- loadGeojsonLayers (options) {
- var url = options.url
- var layers = options.layers
- for (var i = 0; i < layers.length; i++) {
- var layer = layers[i]
- var checked = layer.checked
- if (checked) {
- this.loadGeojsonLayer(url, layer)
- }
- }
- }
-
- /**
- * 璇锋眰wfs鏁版嵁
- * @param url
- * @param item
- */
- async loadGeojsonLayer (url, item) {
- var matches = this.regex.exec(url)
- var matchValue = item[matches[1]]
- var code = item.code
- var newUrl = url.replace(this.regex, matchValue)
- var that = this
- if (!that.layerArray[code]) {
- const res = await AjaxUtils.GetDataAsynByUrl(newUrl, {})
- if (res.data instanceof Object && Object.prototype.hasOwnProperty.call(res.data, 'features')) {
- store.commit('addSewersDatas', res.data)
- var layer = that.loadGeojson(res.data, item)
- that.layerArray[code] = layer
- }
- } else {
- var _layer = that.layerArray[code].addTo(that.map)
- that.setZIndex(_layer)
- }
- }
-
- /**
- * 鍔犺浇gis server杩斿洖鐨刧eoson鏁版嵁鍒板湴鍥句腑灞曠ず
- * @param res
- */
- loadGeojson (res, opt) {
- var icon = opt.icon
- const featureGroup = this.L.featureGroup()
- const featureList = []
- const geojson = this.L.geoJSON(res.features, {
- style: function (feature) {
- return {
- fill: styles.defaultLineStyle.fill,
- weight: styles.defaultLineStyle.weight,
- fillColor: styles.defaultLineStyle.fillColor,
- color: styles.defaultLineStyle.color,
- fillOpacity: styles.defaultLineStyle.fillOpacity,
- opacity: styles.defaultLineStyle.opacity,
- dashArray: styles.defaultLineStyle.dashArray,
- dashSpeed: styles.defaultLineStyle.dashSpeed
- }
- },
- pointToLayer: (geoJsonPoint, latlng) => {
- return this.L.canvasMarker(latlng,
- {
- img: {
- // url: 'assets/images/map/marker-icon.png',
- url: '/assets/images/map/' + icon,
- size: styles.defaultLineStyle.size
- }
- })
- },
- onEachFeature: (feature, layer) => {
- featureList.push(layer)
- layer.bindPopup((layer) => {
- this.popupComp.setDatas(layer)
- this.popupComp.setShow()
- return this.popupComp.$el
- }, {
- className: 's-map-popup',
- minWidth: 300,
- closeButton: false,
- autoClose: false
- })
- .bindTooltip((layer) => {
- const nameId = layer.feature.id
- let name = ''
- if (nameId.indexOf('涓夐��') !== -1 || nameId.indexOf('鍥涢��') !== -1 || nameId.indexOf('绐ㄤ簳') !== -1) {
- name = layer.feature.properties.pointnumber
- } else {
- name = layer.feature.properties.name
- }
- if (name === undefined) {
- name = ''
- }
- return name
- }, { direction: 'bottom', offset: [0, 15], sticky: true })
- .on('mouseover', (e) => {
- const type = e.target.feature.geometry.type
- if (type === 'LineString' || type === 'MultiLineString') {
- layer.setStyle({ weight: 8, color: '#00ffff' })
- } else if (type === 'Point' || type === 'MultiPoint') {
- layer.setStyle({
- img: {
- url: '/assets/images/map/' + icon,
- size: [25, 25]
- }
- })
-
- layer.bringToFront()
- }
- }).on('mouseout', (e) => {
- const type = e.target.feature.geometry.type
- if (type === 'LineString' || type === 'MultiLineString') {
- layer.setStyle({ weight: styles.defaultLineStyle.weight, color: styles.defaultLineStyle.color })
- }
- if (type === 'Point' || type === 'MultiPoint') {
- layer.setStyle({
- img: {
- url: '/assets/images/map/' + icon,
- size: styles.defaultLineStyle.size
- }
- })
- }
- }).addTo(featureGroup)
- }
- })
- store.commit('addSewersDatas', geojson)
- featureGroup.addTo(this.map)
- this.setZIndex(featureGroup)
- return featureGroup
- }
-
- /**
- * 璁剧疆index,绾垮湪鏈�涓嬮潰锛岀偣鍦ㄤ笂闈�
- * @param layerGroup 鍥惧眰缁�
- */
- setZIndex (layerGroup) {
- var layers = layerGroup.getLayers()
- if (layers.length > 0) {
- var layer = layers[0]
- if (layer.feature && (layer.feature.geometry.type === 'LineString' || layer.feature.geometry.type === 'MultiLineString')) {
- layerGroup.bringToBack()
- } else {
- layerGroup.bringToFront()
- }
- }
- }
-
- removeLayer (item) {
- var layer = this.layerArray[item.code]
- layer && this.map.removeLayer(layer)
- }
-
- /**
- * 寰�鍦板浘涓姞鍏ヤ竴涓猈MTS鏈嶅姟
- * @param {}} options
- * @param {*} isAddToMap
- */
- loadWmtsLayer (options, isAddToMap = true) {
- const layer = this.L.tileLayer(options.url, options.option)
- layer.config = options
- var checked = options.checked
- if (checked) {
- if (isAddToMap) {
- layer.addTo(this.map)
- }
- this.loadedLayersMap.set(options.code, layer)
- }
- }
-
- /**
- * 寰�鍦板浘涓姞鍏ヤ竴涓猈MS鏈嶅姟
- * @param {}} options
- * @param {*} isAddToMap
- */
- loadWmsLayer (options, isAddToMap = true) {
- const layer = this.L.tileLayer.wms(options.url, options.option)
- layer.config = options
-
- var checked = options.checked
- if (checked) {
- if (isAddToMap) {
- layer.addTo(this.tileLayerWmslayerGroup)
- }
- this.loadedLayersMap.set(options.code, layer)
- }
- }
-
- /**
- * 寰�鍦板浘涓姞鍏ヤ竴涓猅ILE鏈嶅姟
- * @param {}} options
- * @param {*} isAddToMap
- */
- loadTileLayer (options, isAddToMap = true) {
- const layer = this.L.tileLayer(options.url, {
- layers: options.layers || 'all', // country
- format: options.format || 'image/png',
- transparent: options.true || true,
- crs: options.crs || this.L.CRS.EPSG4326,
- maxZoom: options.maxZoom || 21,
- minZoom: options.minZoom || 1,
- zoomOffset: options.zoomOffset || 0
- })
- layer.config = options
-
- if (isAddToMap) {
- layer.addTo(this.map)
- }
- this.loadedLayersMap.set(options.code, layer)
- }
-
- /**
- * 闅愯棌鏈嶅姟鍥惧眰
- * @param {*} name
- */
- hideTileLayer (code) {
- if (this.loadedLayersMap) {
- const tileLayer = this.loadedLayersMap.get(code)
- this.map.removeLayer(tileLayer)
- }
- }
-
- /**
- * 灞曠ず鏈嶅姟鍥惧眰
- * @param {*} name
- */
- showTileLayer (code) {
- if (this.loadedLayersMap) {
- const tileLayer = this.loadedLayersMap.get(code)
- this.map.addLayer(tileLayer)
- }
- }
-
- /**
- * 寰楀埌閫変腑鐨勫浘灞傚垪琛�
- * @param mapConfig
- * @returns {[]}
- */
- getCheckedLayers (serviceLayers) {
- var checkedLayers = []
- for (var i = 0; i < serviceLayers.length; i++) {
- var serviceLayer = serviceLayers[i]
- var layers = serviceLayer.layers
- for (var j = 0; j < layers.length; j++) {
- var layer = layers[j]
- var checked = layer.checked
- if (checked) {
- checkedLayers.push(layer)
- }
- }
- }
- return checkedLayers
- }
-
- /**
- * 鑾峰彇鎵�鏈夌殑TILE鏈嶅姟鍥惧眰
- */
- getTileLayers () {
- return this.tileLayersTileArray
- }
-
- /**
- * 鑾峰彇鎵�鏈夌殑WMTS鏈嶅姟鍥惧眰
- */
- getWmtsLayers () {
- return this.tileLayersWMTSArray
- }
-
- /**
- * 鑾峰彇鎵�鏈夌殑WMS鏈嶅姟鍥惧眰
- */
- getWmsLayers () {
- return this.tileLayersWMSArray
- }
-
- /**
- * 鏍规嵁绾跨殑閫夋嫨锛屽緱鍒扮偣鐨勫彲閫夋嫨鍥惧眰鏁版嵁
- */
- getFiltersGroup () {
-
- }
-
- /**
- * 閫氳繃code鏌ユ壘WMS鐨勬湇鍔¢厤缃�
- * @param {} code wms鏈嶅姟閰嶇疆鐨刢ode
- */
- getWMSConfig (code) {
- const mc = this.mapConfig
- for (let i = 0, len = mc.mapConfig.ServiceLayers.length; i < len; ++i) {
- if (code === mc.mapConfig.ServiceLayers[i].code || mc.mapConfig.ServiceLayers[i].type === 'wms') {
- return mc.mapConfig.ServiceLayers[i]
- }
- }
- return null
- }
-}
-
-export default ServiceLayerHelper
diff --git a/src/conf/Constants.js b/src/conf/Constants.js
index 455d6e2..98f7fa1 100644
--- a/src/conf/Constants.js
+++ b/src/conf/Constants.js
@@ -11,6 +11,18 @@
sewersAreaGs: 'Company.js'
}
+export const STYLES = {
+ FILL: true,
+ WEIGHT: 3,
+ FILL_COLOR: '#73b2ff',
+ COLOR: '#73b2ff',
+ FILL_OPACITY: 0.2,
+ OPACITY: 1,
+ DASH_ARRAY: '4,4',
+ DASH_SPPED: -5,
+ ICON_SIZE: [20, 20]
+}
+
export const props = {
pipename: '绠$嚎鍚嶇О',
pipecode: '绠$嚎缂栫爜',
diff --git a/src/conf/LayerPipeLine.js b/src/conf/LayerPipeLine.js
new file mode 100644
index 0000000..46807c3
--- /dev/null
+++ b/src/conf/LayerPipeLine.js
@@ -0,0 +1,13 @@
+/**
+ * 绠$嚎鏁版嵁
+ */
+import { LayerPipeLines } from './layers/LayerPipeLines'
+import { LayerArea } from './layers/LayerArea'
+import { LayerPk } from './layers/LayerPk'
+
+export const LayerPipeLine = {
+ code: 'sewersPipeLine',
+ name: '绠$嚎鏁版嵁',
+ checked: true,
+ layers: [LayerPipeLines, LayerPk, LayerArea]
+}
diff --git a/src/conf/LayerTopic.js b/src/conf/LayerTopic.js
new file mode 100644
index 0000000..66197d9
--- /dev/null
+++ b/src/conf/LayerTopic.js
@@ -0,0 +1,16 @@
+/**
+ * 鍖哄煙
+ */
+import { LayerWasteWater } from './layers/LayerWasteWater'
+import { LayerWasteGas } from './layers/LayerWasteGas'
+import { LayerWasteSolid } from './layers/LayerWasteSolid'
+import { LayerAirQuality } from './layers/LayerAirQuality'
+import { LayerEnvRisk } from './layers/LayerEnvRisk'
+import { LayerSoilGroundWater } from './layers/LayerSoilGroundWater'
+
+export const LayerTopic = {
+ code: 'sewersTopic',
+ name: '涓撻鍥惧眰',
+ checked: true,
+ layers: [LayerWasteWater, LayerWasteGas, LayerWasteSolid, LayerAirQuality, LayerEnvRisk, LayerSoilGroundWater]
+}
diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js
index 704279b..9620d76 100644
--- a/src/conf/MapConfig.js
+++ b/src/conf/MapConfig.js
@@ -1,14 +1,8 @@
锘縤mport * as L from 'leaflet'
import TDT from './TDT'
import { LayerSewersPoint } from './layers/LayerSewers'
-import { LayerWasteWater } from './layers/LayerWasteWater'
-import { LayerSolidWaste } from './layers/LayerSolidWaste'
-import { LayerWasteGas } from './layers/LayerWasteGas'
-import { LayerPipeLine } from './layers/LayerPipeLine'
-import { LayerArea } from './layers/LayerArea'
-import { LayerPk } from './layers/LayerPk'
-import { LayerFsss } from './layers/LayerFsss'
-import { LayerHbss } from './layers/LayerHbss'
+import { LayerTopic } from './LayerTopic'
+import { LayerPipeLine } from './LayerPipeLine'
const curWwwPath = window.document.location.href
const pathname = window.document.location.pathname
@@ -48,7 +42,7 @@
IntranetBaseMaps: TDT.intranet,
InternetBaseMaps: TDT.internet,
Layers: {
- LayerSewersLine: [LayerPipeLine, LayerFsss, LayerHbss, LayerArea, LayerPk, LayerWasteWater, LayerWasteGas, LayerSolidWaste],
+ LayerSewersLine: [LayerPipeLine, LayerTopic],
layerSewersPoint: LayerSewersPoint
} // 姹¢洦姘村浘灞傞厤缃�
}
diff --git a/src/conf/Styles.js b/src/conf/Styles.js
deleted file mode 100644
index 9f6457d..0000000
--- a/src/conf/Styles.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const defaultLineStyle = {
- fill: true,
- weight: 3,
- fillColor: '#73b2ff',
- color: '#73b2ff',
- fillOpacity: 0.2,
- opacity: 1,
- dashArray: '4,4',
- dashSpeed: -5,
- size: [20, 20]
-}
-
-const customStyles = {
- pipeline: {
- }
-}
-
-export default {
- defaultLineStyle,
- customStyles
-}
diff --git a/src/conf/layers/LayerAirQuality.js b/src/conf/layers/LayerAirQuality.js
new file mode 100644
index 0000000..738548e
--- /dev/null
+++ b/src/conf/layers/LayerAirQuality.js
@@ -0,0 +1,20 @@
+/**
+ * 鍖哄煙
+ */
+const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
+const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
+export const LayerAirQuality = {
+ code: 'sewersAirQuality',
+ name: '绌烘皵璐ㄩ噺',
+ checked: true,
+ layers: [
+ {
+ code: 'airQualityStation',
+ name: '鐩戞祴绔�',
+ sname: '鐩戞祴绔�', // 琛ㄥ悕
+ checked: true, // 榛樿閫変腑鐘舵��
+ url: WFS_URL + '?TYPENAME=鍏徃',
+ minZoom: 10
+ }
+ ]
+}
diff --git a/src/conf/layers/LayerBasin.js b/src/conf/layers/LayerBasin.js
new file mode 100644
index 0000000..1476068
--- /dev/null
+++ b/src/conf/layers/LayerBasin.js
@@ -0,0 +1,44 @@
+/**
+ * 娴佸煙
+ */
+const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
+const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
+export const LayerBasin = {
+ code: 'sewersBasin',
+ name: '鍖哄煙鍥惧眰',
+ checked: true,
+ layers: [
+ {
+ code: 'basinCj',
+ name: '闀挎睙娴佸煙',
+ sname: '闀挎睙娴佸煙', // 琛ㄥ悕
+ checked: true, // 榛樿閫変腑鐘舵��
+ url: WFS_URL + '?TYPENAME=鍏徃',
+ minZoom: 10
+ },
+ {
+ code: 'basinHh',
+ name: '榛勬渤娴佸煙',
+ sname: '榛勬渤娴佸煙',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=鐮佸ご',
+ minZoom: 10
+ },
+ {
+ code: 'basinBh',
+ name: '娓ゆ捣娴佸煙',
+ sname: '娓ゆ捣娴佸煙',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ },
+ {
+ code: 'basinQt',
+ name: '鍏朵粬',
+ sname: '鍏朵粬',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ }
+ ]
+}
diff --git a/src/conf/layers/LayerEnvRisk.js b/src/conf/layers/LayerEnvRisk.js
new file mode 100644
index 0000000..5e24a1f
--- /dev/null
+++ b/src/conf/layers/LayerEnvRisk.js
@@ -0,0 +1,52 @@
+/**
+ * 鐜椋庨櫓
+ */
+const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
+const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
+export const LayerEnvRisk = {
+ code: 'sewersEnvRisk',
+ name: '鐜椋庨櫓',
+ checked: true,
+ layers: [
+ {
+ code: 'envRiskChart',
+ name: '椋庨櫓缁熻鍥�',
+ sname: '椋庨櫓缁熻鍥�', // 琛ㄥ悕
+ checked: true, // 榛樿閫変腑鐘舵��
+ url: WFS_URL + '?TYPENAME=鍏徃',
+ minZoom: 10
+ },
+ {
+ code: 'envRiskMaterial',
+ name: '鐗╄祫搴�',
+ sname: '鐗╄祫搴�',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=鐮佸ご',
+ minZoom: 10
+ },
+ {
+ code: 'envRiskMajor',
+ name: '閲嶅ぇ椋庨櫓',
+ sname: '閲嶅ぇ椋庨櫓',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ },
+ {
+ code: 'envRiskFirst',
+ name: '涓�绾ч闄�',
+ sname: '涓�绾ч闄�',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ },
+ {
+ code: 'envRiskSecond',
+ name: '浜岀骇椋庨櫓',
+ sname: '浜岀骇椋庨櫓',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ }
+ ]
+}
diff --git a/src/conf/layers/LayerPipeLine.js b/src/conf/layers/LayerPipeLines.js
similarity index 96%
rename from src/conf/layers/LayerPipeLine.js
rename to src/conf/layers/LayerPipeLines.js
index c90a7f4..4209ddc 100644
--- a/src/conf/layers/LayerPipeLine.js
+++ b/src/conf/layers/LayerPipeLines.js
@@ -4,8 +4,8 @@
const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
-export const LayerPipeLine = {
- code: 'sewersPipeLine',
+export const LayerPipeLines = {
+ code: 'sewersPipeLines',
name: '绠$嚎',
checked: true,
layers: [
diff --git a/src/conf/layers/LayerSoilGroundWater.js b/src/conf/layers/LayerSoilGroundWater.js
new file mode 100644
index 0000000..b75b78d
--- /dev/null
+++ b/src/conf/layers/LayerSoilGroundWater.js
@@ -0,0 +1,52 @@
+/**
+ * 鍦熷¥鍙婂湴涓嬫按
+ */
+const APP_GIS_HOST_2 = 'http://xearth.cn:8088'
+const WFS_URL = APP_GIS_HOST_2 + '/server/ogcserver/PipeLine/wfs'
+export const LayerSoilGroundWater = {
+ code: 'sewersSoilGroundWater',
+ name: '鍦熷¥鍙婂湴涓嬫按',
+ checked: true,
+ layers: [
+ {
+ code: 'soil',
+ name: '鍦熷¥',
+ sname: '鍦熷¥', // 琛ㄥ悕
+ checked: true, // 榛樿閫変腑鐘舵��
+ url: WFS_URL + '?TYPENAME=鍏徃',
+ minZoom: 10
+ },
+ {
+ code: 'groundWater',
+ name: '鍦颁笅姘�',
+ sname: '鍦颁笅姘�',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=鐮佸ご',
+ minZoom: 10
+ },
+ {
+ code: 'firstRiskBlock',
+ name: '涓�绾ч闄╁湴鍧�',
+ sname: '涓�绾ч闄╁湴鍧�',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ },
+ {
+ code: 'secondRiskBlock',
+ name: '浜岀骇椋庨櫓鍦板潡',
+ sname: '浜岀骇椋庨櫓鍦板潡',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ },
+ {
+ code: 'threeRiskBlock',
+ name: '涓夌骇椋庨櫓鍦板潡',
+ sname: '涓夌骇椋庨櫓鍦板潡',
+ checked: true, // 榛樿閫変腑鐘舵��
+ wfs: WFS_URL + '?TYPENAME=瑁呯疆鍖�',
+ minZoom: 10
+ }
+ ]
+}
diff --git a/src/conf/layers/LayerSolidWaste.js b/src/conf/layers/LayerWasteSolid.js
similarity index 93%
rename from src/conf/layers/LayerSolidWaste.js
rename to src/conf/layers/LayerWasteSolid.js
index fb49c33..1610672 100644
--- a/src/conf/layers/LayerSolidWaste.js
+++ b/src/conf/layers/LayerWasteSolid.js
@@ -3,7 +3,7 @@
* @type {string}
*/
-export const LayerSolidWaste = {
+export const LayerWasteSolid = {
code: 'solidWaste',
name: '鍥哄簾',
checked: true,
diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue
index 5463f63..9c5005c 100644
--- a/src/views/MapTemplate.vue
+++ b/src/views/MapTemplate.vue
@@ -38,10 +38,6 @@
// import MenuSpecial from '@components/panel/MenuTopic'
import LegendPanel from '@components/panel/LegendPanel'
import Enterprise from '../components/table/enterprise'
-// 搴曞浘涓氬姟js閫昏緫
-
-import AddWasteWaterHelper from '@components/BaseNav/WasteWater/WasteWater'
-import AddGasHelper from '@components/BaseNav/flueGas/flueGas'
// // 鍏叡灞曠ず鏁版嵁
import PublicBounced from '@components/BaseNav/PublicBounced/PublicBounced'
import LayerFactory from '@components/LayerController/service/LayerFactory'
@@ -83,44 +79,6 @@
})
},
methods: {
- AddGasHelper () {
- const data = {
- companyId: 3900100145,
- id: '',
- monType: 2,
- userCode: 'wenchun.deng',
- monDuration: '',
- epName: '',
- secdDeptId: '',
- contrLevel: '',
- dataStatus: '',
- dataFlag: '',
- runStatus: '',
- emissTypeId: ''
- }
- const AddGas = new AddGasHelper({ map: this.map })
- AddGas.requestData(data)
- AddGas.SetPlueGasContent(this.config, this.$refs.PublicBounced)
- },
- ChangeWaterState () {
- const data = {
- companyId: 3900100145,
- id: '',
- monType: 1,
- userCode: 'wenchun.deng',
- monDuration: '',
- epName: '',
- secdDeptId: '',
- contrLevel: '',
- dataStatus: '',
- dataFlag: '',
- runStatus: '',
- emissTypeId: ''
- }
- const AddWasteWater = new AddWasteWaterHelper({ map: this.map })
- AddWasteWater.requestData(data)
- AddWasteWater.SetWasteWaterContent(this.config, this.$refs.PublicBounced)
- },
saveMapStatus () {
window.serviceLayerHelper = this.serviceLayerHelper
this.$store.commit('setMapObj', this.map)
@@ -162,35 +120,6 @@
// this.setServiceLayerHelper(this.serviceLayerHelper)
// this.setVectorLayerHelper(this.vectorLayerHelper)
this.addMarker()
- },
- addMarker () {
- const L = this.L
- var icon = new L.Icon({
- iconUrl: 'assets/images/map/marker-icon.png',
- shadowUrl: 'assets/images/map/marker-shadow.png',
- iconSize: [25, 41],
- iconAnchor: [12, 41],
- popupAnchor: [1, -34],
- shadowSize: [41, 41]
- })
- var marker = L.marker([32.2221, 118.7843], {
- icon: icon
- }).addTo(this.map)
- .bindPopup(() => this.$refs.popup.$el, {
- className: 's-map-popup',
- minWidth: 300,
- closeButton: false,
- autoClose: false
- })
- .bindTooltip('瀛椾綋鍏夋檿鏁堟灉t.', {
- // permanent : true,
- offset: [0, 0], // 鍋忕Щ
- direction: 'right', // 鏀剧疆浣嶇疆
- // sticky:true,//鏄惁鏍囪鍦ㄧ偣涓婇潰
- className: 'anim-tooltip'// CSS鎺у埗
- })
-
- marker.on('popupopen', this.onLayerClick)
},
onLayerClick () {
this.$refs.popup.setShow()
diff --git a/src/views/baseInfoMgr/pipeline/PipeLineIndex.vue b/src/views/baseInfoMgr/pipeline/PipeLineIndex.vue
index 7118d09..84ae2a2 100644
--- a/src/views/baseInfoMgr/pipeline/PipeLineIndex.vue
+++ b/src/views/baseInfoMgr/pipeline/PipeLineIndex.vue
@@ -9,7 +9,6 @@
import 'leaflet/dist/leaflet.css'
import Sgis from '@src/Sgis'
import PipeLineList from './PipeLineList'
-import { mapMutations } from 'vuex'
export default {
name: 'PipeLineIndex',
@@ -20,20 +19,10 @@
})
},
methods: {
- ...mapMutations({
- setMapObj: 'setMapObj',
- setLayerHelper: 'setLayerHelper'
- }),
init () {
const mapcontainer = this.$refs.rootmap
- this.mapObj = Sgis.initMap(mapcontainer)
- this.basemapHelper = Sgis.initBasemaps(this.mapObj.map, this.mapObj.L) // 鍒濆鍖栧簳鍥�
- this.vectorLayerHelper = Sgis.initLayers(this.mapObj.map, this.mapObj.L, {}, this.$nodeEnv) // 鍒濆鍖栦笟鍔″浘灞�
- this.setLayerHelper(this.vectorLayerHelper)
+ Sgis.initMap(mapcontainer)
return this.map
- },
- setLayerHelper () {
-
}
}
}
--
Gitblit v1.8.0