智慧园区前端大屏
shuishen
2024-11-26 cf8712e3831c0aa61c055f5d6f61679f6115e6bb
地图默认加载
1 files modified
31 ■■■■ changed files
src/pages/layout/components/scomponents/baseMap.vue 31 ●●●● patch | view | raw | blame | history
src/pages/layout/components/scomponents/baseMap.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2024-10-28 11:44:45
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2024-11-25 11:47:59
 * @LastEditTime: 2024-11-25 19:39:24
 * @FilePath: \bigScreen\src\pages\layout\components\scomponents\baseMap.vue
 * @Description: 
 * 
@@ -43,10 +43,9 @@
const { appContext } = getCurrentInstance()
const global = appContext.config.globalProperties
const Cesium = DC.getLib('Cesium')
const cesiumToken =
  'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYTZlNGNlYS01NTU1LTQ1MGEtYmNlZS0yNTE2NDk5YWM2MjEiLCJpZCI6MTc5Njk2LCJpYXQiOjE3MDA1NDcwMjV9.qcl4AH2731cfFd0-I1ZLUINPXqvglLkDFD-UGR2zU5M'
Cesium.Ion.defaultAccessToken = cesiumToken
window.$Cesium.Ion.defaultAccessToken = cesiumToken
const TDT_Token = 'c6eea7dad4fa1e2d1e32ec0e7c9735db'
// 天地图Key
@@ -63,14 +62,14 @@
  '&LAYER=img&tileMatrixSet=c&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}' +
  '&style=default&format=tiles&tk=' + TDT_Token
const imageryProvider_standZh = new Cesium.UrlTemplateImageryProvider({
const imageryProvider_standZh = new window.$Cesium.UrlTemplateImageryProvider({
  url: 'https://t{s}.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=e45274b0235bb913eceb393aabbf9c9c',
  subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  maximumLevel: 18,
  credit: 'stand_zj',
})
const imageryProvider_stand = new Cesium.UrlTemplateImageryProvider({
const imageryProvider_stand = new window.$Cesium.UrlTemplateImageryProvider({
  url: 'https://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=e45274b0235bb913eceb393aabbf9c9c',
  subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
  // format: 'image/jpeg',
@@ -79,14 +78,14 @@
  credit: 'stand_tc',
})
const annotation = new Cesium.WebMapTileServiceImageryProvider({
const annotation = new window.$Cesium.WebMapTileServiceImageryProvider({
  url: TDT_ZJ,
  layer: 'tdtZwImg_c',
  style: 'default',
  format: 'tiles',
  tileMatrixSetID: 'c',
  subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
  tilingScheme: new Cesium.GeographicTilingScheme(),
  tilingScheme: new window.$Cesium.GeographicTilingScheme(),
  tileMatrixLabels: [
    '1',
    '2',
@@ -111,14 +110,14 @@
  maximumLevel: 50,
})
const imageryProvider_tdt = new Cesium.WebMapTileServiceImageryProvider({
const imageryProvider_tdt = new window.$Cesium.WebMapTileServiceImageryProvider({
  url: TDT_IMG_C,
  layer: 'tdtImg_c',
  style: 'default',
  format: 'tiles',
  tileMatrixSetID: 'c',
  subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7'],
  tilingScheme: new Cesium.GeographicTilingScheme(),
  tilingScheme: new window.$Cesium.GeographicTilingScheme(),
  tileMatrixLabels: [
    '1',
    '2',
@@ -143,7 +142,7 @@
  maximumLevel: 17,
})
const imageryProvider_ammapSL = new Cesium.UrlTemplateImageryProvider({
const imageryProvider_ammapSL = new window.$Cesium.UrlTemplateImageryProvider({
  url: 'https://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}',
  layer: 'tdtVecBasicLayer',
  style: 'default',
@@ -155,7 +154,7 @@
  credit: 'amap_SL',
})
const imageryProvider_ammap = new Cesium.UrlTemplateImageryProvider({
const imageryProvider_ammap = new window.$Cesium.UrlTemplateImageryProvider({
  url: 'https://webst02.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}',
  layer: 'tdtVecBasicLayer',
  style: 'default',
@@ -167,7 +166,7 @@
  credit: 'amap_stand',
})
const imageryProvider_ammapBz = new Cesium.UrlTemplateImageryProvider({
const imageryProvider_ammapBz = new window.$Cesium.UrlTemplateImageryProvider({
  url: 'https://webst02.is.autonavi.com/appmaptile?x={x}&y={y}&z={z}&lang=zh_cn&size=1&scale=1&style=8',
  tilingScheme: new AmapMercatorTilingScheme(),
  minimumLevel: 3,
@@ -230,7 +229,7 @@
let globalBaseMapLayers = []
const loadLAYER = (mode, ind) => {
const loadLAYER = (mode, ind, cb = () => { }) => {
  if (mode == curMode.value) return
  let curmapLayers = []
@@ -274,9 +273,11 @@
    })
  curMode.value = mode
}
loadLAYER(1, 1)
}
setTimeout(() => {
  loadLAYER(1, 1)
}, 0)
const showTerrainFlag = ref(true)