15个文件已删除
1个文件已添加
30个文件已修改
New file |
| | |
| | | module.exports = { |
| | | root: true, |
| | | env: { |
| | | node: true |
| | | }, |
| | | extends: [ |
| | | 'plugin:vue/essential', |
| | | '@vue/standard' |
| | | ], |
| | | parserOptions: { |
| | | parser: 'babel-eslint' |
| | | }, |
| | | rules: { |
| | | 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', |
| | | 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off' |
| | | }, |
| | | overrides: [ |
| | | { |
| | | files: [ |
| | | '**/__tests__/*.{j,t}s?(x)', |
| | | '**/tests/unit/**/*.spec.{j,t}s?(x)' |
| | | ], |
| | | env: { |
| | | mocha: true |
| | | } |
| | | } |
| | | ] |
| | | } |
| | |
| | | // const path = require('path') |
| | | // |
| | | // function resolveSrc(_path) { |
| | | // return path.join(__dirname, _path) |
| | | // } |
| | | // |
| | | // const aliases = { |
| | | // '@src': 'src', |
| | | // '@router': 'src/router', |
| | | // '@views': 'src/views', |
| | | // '@components': 'src/components', |
| | | // '@assets': 'src/assets', |
| | | // '@utils': 'src/utils', |
| | | // '@styles': 'src/styles' |
| | | // } |
| | | // |
| | | // module.exports = { |
| | | // webpack: {}, |
| | | // jest: {} |
| | | // } |
| | | // |
| | | // for (const alias in aliases) { |
| | | // module.exports.webpack[alias] = resolveSrc(aliases[alias]) |
| | | // module.exports.jest['^' + alias + '/(.*)$'] = |
| | | // '<rootDir>/' + aliases[alias] + '/$1' |
| | | // } |
| | | const path = require('path') |
| | | |
| | | function resolveSrc(_path) { |
| | | return path.join(__dirname, _path) |
| | | } |
| | | |
| | | const aliases = { |
| | | '@src': 'src', |
| | | '@router': 'src/router', |
| | | '@views': 'src/views', |
| | | '@components': 'src/components', |
| | | '@assets': 'src/assets', |
| | | '@utils': 'src/utils', |
| | | '@styles': 'src/styles' |
| | | } |
| | | |
| | | module.exports = { |
| | | webpack: {}, |
| | | jest: {} |
| | | } |
| | | |
| | | for (const alias in aliases) { |
| | | module.exports.webpack[alias] = resolveSrc(aliases[alias]) |
| | | module.exports.jest['^' + alias + '/(.*)$'] = |
| | | '<rootDir>/' + aliases[alias] + '/$1' |
| | | } |
| | |
| | | "private": true, |
| | | "scripts": { |
| | | "serve": "vue-cli-service serve", |
| | | "build": "vue-cli-service build", |
| | | "serve-test": "vue-cli-service serve --mode test", |
| | | "serve-production": "vue-cli-service serve --mode production", |
| | | "build": "vue-cli-service build --mode development", |
| | | "build-test": "vue-cli-service build --mode test", |
| | | "build-production": "vue-cli-service build --mode production", |
| | | "lint": "vue-cli-service lint" |
| | | }, |
| | | "dependencies": { |
| | |
| | | "@vue/cli-plugin-babel": "~4.5.0", |
| | | "@vue/cli-plugin-eslint": "~4.5.0", |
| | | "@vue/cli-service": "~4.5.0", |
| | | "@vue/eslint-config-standard": "^5.1.2", |
| | | "babel-eslint": "^10.1.0", |
| | | "babel-loader": "^8.2.2", |
| | | "cache-loader": "^4.1.0", |
| | | "css-loader": "^5.0.1", |
| | | "eslint": "^6.7.2", |
| | | "eslint-plugin-vue": "^6.2.2", |
| | | "eslint-plugin-import": "^2.20.2", |
| | | "eslint-plugin-node": "^11.1.0", |
| | | "eslint-plugin-promise": "^4.2.1", |
| | | "eslint-plugin-standard": "^4.0.0", |
| | | "mockjs": "^1.1.0", |
| | | "less": "^3.13.0", |
| | | "less-loader": "^7.1.0", |
| | | "vue-loader": "^15.9.5", |
| | | "vue-template-compiler": "^2.6.11" |
| | | }, |
| | | "eslintConfig": { |
| | | "root": true, |
| | | "env": { |
| | | "node": true |
| | | }, |
| | | "extends": [ |
| | | "plugin:vue/essential", |
| | | "eslint:recommended" |
| | | ], |
| | | "parserOptions": { |
| | | "parser": "babel-eslint" |
| | | }, |
| | | "rules": {} |
| | | }, |
| | | "browserslist": [ |
| | | "> 1%", |
| | |
| | | this.layerHandler.clearLayers() |
| | | } |
| | | |
| | | let features = [] |
| | | const features = [] |
| | | |
| | | // 依据加载方式加载数据 |
| | | if(this.layerLoadType === BaseVectorLayer.LOAD_TYPE_JSON) { |
| | | this.features = this._loadFromJSON() |
| | | |
| | | }else if(this.layerLoadType === BaseVectorLayer.LOAD_TYPE_URL) { |
| | | this.features = this._loadFromURL() |
| | | }else { |
| | |
| | | _loadFromJSON(){ |
| | | console.log('该方法是抽象方法,在子类尚未实现!') |
| | | } |
| | | |
| | | _loadFromURL(){ |
| | | console.log('该方法是抽象方法,在子类尚未实现!') |
| | | } |
| | |
| | | if(typeof groups !== 'undefined') { // 如果传递了groups, 则按分组的要求加载图层 |
| | | if(this.layerHandler) { |
| | | for(let i = 0, len = groups.length; i < len; i++) { |
| | | let gFeaturesArray = this.featuresGroup.get(groups[i]) |
| | | const gFeaturesArray = this.featuresGroup.get(groups[i]) |
| | | if(gFeaturesArray || gFeaturesArray.length > 0){ |
| | | gFeaturesArray.forEach(element => { |
| | | this.layerHandler.removeLayer(element) // 避免被重复加载 |
| | | this.layerHandler.addLayer(element) |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | if(typeof groups !== 'undefined') { // 如果传递了groups, 则按分组的要求加载图层 |
| | | if(this.layerHandler) { |
| | | for(let i = 0, len = groups.length; i < len; i++) { |
| | | let gFeaturesArray = this.featuresGroup.get(groups[i]) |
| | | const gFeaturesArray = this.featuresGroup.get(groups[i]) |
| | | if(gFeaturesArray || gFeaturesArray.length > 0){ |
| | | gFeaturesArray.forEach(element => { |
| | | this.layerHandler.removeLayer(element) |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .frontMap{ |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .floatPanel{ |
| | | position: absolute; |
| | | top: 5px; |
| | |
| | | width: 94px; |
| | | height: 32px; |
| | | } |
| | | |
| | | .basemapLayer{ |
| | | border: lightgray 1px solid; |
| | | } |
| | | |
| | | .basemapLayerItem{ |
| | | width: 26px; |
| | | height: 26px; |
| | |
| | | <template> |
| | | <div class="float-panel"> |
| | | <!-- <i class="horn horn-tl"></i> --> |
| | | <!-- <i class="horn horn-tr"></i> --> |
| | | <i class="horn horn-br"></i> |
| | | <i class="horn horn-bl"></i> |
| | | |
| | | <div class="head title-border"> |
| | | <div class="title-text-border"> |
| | | <div class="title-icon"></div> |
| | | <div class="title-text">业务看板</div> |
| | | <div class="title-button" :class="{'switch-head-up':true, 'switch-head-down': !panelSwitch.main}" @click="switchPanel"> |
| | | <div class="title-button" :class="{'switch-head-up':true, 'switch-head-down': !panelSwitch.main}" |
| | | @click="switchPanel"> |
| | | <!-- <i class="el-icon-arrow-down"></i> --> |
| | | </div> |
| | | </div> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import api from './LayerControllerAPI' |
| | | // import { mapState, mapMutations } from 'vuex' |
| | | import '@assets/css/map/magic.min.css' |
| | | import presets from './layerControllerPresets' |
| | | // import $ from 'jquery' |
| | | |
| | | import iconSetting from '@/assets/images/map-pages/icon/setting.png' |
| | | |
| | |
| | | mounted() { |
| | | this.$nextTick(function() { |
| | | this.init() |
| | | console.log(api) |
| | | }) |
| | | }, |
| | | methods: { |
| | |
| | | }, |
| | | initPreset() { |
| | | if (this.preset !== 'default') { |
| | | let prmPreset = presets[this.preset] |
| | | const prmPreset = presets[this.preset] |
| | | Object.assign(this.layerControllerVisible, prmPreset) // 防止预设参数与默认参数不一致导致报错,如果没有按照您的配置发生改变,请检查拼写是否正确 |
| | | if (prmPreset === 'undefined') { |
| | | console.log('该图层控制面板的预设没有找到,请检查预设名称是否正确!') |
| | | } else { |
| | | this.$store.commit('updateLayerControllerVisible', this.layerControllerVisible); |
| | | this.$store.commit('updateLayerControllerVisible', this.layerControllerVisible) |
| | | } |
| | | } |
| | | }, |
| | |
| | | } else { |
| | | this.height = '0px' |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | height: auto; |
| | | font-size: 11px; |
| | | z-index: 1000; |
| | | |
| | | div{ |
| | | color:#90c8e0; |
| | | } |
| | | |
| | | #panelInnerContent{ |
| | | overflow: hidden; |
| | | transition: all 0.5s linear; |
| | | } |
| | | |
| | | .title-border{ |
| | | width: 100%; |
| | | height: 28px; |
| | |
| | | clip-path: polygon(0px 0px, 0px 28px, 230px 28px, 230px 9px, 95px 9px, 86px 0px); |
| | | position: relative; |
| | | } |
| | | |
| | | .title-border:before { |
| | | content: ""; |
| | | display: block; |
| | |
| | | left: 0; |
| | | background-color: #38c8ef; |
| | | } |
| | | |
| | | .title-border:after { |
| | | content: ""; |
| | | display: block; |
| | |
| | | -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: 100%; |
| | | height: 28px; |
| | |
| | | -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; |
| | |
| | | margin-left: 2px; |
| | | background-image: url(/assets/images/map-pages/icon/setting.png); |
| | | } |
| | | |
| | | .title-text{ |
| | | float: left; |
| | | width: 150px; |
| | |
| | | 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; |
| | |
| | | line-height: 5px; |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .title-point{ |
| | | display: inline-block; |
| | | width: 5px; |
| | |
| | | line-height: 5px; |
| | | vertical-align: middle; |
| | | } |
| | | |
| | | .title-button{ |
| | | float: right; |
| | | width: 28px; |
| | | height: 28px; |
| | | cursor: pointer; |
| | | |
| | | :hover{ |
| | | font-weight: bold; |
| | | color: white; |
| | |
| | | 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; |
| | |
| | | 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) center center no-repeat; |
| | | left: -1px; |
| | | top: -1px; |
| | | } |
| | | |
| | | .horn-tr{ |
| | | background-image: url(/assets/images/map-pages/cosmetics/horn_tr.png) center center no-repeat; |
| | | right: -1px; |
| | | top: -1px; |
| | | } |
| | | |
| | | .horn-bl{ |
| | | background-image: url(/assets/images/map-pages/cosmetics/horn_bl.png) center center no-repeat; |
| | | left: -1px; |
| | | bottom: -1px; |
| | | } |
| | | |
| | | .horn-br{ |
| | | background-image: url(/assets/images/map-pages/cosmetics/horn_br.png) center center no-repeat; |
| | | right: -1px; |
| | | bottom: -1px; |
| | | } |
| | | |
| | | ::-webkit-scrollbar{ |
| | | width: 7px; |
| | | height: 5px !important; |
| | | } |
| | | |
| | | ::-webkit-scrollbar-thumb { |
| | | /*滚动条里面小方块*/ |
| | | border-radius: 10px; |
| | |
| | | background : #0661AE; |
| | | border: 1px solid transparent; |
| | | } |
| | | |
| | | ::-webkit-scrollbar-track { |
| | | /*滚动条里面轨道*/ |
| | | // box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2); |
| | |
| | | /** |
| | | * 大图图层控制面板的显示预设 |
| | | */ |
| | | let bigmapPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true, // 爸爸栏目:是否显示图层控制面板 |
| | | const bigmapPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true // 爸爸栏目:是否显示图层控制面板 |
| | | } |
| | | |
| | | /** |
| | | * 综合报警图层控制面板的显示预设 |
| | | */ |
| | | let warningPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true, // 爸爸栏目:是否显示图层控制面板 |
| | | const warningPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true // 爸爸栏目:是否显示图层控制面板 |
| | | } |
| | | |
| | | /** |
| | | * 综合报警图层控制面板的显示预设 |
| | | */ |
| | | let vehicleWarningPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true, // 爸爸栏目:是否显示图层控制面板 |
| | | const vehicleWarningPreset = { // 图层控制面板的显示状态›› |
| | | layerController: true // 爸爸栏目:是否显示图层控制面板 |
| | | } |
| | | |
| | | export default { |
| | |
| | | <template> |
| | | <div class="inner-panel"> |
| | | <div class="inner-panel" v-show="isShow"> |
| | | <div v-for="item in basemapList" :key="item.code" class="basemap-layer-item"> |
| | | <el-checkbox style="position: absolute;" name="basemap" v-model="selectedBasemap" :value="item.code" label="item.code" @change="changeBasemap">标注</el-checkbox> |
| | | <!-- <el-popover--> |
| | | <!-- placement="top-start"--> |
| | | <!-- trigger="hover"--> |
| | | <!-- content="item.name">--> |
| | | <img :src="item.conf.icon_actived" width="50" height="50" :title="item.name" @click="changeBasemap"/> |
| | | <!-- </el-popover>--> |
| | | <div style="display: flex;"> |
| | | <el-checkbox :src="item.conf.icon_actived" style="display: flex;" name="basemap" v-model="selectedBasemap" |
| | | :value="item.code" label="item.code" @change="changeBasemap">标注 |
| | | </el-checkbox> |
| | | <img style="position: absolute;" :src="item.conf.icon_actived" width="50" height="50" :title="item.name" |
| | | @click="changeBasemap"/> |
| | | </div> |
| | | |
| | | |
| | | <!-- <input style="position: absolute;" type="radio" name="basemap" v-model="selectedBasemap" :value="item.code" title="显示标注" @change="changeBasemap"/>标注--> |
| | | |
| | | </div> |
| | |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | isShow: true, |
| | | basemapList: [], |
| | | selectedBasemap: "tianditu_img", |
| | | }; |
| | |
| | | mounted() { |
| | | }, |
| | | methods: { |
| | | toggleShow() { |
| | | this.isShow = !this.isShow |
| | | }, |
| | | updateBasemapList() { |
| | | let list = this.basemapHelper.getBasemapList(); |
| | | this.basemapList = list; |
| | |
| | | changeBasemap() { |
| | | this.basemapHelper.showBasemap(this.selectedBasemap, true) |
| | | }, |
| | | }, |
| | | watch: { |
| | | basemapHelper(newVal) { |
| | | if (newVal != null) { |
| | | this.updateBasemapList(); |
| | | } |
| | | |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | |
| | | justify-content: center; |
| | | align-items: center; |
| | | } |
| | | |
| | | .basemap-layer-item { |
| | | display: flex; |
| | | width: 50px; |
| | |
| | | left: 0px; |
| | | top: -53px; |
| | | } |
| | | |
| | | .basemap-layer-item-name { |
| | | position: relative; |
| | | left: 0px; |
| | |
| | | <div class="wms-panel"> |
| | | <div v-for="item in serviceWmsLayerList" :key="item.code" class="layerbox"> |
| | | <div><input type="checkbox" :name="'wmsLayer_'+item.code" :checked="item.checked" :value="item.code" |
| | | @change="swAllLayers(item)"/>{{item.name}} <span @click="swFilter(item)" class="btn-filter">过滤</span> |
| | | @change="swAllLayers(item)"/>{{ item.name }} <span @click="swFilter(item)" |
| | | class="btn-filter">过滤</span> |
| | | </div> |
| | | <div class="layerbox-item"> |
| | | <div class="basemap-layer-item" v-for="itm in item.layers" :key="itm.code"><input type="checkbox" |
| | |
| | | /* eslint-disable no-debugger */ |
| | | import AjaxUtils from '@/utils/AjaxUtils' |
| | | |
| | | /** |
| | | * 底图管理助手,负责底图创建及开关 |
| | | */ |
| | |
| | | */ |
| | | initBasemap = (mapConfig, isIntranet) => { |
| | | if(isIntranet) { // 内网 |
| | | this._getToken(mapConfig); // 获取token后,并按配置加载地图 |
| | | this._getToken(mapConfig) // 获取token后,并按配置加载地图 |
| | | }else { // 外网 |
| | | this._createBasemapByConfig(mapConfig) |
| | | } |
| | |
| | | * @param isHideOthers 是否先关闭其他图层,默认是true |
| | | */ |
| | | showBasemap = (code, isHideOthers = true) => { |
| | | let basemap = this.basemapMap.get(code) |
| | | const basemap = this.basemapMap.get(code) |
| | | if(isHideOthers) { |
| | | for(let i = 0, len = this.basemapList.length; i < len; ++i){ |
| | | this.map.removeLayer(this.basemapList[i].layer) |
| | |
| | | * @param layer 待关闭图层引用 |
| | | */ |
| | | hideBasemap = (code) => { |
| | | let basemap = this.basemapMap.get(code) |
| | | const basemap = this.basemapMap.get(code) |
| | | this.map.removeLayer(basemap.layer) |
| | | this.map.removeLayer(basemap.annotation) |
| | | } |
| | | |
| | | // 公网创建地图部分 |
| | | _createBasemapByConfig(mapConfig){ |
| | | let internetBasemaps = mapConfig.mapConfig.InternetBaseMaps |
| | | const internetBasemaps = mapConfig.mapConfig.InternetBaseMaps |
| | | for(let i = 0, len = internetBasemaps.length; i < len; ++i) { |
| | | let basemapConfig = internetBasemaps[i] |
| | | let basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option) |
| | | let basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option) |
| | | const basemapConfig = internetBasemaps[i] |
| | | const basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option) |
| | | const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option) |
| | | |
| | | let basemap = { |
| | | const basemap = { |
| | | code: basemapConfig.code, |
| | | name: basemapConfig.name, |
| | | conf: basemapConfig, |
| | |
| | | annotation: basemapAnnotationLayer |
| | | } |
| | | |
| | | this.basemapList.push(basemap); |
| | | this.basemapList.push(basemap) |
| | | this.basemapMap.set(basemapConfig.code, basemap) |
| | | if(typeof basemapConfig.isAddToMap !== 'undefined' && basemapConfig.isAddToMap) { |
| | | this.basemapLayerGroup.addLayer(basemapLayer) |
| | |
| | | // 内网地图创建部分 |
| | | // 获取内网地图token,并加载到地图中 |
| | | _getToken = (mapConfig) => { |
| | | let params = mapConfig.TokenConfig |
| | | const params = mapConfig.TokenConfig |
| | | AjaxUtils.GetDataAsynByUrl(params.url, params.option, (token) => { |
| | | this._showTDT(token, mapConfig) |
| | | }) |
| | |
| | | |
| | | // 内网地图加载,并加载到地图 |
| | | _showTDT = (token, mapConfig) => { |
| | | let intranetBasemaps = mapConfig.mapConfig.IntranetBaseMaps |
| | | const intranetBasemaps = mapConfig.mapConfig.IntranetBaseMaps |
| | | for(let i = 0, len = intranetBasemaps.length; i < len; ++i) { |
| | | let basemapConfig = intranetBasemaps[i] |
| | | let basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option) |
| | | let basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option) |
| | | const basemapConfig = intranetBasemaps[i] |
| | | const basemapLayer = this.L.tileLayer(basemapConfig.map.url, basemapConfig.map.option) |
| | | const basemapAnnotationLayer = this.L.tileLayer(basemapConfig.annotation.url, basemapConfig.annotation.option) |
| | | |
| | | let basemap = { |
| | | const basemap = { |
| | | code: basemapConfig.code, |
| | | name: basemapConfig.name, |
| | | conf: basemapConfig, |
| | |
| | | annotation: basemapAnnotationLayer |
| | | } |
| | | |
| | | this.basemapList.push(basemap); |
| | | this.basemapList.push(basemap) |
| | | this.basemapMap.set(basemapConfig.code, basemap) |
| | | if(typeof basemapConfig.isAddToMap !== 'undefined' && basemapConfig.isAddToMap) { |
| | | this.basemapLayerGroup.addLayer(basemapLayer) |
| | |
| | | _loadLayers(mapConfig, isAddToMap = true) { |
| | | console.debug('ServiceLayerHelper加载参数:', mapConfig) |
| | | for (let i = 0, len = mapConfig.mapConfig.ServiceLayers.length; i < len; ++i) { |
| | | let opt = mapConfig.mapConfig.ServiceLayers[i] |
| | | const opt = mapConfig.mapConfig.ServiceLayers[i] |
| | | if (opt.type === 'wmts') { |
| | | this.loadWmtsLayer(opt, isAddToMap, mapConfig.mapConfig.ServiceLayers[i]) |
| | | } else if (opt.type === 'wms') { |
| | |
| | | * @param {*} isAddToMap |
| | | */ |
| | | loadWmtsLayer(options, isAddToMap = true, config) { |
| | | const layer = this.L.tileLayer(options.url, options.option); |
| | | const layer = this.L.tileLayer(options.url, options.option) |
| | | layer.config = config |
| | | |
| | | if (isAddToMap) { |
| | |
| | | * @param {*} isAddToMap |
| | | */ |
| | | loadWmsLayer(options, isAddToMap = true, config) { |
| | | const layer = this.L.tileLayer.wms(options.url, options.option); |
| | | const layer = this.L.tileLayer.wms(options.url, options.option) |
| | | layer.config = config |
| | | |
| | | if (isAddToMap) { |
| | |
| | | loadTileLayer(options, isAddToMap = true, config) { |
| | | const layer = this.L.tileLayer(options.url, { |
| | | layers: options.layers || 'all',//country |
| | | format: options.format || "image/png", |
| | | format: options.format || 'image/png', |
| | | transparent: options.true || true, |
| | | crs: options.crs || L.CRS.EPSG4326, |
| | | maxZoom: options.maxZoom || 21, |
| | | minZoom: options.minZoom || 1, |
| | | zoomOffset: options.zoomOffset || 0 |
| | | }); |
| | | }) |
| | | layer.config = config |
| | | |
| | | if (isAddToMap) { |
| | |
| | | */ |
| | | hideTileLayer(code) { |
| | | if (this.tileLayersMap) { |
| | | let tileLayer = this.tileLayersMap.get(code) |
| | | const tileLayer = this.tileLayersMap.get(code) |
| | | this.map.removeLayer(tileLayer) |
| | | } |
| | | } |
| | |
| | | */ |
| | | showTileLayer(code) { |
| | | if (this.tileLayersMap) { |
| | | let tileLayer = this.tileLayersMap.get(code) |
| | | const tileLayer = this.tileLayersMap.get(code) |
| | | this.map.addLayer(tileLayer) |
| | | } |
| | | } |
| | |
| | | * @param {} code wms服务配置的code |
| | | */ |
| | | getWMSConfig(code) { |
| | | let mc = this.mapConfig |
| | | 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] |
| | |
| | | * @param name 图层名称 |
| | | */ |
| | | this.showVectorLayer = (code) => { |
| | | let layer = this.vectorLayerMap.get(code) |
| | | const layer = this.vectorLayerMap.get(code) |
| | | this.map.addLayer(layer) |
| | | } |
| | | |
| | |
| | | * @param name 图层名称 |
| | | */ |
| | | this.hideVectorLayer = (code) => { |
| | | let layer = this.vectorLayerMap.get(code) |
| | | const layer = this.vectorLayerMap.get(code) |
| | | this.map.removeLayer(layer) |
| | | } |
| | | } |
| | |
| | | import L from 'leaflet' |
| | | |
| | | import MapConfig from '@/conf/MapConfig' |
| | | |
| | | const tokenStr = 'tk=' + 'f1b72b5e7cb1175acddfa485f1bc9770' + '&' |
| | | |
| | | class CommonLayerLoad { |
| | | // 中国蓝色覆盖层 |
| | | loadBlueMap() { |
| | |
| | | |
| | | }) |
| | | } |
| | | |
| | | // 道路路 |
| | | loadNormalMap() { |
| | | return L.tileLayer('http://t0.tianditu.gov.cn/vec_c/wmts?' + tokenStr + |
| | |
| | | zoomOffset: 1 |
| | | }) |
| | | } |
| | | |
| | | // 道路标注 |
| | | loadNormalMapa() { |
| | | return L.tileLayer('http://t0.tianditu.gov.cn/cva_c/wmts?' + tokenStr + |
| | |
| | | |
| | | }) |
| | | } |
| | | |
| | | // 影像图 |
| | | loadImgMapm() { |
| | | return L.tileLayer('http://t0.tianditu.gov.cn/img_c/wmts?' + tokenStr + |
| | |
| | | zoomOffset: 1 |
| | | }) |
| | | } |
| | | |
| | | // 影像标注 |
| | | loadImgMapa() { |
| | | return L.tileLayer('http://t0.tianditu.gov.cn/cia_c/wmts?' + tokenStr + |
| | |
| | | zoomOffset: 1 |
| | | }) |
| | | } |
| | | |
| | | // 中石化内网影像图 |
| | | loadIntranetImgMap(token) { |
| | | return L.tileLayer('http://10.246.132.249:8080/OneMapServer/rest/services/base-tdt-image-globe/WMTS?token=' + token + '&' + |
| | |
| | | zoomOffset: 1 |
| | | }) |
| | | } |
| | | |
| | | // 中石化内网影像图标注 |
| | | loadIntranetImgMapCia(token) { |
| | | return L.tileLayer('http://10.246.132.249:8080/OneMapServer/rest/services/base-tdt-label-image/WMTS?token=' + token + '&' + |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | export default CommonLayerLoad |
| | |
| | | import echarts from 'echarts' |
| | | |
| | | function drawSafetyBar(carDataArray, shipDataArray, plateDataArray) { |
| | | let myChart = echarts.init(document.getElementById('safetyBarIndex')) |
| | | const myChart = echarts.init(document.getElementById('safetyBarIndex')) |
| | | myChart.setOption({ |
| | | color: ['#3398DB'], |
| | | tooltip: { |
| | |
| | | } |
| | | ] |
| | | }) |
| | | window.addEventListener('resize', () => { myChart.resize() }) |
| | | window.addEventListener('resize', () => { |
| | | myChart.resize() |
| | | }) |
| | | } |
| | | |
| | | export default { |
| | |
| | | import dayjs from 'dayjs' |
| | | |
| | | function drawSafetyLine() { |
| | | let myChart = echarts.init(document.getElementById('safetyIndex')) |
| | | let yyyy = dayjs().format('YYYY') + '-' |
| | | let resDate = ['07-10', '07-11', '07-12', '07-13', '07-14', '07-15', '07-16'] |
| | | let resValue = [35, 20, 10, 20, 40, 30, 10] |
| | | let safetyStandardValue = 20 |
| | | const myChart = echarts.init(document.getElementById('safetyIndex')) |
| | | const yyyy = dayjs().format('YYYY') + '-' |
| | | const resDate = ['07-10', '07-11', '07-12', '07-13', '07-14', '07-15', '07-16'] |
| | | const resValue = [35, 20, 10, 20, 40, 30, 10] |
| | | const safetyStandardValue = 20 |
| | | myChart.setOption({ |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | } |
| | | ] |
| | | }) |
| | | window.addEventListener('resize', () => { myChart.resize() }) |
| | | window.addEventListener('resize', () => { |
| | | myChart.resize() |
| | | }) |
| | | } |
| | | |
| | | export default { |
| | |
| | | import echarts from 'echarts' |
| | | |
| | | function drawSafetyPie(options) { |
| | | let id = options.id |
| | | const id = options.id |
| | | // var title = options.title |
| | | let series = options.series |
| | | let legend = getLegend(series) |
| | | const legend = getLegend(series) |
| | | series = setSeriesLabel(series) |
| | | let myChart = echarts.init(document.getElementById(id)) |
| | | const myChart = echarts.init(document.getElementById(id)) |
| | | console.log(series) |
| | | console.log(legend) |
| | | // 指定图表的配置项和数据 |
| | | myChart.setOption({ |
| | | series: series |
| | | }) |
| | | window.addEventListener('resize', () => { myChart.resize() }) |
| | | window.addEventListener('resize', () => { |
| | | myChart.resize() |
| | | }) |
| | | } |
| | | |
| | | function setSeriesLabel(series) { |
| | | for (var i = 0; i < series.length; i++) { |
| | | series[i]['label'] = { |
| | | series[i].label = { |
| | | position: 'inside', |
| | | formatter: '{d}%', |
| | | color: '#090607' |
| | |
| | | } |
| | | return legend |
| | | } |
| | | |
| | | export default { |
| | | drawSafetyPie |
| | | } |
| | |
| | | }, |
| | | watch: { |
| | | currentCorpType: async function (val) { |
| | | let params = { |
| | | const params = { |
| | | transNo: '', |
| | | carrierName: '', |
| | | transMode: '', |
| | |
| | | size: 10, |
| | | current: 1 |
| | | } |
| | | let datas = await this.handleGetDatas(params) |
| | | const datas = await this.handleGetDatas(params) |
| | | console.log(datas) |
| | | // this.list = datas.data.records |
| | | // this.total = datas.data.total |
| | | }, |
| | | currentCorp: async function (val) { |
| | | let params = { |
| | | const params = { |
| | | transNo: '', |
| | | carrierName: '', |
| | | transMode: '', |
| | |
| | | size: 10, |
| | | current: 1 |
| | | } |
| | | let datas = await this.handleGetDatas(params) |
| | | const datas = await this.handleGetDatas(params) |
| | | console.log(datas) |
| | | // this.list = datas.data.records |
| | | // this.total = datas.data.total |
| | |
| | | }, |
| | | async handlePage(page) { |
| | | console.log(page) |
| | | let params = { |
| | | const params = { |
| | | transNo: '', |
| | | carrierName: '', |
| | | transMode: '', |
| | |
| | | size: this.pageSize, |
| | | current: page |
| | | } |
| | | let datas = await this.handleGetDatas(params) |
| | | const datas = await this.handleGetDatas(params) |
| | | console.log(datas) |
| | | // this.list = datas.data.records |
| | | // this.total = datas.data.total |
| | |
| | | window.vectorLayerHelper.vectorLayerMap.cheliang.showGeometryByXY(item.transNo, item.vehicleNo, item.lng, item.lat) |
| | | }, |
| | | toggleMonitorPanel() { |
| | | let el = $('.btn-stretch') |
| | | const el = $('.btn-stretch') |
| | | // let cs = 'btn-stretch-active' |
| | | var rightControl = $('#right-panel') |
| | | let right = rightControl.css('right') |
| | | const right = rightControl.css('right') |
| | | if (right === '10px') { |
| | | rightControl.animate({ |
| | | right: '-290px' |
| | | }) |
| | | el.css({ |
| | | 'transform': 'rotateY(180deg)', |
| | | transform: 'rotateY(180deg)', |
| | | 'transform-origin': '50% 50%', |
| | | 'transition': 'transform 1s linear' |
| | | transition: 'transform 1s linear' |
| | | }) |
| | | } else { |
| | | rightControl.animate({ |
| | | right: '10px' |
| | | }) |
| | | el.css({ |
| | | 'transform': 'rotateY(0deg)', |
| | | transform: 'rotateY(0deg)', |
| | | 'transform-origin': '50% 50%', |
| | | 'transition': 'transform 1s linear' |
| | | transition: 'transform 1s linear' |
| | | }) |
| | | } |
| | | }, |
| | | async handleSearch() { |
| | | // this.list = wayBillData.data |
| | | // this.total = wayBillData.data.length |
| | | let params = { |
| | | const params = { |
| | | transNo: this.form.transNo, |
| | | carrierName: this.form.carrierName, |
| | | transMode: this.form.transMode, |
| | |
| | | size: this.pageSize, |
| | | current: this.current |
| | | } |
| | | let datas = await this.handleGetDatas(params) |
| | | const datas = await this.handleGetDatas(params) |
| | | console.log(datas) |
| | | // this.list = datas.data.pager.records |
| | | // this.total = datas.data.pager.total |
| | |
| | | async handleInit() { |
| | | // this.list = wayBillData.data |
| | | // this.total = wayBillData.data.length |
| | | let params = { |
| | | const params = { |
| | | transNo: '', |
| | | carrierName: '', |
| | | transMode: '', |
| | |
| | | size: 10, |
| | | current: 1 |
| | | } |
| | | let datas = await this.handleGetDatas(params) |
| | | const datas = await this.handleGetDatas(params) |
| | | console.log(datas) |
| | | // this.list = datas.data.records |
| | | // this.total = datas.data.total |
| | | }, |
| | | async handleSetOrgCodeStrings() { |
| | | let orgCodes = await this.handleGetOrgCode() |
| | | const orgCodes = await this.handleGetOrgCode() |
| | | let orgCodesString = '' |
| | | for (let i = 0; i < orgCodes.data.length; i++) { |
| | | let org = orgCodes.data[i] |
| | | const org = orgCodes.data[i] |
| | | orgCodesString += org.orgCode + ',' |
| | | } |
| | | this.orgCodeStrings = orgCodesString.substring(0, orgCodesString.length - 1) |
| | | }, |
| | | async handleGetOrgCode() { |
| | | let params = { |
| | | const params = { |
| | | orgSector: this.currentCorpType, |
| | | serviceType: '' |
| | | } |
| | | let datas = await mapApi.getOrganizationompanyList(params) |
| | | const datas = await mapApi.getOrganizationompanyList(params) |
| | | return datas |
| | | }, |
| | | async handleGetDatas(params) { |
| | | // let datas = await mapApi.getTransOrderlist(params) |
| | | |
| | | let datas = params |
| | | const datas = params |
| | | return datas |
| | | }, |
| | | showHZ() { |
| | |
| | | width: 16px; |
| | | height: 22px; |
| | | display: block; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat 0 -90px; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat 0 -90px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .B-TMD-table-list-title-y-car { |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -45px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -45px 0; |
| | | width: 38px; |
| | | height: 38px; |
| | | display: block; |
| | |
| | | } |
| | | |
| | | .B-TMD-table-list-title-y-car-offline { |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -90px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -90px 0; |
| | | width: 38px; |
| | | height: 38px; |
| | | display: block; |
| | |
| | | } |
| | | |
| | | .B-TMD-table-list-title-y-car-warning { |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat 0 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat 0 0; |
| | | width: 38px; |
| | | height: 38px; |
| | | display: block; |
| | |
| | | .btn-stretch { |
| | | width: 20px; |
| | | height: 28px; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -408px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -408px 0; |
| | | margin-left: 10px; |
| | | margin-top: 3px; |
| | | cursor: pointer; |
| | |
| | | } |
| | | |
| | | .btn-stretch-active { |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -440px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -440px 0; |
| | | } |
| | | |
| | | .panel-tab { |
| | |
| | | width: 40px; |
| | | z-index: 500; |
| | | background-color: #030D2E; |
| | | background: url('/assets/images/map-pages/icon/caidan.png') no-repeat; |
| | | background: url('../../assets/images/map-pages/icon/caidan.png') no-repeat; |
| | | } |
| | | |
| | | .B-TMT-tab-div { |
| | |
| | | height: 29px !important; |
| | | margin-top: 0 !important; |
| | | margin-left: 0 !important; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -320px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -320px 0; |
| | | } |
| | | |
| | | .B-TMT-tab-route { |
| | |
| | | height: 19px; |
| | | margin-left: 5px; |
| | | margin-top: 6px; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -169px 0; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -169px 0; |
| | | } |
| | | |
| | | .B-TMT-tab-waybill-isActive, .B-TMT-tab-waybill:hover { |
| | |
| | | height: 29px !important; |
| | | margin-top: 0 !important; |
| | | margin-left: -1px !important; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -361px 0 !important; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -361px 0 !important; |
| | | } |
| | | |
| | | .B-TMT-tab-route-isActive, .B-TMT-tab-route:hover { |
| | |
| | | height: 29px !important; |
| | | margin-top: 0 !important; |
| | | margin-left: -1px !important; |
| | | background: url('/assets/images/map-pages/icon/icon.png') no-repeat -197px 0 !important; |
| | | background: url('../../assets/images/map-pages/icon/icon.png') no-repeat -197px 0 !important; |
| | | } |
| | | |
| | | .panel-tab ul { |
| | |
| | | top: 0; |
| | | right: 0; |
| | | z-index: 999; |
| | | background: url('/assets/images/map-pages/icon/bgc.png') no-repeat; |
| | | background: url('../../assets/images/map-pages/icon/bgc.png') no-repeat; |
| | | } |
| | | |
| | | .panel_searchTotal { |
| | |
| | | color: #34e0ff; |
| | | width: 100%; |
| | | line-height: 25px; |
| | | background: url('/assets/images/map-pages/icon/dd.png') no-repeat; |
| | | background: url('../../assets/images/map-pages/icon/dd.png') no-repeat; |
| | | } |
| | | |
| | | .B-TMD-inp-button { |
| | |
| | | import * as L from 'leaflet' |
| | | |
| | | let curWwwPath = window.document.location.href |
| | | let pathname = window.document.location.pathname |
| | | let pos = curWwwPath.indexOf(pathname) |
| | | let HOST_URL = curWwwPath.substring(0, pos) |
| | | const curWwwPath = window.document.location.href |
| | | const pathname = window.document.location.pathname |
| | | const pos = curWwwPath.indexOf(pathname) |
| | | const HOST_URL = curWwwPath.substring(0, pos) |
| | | |
| | | // basemap主机配置 |
| | | const SINOPEC_GIS_HOST = 'http://10.246.132.249:8080' // 内网天地图主机地址 |
| | |
| | | minZoom: 1, |
| | | zoomOffset: 1 |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | code: 'sinopec_vec', |
| | |
| | | minZoom: 1, |
| | | zoomOffset: 1 |
| | | } |
| | | }, |
| | | } |
| | | }, |
| | | { |
| | | code: 'tianditu_vec', |
| | |
| | | sname:'区域信息', |
| | | checked: true, // 默认选中状态 |
| | | filter:{} |
| | | }, |
| | | } |
| | | ], |
| | | filtersGroup:[ |
| | | { |
| | |
| | | sname:'弯头', |
| | | checked: true, // 默认选中状态 |
| | | geom: GEOM_POINT |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | |
| | | sname:'隔油池', |
| | | checked: true, // 默认选中状态 |
| | | geom: GEOM_POINT |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | |
| | | echarts.registerTheme('dark', echartsDarkTheme) |
| | | |
| | | // 开发环境下加载假数据 |
| | | if (process.env.NODE_ENV === 'development') { |
| | | console.log('当前处于开发模式!') |
| | | if (process.env.VUE_APP_MOCK && process.env.NODE_ENV === 'development') { |
| | | console.warn('当前处于mock数据请求!') |
| | | require('./mock') |
| | | } |
| | | |
| | | window.vm = new Vue({ |
| | | router, |
| | | store, |
| | | render: h => h(App), |
| | | render: h => h(App) |
| | | }).$mount('#app') |
| | |
| | | * } |
| | | */ |
| | | // 默认跳转路由 |
| | | import App from "../App"; |
| | | import PipeLineIndex from "../views/baseInfoMgr/pipeline/PipeLineIndex"; |
| | | import MapTemplate from "../views/MapTemplate"; |
| | | import App from '../App' |
| | | import PipeLineIndex from '../views/baseInfoMgr/pipeline/PipeLineIndex' |
| | | import MapTemplate from '../views/MapTemplate' |
| | | |
| | | // 应用业务相关路由,挂载menu上的page |
| | | export const routes = [{ |
| | |
| | | //set方法 |
| | | |
| | | setDemoValue(state,demoValue){ |
| | | |
| | | state.demoValue = demoValue |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | serviceLayerHelper: {}, // 服务图层控制器实现助手程序 |
| | | vectoryLayerHelper: {}, // 动态图层控制器实现助手程序 |
| | | layerControllerVisible: { // 图层控制面板的显示状态›› |
| | | layerController: true, // 爸爸栏目:是否显示图层控制面板 |
| | | layerController: true // 爸爸栏目:是否显示图层控制面板 |
| | | }, |
| | | showServiceLayerFilter: false, // Service图层过滤器 |
| | | selectedServiceLayer: '', // 使用过滤器时,被打开的WMS服务的CODE |
| | |
| | | data: pData, |
| | | async: true, |
| | | success: function(datas, nnn) { |
| | | console.log(nnn) |
| | | pBackFun(datas) |
| | | }, |
| | | error: function(err, nnnn) { |
| | | console.log(nnnn) |
| | | console.error('数据获取失败', err, pUrl) |
| | | } |
| | | }) |
| | |
| | | data: pData, |
| | | async: true, |
| | | success: function(datas, nnn) { |
| | | console.log(nnn) |
| | | pBackFun(datas) |
| | | }, |
| | | error: function(err, nnnn) { |
| | | console.log(nnnn) |
| | | console.error('数据获取失败', err, pUrl) |
| | | } |
| | | }) |
| | |
| | | timeout: 600000, |
| | | async: true, |
| | | success: function(datas, nnn) { |
| | | console.log(nnn) |
| | | pBackFun(datas) |
| | | }, |
| | | error: function(e, nnnn) { |
| | | console.log(e,nnnn) |
| | | console.error('数据获取失败', pUrl) |
| | | } |
| | | }) |
| | |
| | | timeout: 600000, |
| | | async: true, |
| | | success: function(datas, nnn) { |
| | | console.log(nnn) |
| | | pBackFun(datas) |
| | | }, |
| | | error: function(e, nnnn) { |
| | | console.log(e,nnnn) |
| | | console.error('数据获取失败', pUrl) |
| | | } |
| | | }) |
| | |
| | | data: pData, |
| | | timeout: 600000, |
| | | success: function(datas, nnn) { |
| | | console.log(nnn) |
| | | pBackFun(datas) |
| | | }, |
| | | error: function(e, nnnn) { |
| | | console.log(nnnn) |
| | | // tmpErrJSONTextParse(e, pBackFun) // todo SGIS Server有个WFS图层服务json解析错误, 这里是暂时处理,等过几天黎耀修改好了,这里需要修改回去。 |
| | | console.log('返回的错误信息:', e) |
| | | console.error('数据获取失败', pUrl) |
| | |
| | | 'S+': date.getSeconds().toString() // 秒 |
| | | // 有其他格式化字符需求可以继续添加,必须转化成字符串 |
| | | } |
| | | for (let k in opt) { |
| | | for (const k in opt) { |
| | | ret = new RegExp('(' + k + ')').exec(fmt) |
| | | if (ret) { |
| | | fmt = fmt.replace(ret[1], (ret[1].length === 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0'))) |
| | |
| | | var sqrtMagic = Math.sqrt(magic) |
| | | dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * this.PI) |
| | | dLon = (dLon * 180.0) / (a / sqrtMagic * Math.cos(radLat) * this.PI) |
| | | return { 'lat': dLat, 'lon': dLon } |
| | | return { lat: dLat, lon: dLon } |
| | | }, |
| | | |
| | | // WGS-84 to GCJ-02 |
| | | gcj_encrypt: function(wgsLat, wgsLon) { |
| | | if (this.outOfChina(wgsLat, wgsLon)) { return { 'lat': wgsLat, 'lon': wgsLon } } |
| | | if (this.outOfChina(wgsLat, wgsLon)) { return { lat: wgsLat, lon: wgsLon } } |
| | | |
| | | var d = this.delta(wgsLat, wgsLon) |
| | | return { 'lat': wgsLat + d.lat, 'lon': wgsLon + d.lon } |
| | | return { lat: wgsLat + d.lat, lon: wgsLon + d.lon } |
| | | }, |
| | | // GCJ-02 to WGS-84 |
| | | gcj_decrypt: function(gcjLat, gcjLon) { |
| | | if (this.outOfChina(gcjLat, gcjLon)) { return { 'lat': gcjLat, 'lon': gcjLon } } |
| | | if (this.outOfChina(gcjLat, gcjLon)) { return { lat: gcjLat, lon: gcjLon } } |
| | | |
| | | var d = this.delta(gcjLat, gcjLon) |
| | | return { 'lat': gcjLat - d.lat, 'lon': gcjLon - d.lon } |
| | | return { lat: gcjLat - d.lat, lon: gcjLon - d.lon } |
| | | }, |
| | | // GCJ-02 to WGS-84 exactly |
| | | gcj_decrypt_exact: function(gcjLat, gcjLon) { |
| | | let initDelta = 0.01 |
| | | let threshold = 0.000000001 |
| | | const initDelta = 0.01 |
| | | const threshold = 0.000000001 |
| | | let dLat = initDelta |
| | | let dLon = initDelta |
| | | let mLat = gcjLat - dLat |
| | |
| | | if (++i > 10000) break |
| | | } |
| | | // console.log(i); |
| | | return { 'lat': wgsLat, 'lon': wgsLon } |
| | | return { lat: wgsLat, lon: wgsLon } |
| | | }, |
| | | // GCJ-02 to BD-09 |
| | | bd_encrypt: function(gcjLat, gcjLon) { |
| | | let x = gcjLon |
| | | let y = gcjLat |
| | | let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.x_pi) |
| | | let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.x_pi) |
| | | let bdLon = z * Math.cos(theta) + 0.0065 |
| | | let bdLat = z * Math.sin(theta) + 0.006 |
| | | return { 'lat': bdLat, 'lon': bdLon } |
| | | const x = gcjLon |
| | | const y = gcjLat |
| | | const z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * this.x_pi) |
| | | const theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * this.x_pi) |
| | | const bdLon = z * Math.cos(theta) + 0.0065 |
| | | const bdLat = z * Math.sin(theta) + 0.006 |
| | | return { lat: bdLat, lon: bdLon } |
| | | }, |
| | | // BD-09 to GCJ-02 |
| | | bd_decrypt: function(bdLat, bdLon) { |
| | | let x = bdLon - 0.0065 |
| | | let y = bdLat - 0.006 |
| | | let z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * this.x_pi) |
| | | let theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * this.x_pi) |
| | | let gcjLon = z * Math.cos(theta) |
| | | let gcjLat = z * Math.sin(theta) |
| | | return { 'lat': gcjLat, 'lon': gcjLon } |
| | | const x = bdLon - 0.0065 |
| | | const y = bdLat - 0.006 |
| | | const z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * this.x_pi) |
| | | const theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * this.x_pi) |
| | | const gcjLon = z * Math.cos(theta) |
| | | const gcjLat = z * Math.sin(theta) |
| | | return { lat: gcjLat, lon: gcjLon } |
| | | }, |
| | | // WGS-84 to Web mercator |
| | | // mercatorLat -> y mercatorLon -> x |
| | | mercator_encrypt: function(wgsLat, wgsLon) { |
| | | let x = wgsLon * 20037508.34 / 180.0 |
| | | const x = wgsLon * 20037508.34 / 180.0 |
| | | let y = Math.log(Math.tan((90.0 + wgsLat) * this.PI / 360.0)) / (this.PI / 180.0) |
| | | y = y * 20037508.34 / 180.0 |
| | | return { 'lat': y, 'lon': x } |
| | | return { lat: y, lon: x } |
| | | /* |
| | | if ((Math.abs(wgsLon) > 180 || Math.abs(wgsLat) > 90)) |
| | | return null; |
| | |
| | | var x = mercatorLon / 20037508.34 * 180.0 |
| | | var y = mercatorLat / 20037508.34 * 180.0 |
| | | y = 180 / this.PI * (2 * Math.atan(Math.exp(y * this.PI / 180.0)) - this.PI / 2) |
| | | return { 'lat': y, 'lon': x } |
| | | return { lat: y, lon: x } |
| | | /* |
| | | if (Math.abs(mercatorLon) < 180 && Math.abs(mercatorLat) < 90) |
| | | return null; |
| | |
| | | // 参数名称:authCode 值: 所有:0 化工销售:HXXT; 炼油销售:LXXT; 江苏石油:CPYXT; 销售华东:XSHD |
| | | let SysAuthCode = '0' |
| | | const SysAuthCode = '0' |
| | | /** |
| | | * Created by liangruizhe on 2019/01/14 |
| | | */ |
| | |
| | | <div id="map" ref="rootmap"></div> |
| | | <sgis-layer-controller :preset="'warningPreset'"> |
| | | <lc-basemap></lc-basemap> |
| | | <div class="barline"></div> |
| | | <div class="bar-line"></div> |
| | | <lc-service-layer></lc-service-layer> |
| | | </sgis-layer-controller> |
| | | <lc-service-layer-filter v-show="showServiceLayerFilter" ref="serviceLayerFilter"></lc-service-layer-filter> |
| | |
| | | }, |
| | | methods:{ |
| | | saveMapStatus(){ |
| | | this.$store.commit('setMapObj', this.mapObj); |
| | | this.$store.commit('setBasemapHelper', this.basemapHelper); |
| | | this.$store.commit('setServiceLayerHelper', this.serviceLayerHelper); |
| | | this.$store.commit('setVectorLayerHelper', this.vectorLayerHelper); |
| | | this.$store.commit('setMapObj', this.mapObj) |
| | | this.$store.commit('setBasemapHelper', this.basemapHelper) |
| | | this.$store.commit('setServiceLayerHelper', this.serviceLayerHelper) |
| | | this.$store.commit('setVectorLayerHelper', this.vectorLayerHelper) |
| | | }, |
| | | init() { |
| | | const mapcontainer = this.$refs.rootmap |
| | |
| | | |
| | | this.vectorLayerHelper = Sgis.initVectorLayersHelper(this.mapObj.map, this.mapObj.L) // 初始化动态要素图层助手 |
| | | this.vectorLayerHelper.initVectorLayers(this.mapConfig) |
| | | |
| | | |
| | | this.saveMapStatus() |
| | | // this.setMapObj(this.mapObj) |
| | |
| | | margin: 0; |
| | | padding: 0; |
| | | position: absolute; |
| | | |
| | | #map{ |
| | | height: 100%; |
| | | width: 100%; |
| | | } |
| | | .barline{ |
| | | |
| | | .bar-line { |
| | | width: 100%; |
| | | height: 1px; |
| | | background-color: #0661AE; |