1
guanqb
2024-01-20 f13afcb61276061871b30bce17a7877287df0b67
src/components/map/index.vue
@@ -2,7 +2,7 @@
 * @Author: shuishen 1109946754@qq.com
 * @Date: 2022-08-18 17:00:30
 * @LastEditors: shuishen 1109946754@qq.com
 * @LastEditTime: 2023-05-30 10:15:14
 * @LastEditTime: 2024-01-16 11:45:21
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -11,7 +11,12 @@
<template>
    <div class="viewer-box" id="viewer-container" @click="showImgBtn = false">
        <slot ref="mainContent" name="mainContent"></slot>
        <slot name="copyrightText"></slot>
        <slot name="showButton"></slot>
        <slot name="resetPopup"></slot>
        <div class="compass-btn">
            <el-tooltip content="指北针" placement="top" effect="dark">
@@ -94,6 +99,10 @@
        <house-deep-data-popup></house-deep-data-popup>
        <business-data-popup></business-data-popup>
        <hotel-popup></hotel-popup>
        <y-tool-tip></y-tool-tip>
        <assemble-box></assemble-box>
@@ -171,6 +180,8 @@
import videoRowClickPopup from './components/videoRowClickPopup.vue'
import mapSearchPopup from './components/mapSearchPopup.vue'
import houseDeepDataPopup from './components/houseDeepDataPopup.vue'
import hotelPopup from './components/hotelPopup.vue'
import businessDataPopup from './components/businessDataPopup.vue'
import yToolTip from './components/yToolTip.vue'
import createTools from '@/utils/tools/index'
import { mapGetters } from 'vuex'
@@ -181,7 +192,7 @@
export default {
    name: 'mapBox',
    components: { mapPopup, architecturePopup, activityPolicePopup, videoListPopup, mapSearchPopup, houseDeepDataPopup, yToolTip, videoRowClickPopup },
    components: { mapPopup, architecturePopup, activityPolicePopup, videoListPopup, mapSearchPopup, houseDeepDataPopup, hotelPopup, businessDataPopup, yToolTip, videoRowClickPopup },
    data () {
        return {
@@ -310,21 +321,21 @@
            // global.viewer.addTerrain(terrain)
            // 内网
            that.switchImg()
            // that.switchImg()
            // 地形数据添加
            // that.addTerrain()
            // 外网 
            // global.viewer.imageryLayers.addImageryProvider(
            //     new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
            //         url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=d083e4cf30bfc438ef93436c10c2c20a',
            //         subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
            //         format: 'image/jpeg',
            //         show: true,
            //         maximumLevel: 18
            //     })
            // )
            global.viewer.imageryLayers.addImageryProvider(
                new global.DC.Namespace.Cesium.UrlTemplateImageryProvider({
                    url: 'http://t{s}.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=d083e4cf30bfc438ef93436c10c2c20a',
                    subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                    format: 'image/jpeg',
                    show: true,
                    maximumLevel: 18
                })
            )
            // 设置地图初始位置,角度等
            global.viewer.camera.setView({
@@ -1245,7 +1256,7 @@
         * @param {*} flag 显示隐藏
         */
        layerShow (layerName, flag) {
            layersObjcect[layerName].show = flag
            if (layersObjcect[layerName]) layersObjcect[layerName].show = flag
        },
        /**