guanqb
2023-04-15 9a0bc125d31cb1b0c0442c1eef5fa768f26a9889
src/components/map/index.vue
@@ -293,15 +293,15 @@
            // that.switchImg()
            // 外网
            // 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=e45274b0235bb913eceb393aabbf9c9c',
            //         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=e45274b0235bb913eceb393aabbf9c9c',
                    subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
                    format: 'image/jpeg',
                    show: true,
                    maximumLevel: 18
                })
            )
            // 设置地图初始位置,角度等
            global.viewer.camera.setView({
@@ -511,6 +511,10 @@
        this.$EventBus.$on('showThreeDimensions', (params) => {
            that.showThreeDimensions(params.positions, params.minHeight, params.maxHeight)
        })
        this.$EventBus.$on('switchThreeDimensions', (params) => {
            that.switchThreeDimensions(params)
        })
        this.$EventBus.$on('clearHouse3D', () => {
@@ -1205,8 +1209,8 @@
                        polygonHierarchy: new global.DC.Namespace.Cesium.PolygonHierarchy(
                            global.DC.Namespace.Cesium.Cartesian3.fromDegreesArray(floorPositions),
                        ),
                        extrudedHeight: maxHeight,//分层顶部海拔
                        height: minHeight,//分层底部海拔
                        extrudedHeight: 80,//分层顶部海拔
                        height: 50,//分层底部海拔
                    }),
                    attributes: {
@@ -1221,6 +1225,12 @@
            global.viewer.scene.primitives.add(curPolygon)
        },
        // 建筑高亮切换显示隐藏
        switchThreeDimensions (boolean) {
            if (!curPolygon) return
            curPolygon.show = boolean
        },
        // 清除建筑3D
        clearHouse3D () {
            global.viewer.scene.primitives.remove(curPolygon)