From 68d9f6b85690aa6402a69a1bc748be7129f39ed1 Mon Sep 17 00:00:00 2001 From: chenzeping <ChenZeping02609@163.com> Date: 星期一, 12 四月 2021 17:42:12 +0800 Subject: [PATCH] 功能底图切换标注 --- src/components/LayerController/modules/LcBaseMap.vue | 5 +++-- src/components/panel/ToolBoxPanel.vue | 3 +-- src/components/BaseNav/PublicBounced/PublicBounced.vue | 7 +------ src/Sgis.js | 8 ++++---- src/components/plugin/PathDrag.js | 2 +- public/assets/images/map/solidwaste/gf_green.png | 0 public/assets/images/map/solidwaste/gf_green2.png | 0 src/conf/TDT.js | 10 +++++++++- src/main.js | 1 + src/conf/MapConfig.js | 8 ++------ src/components/helpers/BasemapHelper.js | 8 +++----- src/utils/utils.js | 4 ---- src/components/LayerController/logic/SolidWaste.js | 4 ++-- 13 files changed, 27 insertions(+), 33 deletions(-) diff --git a/public/assets/images/map/solidwaste/gf_green.png b/public/assets/images/map/solidwaste/gf_green.png index 3238061..975d61c 100644 --- a/public/assets/images/map/solidwaste/gf_green.png +++ b/public/assets/images/map/solidwaste/gf_green.png Binary files differ diff --git a/public/assets/images/map/solidwaste/gf_green2.png b/public/assets/images/map/solidwaste/gf_green2.png new file mode 100644 index 0000000..975d61c --- /dev/null +++ b/public/assets/images/map/solidwaste/gf_green2.png Binary files differ diff --git a/src/Sgis.js b/src/Sgis.js index 8c5b3c9..d46bfc2 100644 --- a/src/Sgis.js +++ b/src/Sgis.js @@ -1,7 +1,6 @@ -import BasemapHelper from '@components/helpers/BasemapHelper' -import VectorLayerHelper from '@components/helpers/VectorLayerHelper' + // 鍒濆鍖栨樉绀� -import '@components/plugin/PathDrag' + import MapConfig from '@/conf/MapConfig' import '@components/plugin/PathDashFlow' // 娴佸姩绾垮浘 import DownLoad from '@components/plugin/DownLoad' @@ -17,7 +16,8 @@ import '@/components/plugin/magicMarker.css' import '@components/plugin/pulse/Pulse' // marker 澶栧湀娉� import '@components/plugin/pulse/Pulse.css' // marker 澶栧湀娉� css - +import BasemapHelper from '@components/helpers/BasemapHelper' +import VectorLayerHelper from '@components/helpers/VectorLayerHelper' let map = null const L = window.L const initMap = (div, mapOption) => { diff --git a/src/components/BaseNav/PublicBounced/PublicBounced.vue b/src/components/BaseNav/PublicBounced/PublicBounced.vue index 8d23b01..18a3f0d 100644 --- a/src/components/BaseNav/PublicBounced/PublicBounced.vue +++ b/src/components/BaseNav/PublicBounced/PublicBounced.vue @@ -58,11 +58,6 @@ // getGasQueryOnlineMonData: [] } }, - mounted () { - this.$nextTick(() => { - console.log(this.$refs.publicBounced) - }) - }, methods: { closePopup () { this.flag = false @@ -105,7 +100,7 @@ .public-bounced { z-index: 2000; position: absolute; - top: 15%; + top: 45%; left: 20%; .public-bounced-title { diff --git a/src/components/LayerController/logic/SolidWaste.js b/src/components/LayerController/logic/SolidWaste.js index 91a6455..8f9e12b 100644 --- a/src/components/LayerController/logic/SolidWaste.js +++ b/src/components/LayerController/logic/SolidWaste.js @@ -4,7 +4,7 @@ // 鍖哄垎涓嶅悓绫诲瀷 浣跨敤涓嶅悓img const defaultImg = '/assets/images/map/solidwaste/voc.png' -const setting = '/assets/images/map/solidwaste/gf_green.png' +const setting = '/assets/images/map/solidwaste/gf_green2.png' // 璇锋眰鎺ュ彛鏁版嵁 const mapApi = require('../../../api/mapApi').default @@ -88,7 +88,7 @@ // 閫氳繃鏂规硶 鍚戠粦瀹氬脊妗嗕紶閫掓暟鎹� instance.setData(resultBasic.Result.DataInfo, resultDetailed.Result.DataInfo, 'gufei') /* flyTo()寮瑰嚭妗嗗钩绉讳簨浠� */ - this.setPanTo(e.latlng, 80) + this.setPanTo(e.latlng, 200) } // flayTo() 寮规鐨勫彲婊戝姩浜嬩欢 diff --git a/src/components/LayerController/modules/LcBaseMap.vue b/src/components/LayerController/modules/LcBaseMap.vue index 801148f..87c3621 100644 --- a/src/components/LayerController/modules/LcBaseMap.vue +++ b/src/components/LayerController/modules/LcBaseMap.vue @@ -30,13 +30,14 @@ methods: { updateBasemapList () { this.basemapList = this.basemapHelper.getBasemapList() - console.log(this.basemapList) + // console.log(this.basemapList) }, changeBasemap (itm) { + // console.log(itm) const code = itm.code this.basemapList.forEach((item) => { if (item.code === code) { - console.log(this.currentBaseMapCode) + // console.log(this.currentBaseMapCode) if (this.currentBaseMapCode == null || this.currentBaseMapCode !== code) { this.currentBaseMapCode = code this.basemapHelper.showBasemap(item.code, item.conf.annotationCheck, true) diff --git a/src/components/helpers/BasemapHelper.js b/src/components/helpers/BasemapHelper.js index 49af53e..9fc4059 100644 --- a/src/components/helpers/BasemapHelper.js +++ b/src/components/helpers/BasemapHelper.js @@ -1,6 +1,6 @@ /* eslint-disable no-debugger */ import AjaxUtils from '@/utils/AjaxUtils' -import * as utils from '../../utils/utils' +// import * as utils from '../../utils/utils' /** * 搴曞浘绠$悊鍔╂墜锛岃礋璐e簳鍥惧垱寤哄強寮�鍏� */ @@ -79,10 +79,8 @@ const internetBasemaps = config.mapConfig.InternetBaseMaps for (let i = 0, len = internetBasemaps.length; i < len; ++i) { const basemapConfig = internetBasemaps[i] - const mapToken = utils.getRandomTDTToken() - const mapUrl = utils.changeURLArg(basemapConfig.map.url, 'tk', mapToken) - const basemapLayer = this.L.tileLayer(mapUrl, basemapConfig.map.option) - const basemapAnnotationLayer = this.L.tileLayer(mapUrl, basemapConfig.annotation.option) + const basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option) + const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option) const basemap = { code: basemapConfig.code, diff --git a/src/components/panel/ToolBoxPanel.vue b/src/components/panel/ToolBoxPanel.vue index 1e62696..585dba3 100644 --- a/src/components/panel/ToolBoxPanel.vue +++ b/src/components/panel/ToolBoxPanel.vue @@ -278,7 +278,6 @@ }) }, methods: { - init (map) { this.map = map this.toolBoxPanelVisible = true @@ -288,7 +287,7 @@ this.drawLayer = this.L.layerGroup().addTo(this.map) } this.active = index - console.log(this.basemapList) + // console.log(this.basemapList) for (let i = 0; i < this.isShow.length; i++) { if (i !== index) { this.isShow[i] = false diff --git a/src/components/plugin/PathDrag.js b/src/components/plugin/PathDrag.js index 4566b86..4916866 100644 --- a/src/components/plugin/PathDrag.js +++ b/src/components/plugin/PathDrag.js @@ -136,4 +136,4 @@ }); } -}); \ No newline at end of file +}); diff --git a/src/conf/MapConfig.js b/src/conf/MapConfig.js index 6e6ea34..445e160 100644 --- a/src/conf/MapConfig.js +++ b/src/conf/MapConfig.js @@ -45,10 +45,6 @@ } // 姹¢洦姘村浘灞傞厤缃� } -const mapTokenArray = ['5d76218063082952d18b76da5005f490', - 'f1b72b5e7cb1175acddfa485f1bc9770', - 'ac8bbce8119b337d75d4b06696f6186d', - '9bf834ce1ba3ba01c568147e9bfcab7c'] /** * 鍐呯綉GIS锛岃幏鍙杢oken鍙傛暟 */ @@ -84,7 +80,7 @@ mapOptions, mapConfig, TokenConfig, - BLUEMAP_HOST, - mapTokenArray + BLUEMAP_HOST + // mapTokenArray // MagicMaker } diff --git a/src/conf/TDT.js b/src/conf/TDT.js index b91a337..5a02c16 100644 --- a/src/conf/TDT.js +++ b/src/conf/TDT.js @@ -1,7 +1,15 @@ // basemap涓绘満閰嶇疆 + const SINOPEC_GIS_HOST = 'http://10.246.132.249:8080' // 鍐呯綉澶╁湴鍥句富鏈哄湴鍧� const TIANDITU_GIS_HOST = 'http://t0.tianditu.gov.cn' // 鍏綉澶╁湴鍥句富鏈哄湴鍧� -const TIANDITU_GIS_TOKEN = '5d76218063082952d18b76da5005f490' // 澶囩敤tk: f1b72b5e7cb1175acddfa485f1bc9770 + +const mapTokenArray = ['5d76218063082952d18b76da5005f490', + 'f1b72b5e7cb1175acddfa485f1bc9770', + 'ac8bbce8119b337d75d4b06696f6186d', + '9bf834ce1ba3ba01c568147e9bfcab7c'] + +const TIANDITU_GIS_TOKEN = mapTokenArray[Math.floor(Math.random() * mapTokenArray.length)] // 澶囩敤tk: f1b72b5e7cb1175acddfa485f1bc9770 + const intranet = [ { code: 'tianditu_img', diff --git a/src/main.js b/src/main.js index 4c254ad..2337442 100644 --- a/src/main.js +++ b/src/main.js @@ -15,6 +15,7 @@ import '@/utils/dialogDrag.js' import '@components/plugin/leaflet-measure-path/leaflet-measure-path.css' import '@components/plugin/leaflet-measure-path/leaflet-measure-path' +import '@components/plugin/PathDrag' const appConfig = require('@/app.config') Vue.config.productionTip = false diff --git a/src/utils/utils.js b/src/utils/utils.js index def6f2a..8ace9bb 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -4,7 +4,6 @@ * arg_val 鏇挎崲鍚庣殑鍙傛暟鐨勫�� * return url 鍙傛暟鏇挎崲鍚庣殑url */ -import MapConfig from '../conf/MapConfig' export function changeURLArg (url, arg, argValue) { var pattern = arg + '=([^&]*)' var replaceText = arg + '=' + argValue @@ -22,7 +21,4 @@ } // eslint-disable-next-line no-unreachable return url + '\n' + arg + '\n' + argValue -} -export function getRandomTDTToken () { - return MapConfig.mapTokenArray[Math.floor(Math.random() * MapConfig.mapTokenArray.length)] } -- Gitblit v1.8.0