shuishen
2023-03-17 fa1c9a1bce019374ddd444341c6cca4b7cd9135f
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-03-16 16:54:09
 * @LastEditTime: 2023-03-17 08:55:29
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -75,6 +75,8 @@
<script>
let tile3DUrl = ''
let floorEntitysLayers = null
let flootEntitysEntites = null
if (process.env.NODE_ENV == 'development') {
    // 开发
@@ -156,7 +158,6 @@
    sdTilesetLayer: null
}
let flootEntitysEntites = null
const ysLabels = [
    'EPSG:4490_test:0',
@@ -347,9 +348,7 @@
            })
            // 原生Cesium加载多边体
            let floorEntitysLayers = new global.DC.Namespace.Cesium.CustomDataSource("floorEntitysLayers")
            global.viewer.dataSources.add(floorEntitysLayers)
            flootEntitysEntites = floorEntitysLayers.entities
            // let floorPositions = positions.reduce((prev, curr, index, arr) => {
            //     curr.forEach(item => {
@@ -504,8 +503,8 @@
            that.flytoLayer(params.polygonName, params.duration)
        })
        this.$EventBus.$on('showHouse3D', (params) => {
            that.showHouse3D(params.positions, params.minHeight, params.maxHeight)
        this.$EventBus.$on('showThreeDimensions', (params) => {
            that.showThreeDimensions(params.positions, params.minHeight, params.maxHeight)
        })
        this.$EventBus.$on('clearHouse3D', () => {
@@ -1002,9 +1001,12 @@
        * @param {*} positions 建筑范围坐标
        * @param {*} 
        */
        showHouse3D (positions, minHeight, maxHeight) {
            console.log('showHouse3D被调用!',positions,111);
            if(flootEntitysEntites!=null){
        showThreeDimensions (positions, minHeight, maxHeight) {
            if (flootEntitysEntites == null) {
                floorEntitysLayers = new global.DC.Namespace.Cesium.CustomDataSource("floorEntitysLayers")
                global.viewer.dataSources.add(floorEntitysLayers)
                flootEntitysEntites = floorEntitysLayers.entities
            } else {
                flootEntitysEntites.removeAll()
            }
            let housePositions = JSON.parse(positions).coordinates[0]