shuishen
2022-09-17 275b4e44378093294ba33420bfb297580c0f8b04
Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs
2 files modified
1 files added
36 ■■■■■ changed files
public/img/icon/position.png patch | view | raw | blame | history
src/components/map/index.vue 32 ●●●●● patch | view | raw | blame | history
src/views/lyout/index.vue 4 ●●●● patch | view | raw | blame | history
public/img/icon/position.png
src/components/map/index.vue
@@ -32,6 +32,8 @@
<script>
var siteEntitylayers = null
export default {
    name: 'mapBox',
@@ -171,6 +173,11 @@
            // global.viewer.scene.globe.depthTestAgainstTerrain = true
            // 已声明的图层添加到地图上
            siteEntitylayers = new global.DC.VectorLayer('siteEntitylayers')
            global.viewer.addLayer(siteEntitylayers)
            // 判断是否支持图像渲染像素化处理
            if (global.DC.Namespace.Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
                global.viewer.setOptions({
@@ -261,6 +268,14 @@
            console.log(isEleFullScreen())
        }
    },
    provide () {
        return {
            test: this.test
        }
    },
    updated () {
        this.test()
    },
    methods: {
        /**
         * @description: 全屏控制
@@ -297,8 +312,23 @@
                this.isFullscreen = true
            }
        },
        /**
        * 在图层中添加实体(点)
        * @param {*} item 图标
        * @param {*} url 图标地址
        */
        addSiteEntity (item, url) {
            const billboard = new global.DC.Billboard(new global.DC.Position(Number(item.lon), Number(item.lat)), url)
            billboard.size = [20, 28]
            billboard.attrParams = item
            siteEntitylayers.addOverlay(billboard)
        },
        test () {
            console.log('map.test(MAP)!!!')
        }
    }
    },
}
</script>
src/views/lyout/index.vue
@@ -72,6 +72,10 @@
    mounted () {
        this.currentPath = this.$route.path
    },
    // updated () {
    //     this.test()
    // },
    // inject: ["test"],
    methods: {
        /**
         * @description: 路由跳转的事件