派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-12 68d9f6b85690aa6402a69a1bc748be7129f39ed1
功能底图切换标注
1个文件已添加
12个文件已修改
60 ■■■■■ 已修改文件
public/assets/images/map/solidwaste/gf_green.png 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/solidwaste/gf_green2.png 补丁 | 查看 | 原始文档 | blame | 历史
src/Sgis.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/BaseNav/PublicBounced/PublicBounced.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/logic/SolidWaste.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/LayerController/modules/LcBaseMap.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/helpers/BasemapHelper.js 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/panel/ToolBoxPanel.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/plugin/PathDrag.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/MapConfig.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/conf/TDT.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/assets/images/map/solidwaste/gf_green.png

public/assets/images/map/solidwaste/gf_green2.png
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) => {
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 {
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() 弹框的可滑动事件
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)
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'
/**
 * 底图管理助手,负责底图创建及开关
 */
@@ -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,
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
src/components/plugin/PathDrag.js
@@ -136,4 +136,4 @@
    });
  }
});
});
src/conf/MapConfig.js
@@ -45,10 +45,6 @@
  } // 污雨水图层配置
}
const mapTokenArray = ['5d76218063082952d18b76da5005f490',
  'f1b72b5e7cb1175acddfa485f1bc9770',
  'ac8bbce8119b337d75d4b06696f6186d',
  '9bf834ce1ba3ba01c568147e9bfcab7c']
/**
 * 内网GIS,获取token参数
 */
@@ -84,7 +80,7 @@
  mapOptions,
  mapConfig,
  TokenConfig,
  BLUEMAP_HOST,
  mapTokenArray
  BLUEMAP_HOST
  // mapTokenArray
  // MagicMaker
}
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',
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
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)]
}