1 files modified
1 files added
| | |
| | | * @Author: shuishen 1109946754@qq.com |
| | | * @Date: 2022-08-18 17:00:30 |
| | | * @LastEditors: shuishen 1109946754@qq.com |
| | | * @LastEditTime: 2023-04-10 17:37:00 |
| | | * @LastEditTime: 2023-04-12 10:57:51 |
| | | * @FilePath: \srs-police-affairs\src\components\map\index.vue |
| | | * @Description: 公用地图组件 |
| | | * |
| | |
| | | |
| | | let tilesetLayer = null |
| | | |
| | | let baseLayers = null |
| | | let baseLayers = [] |
| | | |
| | | let tilesetObject = { |
| | | sdTilesetLayer: null |
| | |
| | | import yToolTip from './components/yToolTip.vue' |
| | | import createTools from '@/utils/tools/index' |
| | | import { mapGetters } from 'vuex' |
| | | |
| | | import yxLayerJson from './yxlayer' |
| | | |
| | | export default { |
| | | name: 'mapBox', |
| | |
| | | switchImg () { |
| | | // 天地图 影像 |
| | | this.imgtype = 0 |
| | | baseLayers != null && global.viewer.imageryLayers.remove(baseLayers) |
| | | baseLayers.forEach(item => { |
| | | item && global.viewer.imageryLayers.remove(item) |
| | | }) |
| | | |
| | | baseLayers = global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_YX}/{z}/{x}/{reverseY}.png`, |
| | | minimumLevel: 0, |
| | | maximumLevel: 25, |
| | | tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | }) |
| | | ) |
| | | |
| | | // const fileArray = ['A', 'B', 'C', 'D', 'E', 'F'] |
| | | // let subdomains = [] |
| | | |
| | | // fileArray.forEach(item => { |
| | | // for (let i = 1; i < 6; i++) { |
| | | // subdomains.push(`${item}${i}`) |
| | | // } |
| | | // }) |
| | | baseLayers = [] |
| | | |
| | | // baseLayers = global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | // url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_YX}/{fileName}/{AZ}/{y}/{x}.png`, |
| | | // customTags: { |
| | | // AZ (imageryProvider, x, y, level) { |
| | | // return 'Z' + level |
| | | // }, |
| | | |
| | | // fileName (imageryProvider, x, y, level) { |
| | | // console.log(imageryProvider, x, y, level) |
| | | // } |
| | | // }, |
| | | // enablePickFeatures: false |
| | | // // minimumLevel: 0, |
| | | // // maximumLevel: 25, |
| | | // // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_YX}/{z}/{x}/{reverseY}.png`, |
| | | // minimumLevel: 0, |
| | | // maximumLevel: 25, |
| | | // tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | // }) |
| | | // ) |
| | | |
| | | yxLayerJson.forEach(item => { |
| | | baseLayers.push( |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({ |
| | | url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_YX}/${item.name}/{AZ}/{y}/{x}.png`, |
| | | customTags: { |
| | | AZ (imageryProvider, x, y, level) { |
| | | return 'Z' + level |
| | | }, |
| | | }, |
| | | minimumLevel: 0, |
| | | maximumLevel: 25, |
| | | rectangle: global.DC.Namespace.Cesium.Rectangle.fromDegrees(item.west, item.south, item.east, item.north) |
| | | }) |
| | | ) |
| | | ) |
| | | }) |
| | | |
| | | // baseLayers = global.viewer.imageryLayers.addImageryProvider( |
| | | // new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | |
| | | switchElec () { |
| | | // 天地图 矢量 |
| | | this.imgtype = 1 |
| | | baseLayers != null && global.viewer.imageryLayers.remove(baseLayers) |
| | | baseLayers = global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_SL}/MapTileService/wmts?STORETYPE=merged-dat&PROJECTION=4326`, |
| | | layer: "wmts_4326_361100", |
| | | style: "default", |
| | | format: "image/png", |
| | | tileMatrixSetID: "c", |
| | | tileMatrixLabels: new Array(20).fill(0).map((v, i) => i + 1), |
| | | tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | }) |
| | | |
| | | baseLayers.forEach(item => { |
| | | item && global.viewer.imageryLayers.remove(item) |
| | | }) |
| | | |
| | | baseLayers = [] |
| | | |
| | | baseLayers.push( |
| | | global.viewer.imageryLayers.addImageryProvider( |
| | | new global.DC.Namespace.Cesium.WebMapTileServiceImageryProvider({ |
| | | url: `${window.BASE_URL_CONFIG.VUE_APP_MAP_SL}/MapTileService/wmts?STORETYPE=merged-dat&PROJECTION=4326`, |
| | | layer: "wmts_4326_361100", |
| | | style: "default", |
| | | format: "image/png", |
| | | tileMatrixSetID: "c", |
| | | tileMatrixLabels: new Array(20).fill(0).map((v, i) => i + 1), |
| | | tilingScheme: new global.DC.Namespace.Cesium.GeographicTilingScheme(), |
| | | }) |
| | | ) |
| | | ) |
| | | |
| | | baseLayers.contrast = 1.0 |
| New file |
| | |
| | | export default [ |
| | | { |
| | | name: "A1", |
| | | west: "0", |
| | | south: "0", |
| | | east: "0", |
| | | north: "0" |
| | | }, |
| | | { |
| | | name: "A2", |
| | | west: "117.963930012653", |
| | | south: "28.586168220745", |
| | | east: "118.012258057971", |
| | | north: "28.6426775570836" |
| | | }, |
| | | { |
| | | name: "A3", |
| | | west: "118.012258057971", |
| | | south: "28.586168220745", |
| | | east: "118.06058610329", |
| | | north: "28.6426775570836" |
| | | }, |
| | | { |
| | | name: "A4", |
| | | west: "118.06058610329", |
| | | south: "28.586168220745", |
| | | east: "118.108914148609", |
| | | north: "28.6426775570836" |
| | | }, |
| | | { |
| | | name: "A5", |
| | | west: "118.108914148609", |
| | | south: "28.586168220745", |
| | | east: "118.157242193927", |
| | | north: "28.6426775570836" |
| | | }, |
| | | { |
| | | name: "B1", |
| | | west: "117.915601967334", |
| | | south: "28.5296588844063", |
| | | east: "117.963930012653", |
| | | north: "28.586168220745" |
| | | }, |
| | | { |
| | | name: "B2", |
| | | west: "117.963930012653", |
| | | south: "28.5296588844063", |
| | | east: "118.012258057971", |
| | | north: "28.586168220745" |
| | | }, |
| | | { |
| | | name: "B3", |
| | | west: "118.012258057971", |
| | | south: "28.5296588844063", |
| | | east: "118.06058610329", |
| | | north: "28.586168220745" |
| | | }, |
| | | { |
| | | name: "B4", |
| | | west: "118.06058610329", |
| | | south: "28.5296588844063", |
| | | east: "118.108914148609", |
| | | north: "28.586168220745" |
| | | }, |
| | | { |
| | | name: "B5", |
| | | west: "118.108914148609", |
| | | south: "28.5296588844063", |
| | | east: "118.157242193927", |
| | | north: "28.586168220745" |
| | | }, |
| | | { |
| | | name: "C1", |
| | | west: "117.915601967334", |
| | | south: "28.4731495480677", |
| | | east: "117.963930012653", |
| | | north: "28.5296588844063" |
| | | }, |
| | | { |
| | | name: "C2", |
| | | west: "117.963930012653", |
| | | south: "28.4731495480677", |
| | | east: "118.012258057971", |
| | | north: "28.5296588844063" |
| | | }, |
| | | { |
| | | name: "C3", |
| | | west: "118.012258057971", |
| | | south: "28.4731495480677", |
| | | east: "118.06058610329", |
| | | north: "28.5296588844063" |
| | | }, |
| | | { |
| | | name: "C4", |
| | | west: "118.06058610329", |
| | | south: "28.4731495480677", |
| | | east: "118.108914148609", |
| | | north: "28.5296588844063" |
| | | }, |
| | | { |
| | | name: "C5", |
| | | west: "118.108914148609", |
| | | south: "28.4731495480677", |
| | | east: "118.157242193927", |
| | | north: "28.5296588844063" |
| | | }, |
| | | { |
| | | name: "D1", |
| | | west: "117.915601967334", |
| | | south: "28.416640211729", |
| | | east: "117.963930012653", |
| | | north: "28.4731495480677" |
| | | }, |
| | | { |
| | | name: "D2", |
| | | west: "117.963930012653", |
| | | south: "28.416640211729", |
| | | east: "118.012258057971", |
| | | north: "28.4731495480677" |
| | | }, |
| | | { |
| | | name: "D3", |
| | | west: "118.012258057971", |
| | | south: "28.416640211729", |
| | | east: "118.06058610329", |
| | | north: "28.4731495480677" |
| | | }, |
| | | { |
| | | name: "D4", |
| | | west: "118.06058610329", |
| | | south: "28.416640211729", |
| | | east: "118.108914148609", |
| | | north: "28.4731495480677" |
| | | }, |
| | | { |
| | | name: "D5", |
| | | west: "118.108914148609", |
| | | south: "28.416640211729", |
| | | east: "118.157242193927", |
| | | north: "28.4731495480677" |
| | | }, |
| | | { |
| | | name: "E1", |
| | | west: "117.915601967334", |
| | | south: "28.3601308753904", |
| | | east: "117.963930012653", |
| | | north: "28.416640211729" |
| | | }, |
| | | { |
| | | name: "E2", |
| | | west: "117.963930012653", |
| | | south: "28.3601308753904", |
| | | east: "118.012258057971", |
| | | north: "28.416640211729" |
| | | }, |
| | | { |
| | | name: "E3", |
| | | west: "118.012258057971", |
| | | south: "28.3601308753904", |
| | | east: "118.06058610329", |
| | | north: "28.416640211729" |
| | | }, |
| | | { |
| | | name: "E4", |
| | | west: "0", |
| | | south: "0", |
| | | east: "0", |
| | | north: "0" |
| | | }, |
| | | { |
| | | name: "E5", |
| | | west: "0", |
| | | south: "0", |
| | | east: "0", |
| | | north: "0" |
| | | } |
| | | ] |