guanqb
2022-09-22 9f8e48af30bbaa96f3e82038fa207510b83031a2
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: 2022-09-22 08:46:54
 * @LastEditTime: 2022-09-22 14:05:36
 * @FilePath: \srs-police-affairs\src\components\map\index.vue
 * @Description: 公用地图组件
 * 
@@ -62,99 +62,7 @@
            searchDetailsShow: false,
            videoExist: true,
            videoTotal: 0,
            carTotal: 0,
            searchList: [
                {
                    "name": "铅山县公安局食品药品与环境犯罪侦查大队",
                    "address": "江西省上饶市铅山县河口镇公安局铅山县公安局食品药品与环境犯罪侦查大队",
                    "adcode": "361124",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "铅山县",
                    "town": "河口镇"
                },
                {
                    "name": "老公安局",
                    "address": "江西省上饶市铅山县河口镇狮江大道老公安局",
                    "adcode": "361124",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "铅山县",
                    "town": "河口镇"
                },
                {
                    "name": "老市公安局",
                    "address": "江西省上饶市信州区东市街道金龙岗路18号老市公安局",
                    "adcode": "361102",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "信州区",
                    "town": "东市街道"
                },
                {
                    "name": "铅山县公安局",
                    "address": "江西省上饶市铅山县永平镇铅山县公安局",
                    "adcode": "361124",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "铅山县",
                    "town": "永平镇"
                },
                {
                    "name": "铅山县森林公安局",
                    "address": "江西省上饶市铅山县河口镇铅山县森林公安局",
                    "adcode": "361124",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "铅山县",
                    "town": "河口镇"
                },
                {
                    "name": "森林公安局",
                    "address": "江西省上饶市信州区灵溪街道森林公安局",
                    "adcode": "361102",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "信州区",
                    "town": "灵溪街道"
                },
                {
                    "name": "上饶市广丰区公安局",
                    "address": "江西省上饶市广丰区永丰街道裕丰大道36号上饶市广丰区公安局",
                    "adcode": "361103",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "广丰区",
                    "town": "永丰街道"
                },
                {
                    "name": "上饶市公安局",
                    "address": "江西省上饶市上饶县罗桥街道广信大道118号上饶市公安局",
                    "adcode": "361121",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "上饶县",
                    "town": "罗桥街道"
                },
                {
                    "name": "广信区公安局",
                    "address": "江西省上饶市上饶县罗桥街道旭日北大道666号广信区公安局",
                    "adcode": "361121",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "上饶县",
                    "town": "罗桥街道"
                },
                {
                    "name": "江西省玉山县公安局",
                    "address": "江西省上饶市玉山县冰溪街道人民大道166号江西省玉山县公安局",
                    "adcode": "361123",
                    "province": "江西省",
                    "city": "上饶市",
                    "district": "玉山县",
                    "town": "冰溪街道"
                }
            ]
            carTotal: 0
        }
    },
@@ -219,7 +127,10 @@
            wall.setStyle({
                material: new global.DC.WallTrailMaterialProperty({
                    color: global.DC.Color.BLUE,
                    color: global.DC.Namespace.Cesium.Color.fromBytes(
                        33, 150, 243,
                        200
                    ),
                    speed: 8
                })
            })
@@ -261,13 +172,13 @@
                // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                // fromDegrees()方法,将经纬度和高程转换为世界坐标
                destination: global.DC.Namespace.Cesium.Cartesian3.fromDegrees(
                    116.027429, 28.681978, 8000.0
                    116.112550, 28.196631, 50000
                ),
                orientation: {
                    // 指向
                    heading: global.DC.Namespace.Cesium.Math.toRadians(0, 0),
                    // 视角
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(-90),
                    pitch: global.DC.Namespace.Cesium.Math.toRadians(-45),
                    roll: 0.0
                }
            })
@@ -338,7 +249,7 @@
        })
        this.$EventBus.$on('layerPolygonAdd', (params) => {
            that.layerPolygonAdd(params.layerName, params.positions, params.material)
            that.layerPolygonAdd(params.layerName, params.positions, params.material, params.distanceDisplayCondition)
        })
        this.$EventBus.$on('layerPolylineAdd', (params) => {
@@ -483,14 +394,14 @@
                pointElement.size = [32, 32]
            } else if (type == "label") {
                pointElement = new global.DC.Label(new global.DC.Position(Number(params.lng), Number(params.lat), 0), params.url)
                pointElement = new global.DC.Label(new global.DC.Position(Number(params.lng), Number(params.lat), Number(params.alt)), params.text)
                pointElement.setStyle({
                    fillColor: global.DC.Color.CRIMSON,
                    style: global.DC.Namespace.Cesium.LabelStyle.FILL_AND_OUTLINE,
                    outlineColor: global.DC.Color.WHITE, // 边框颜色
                    outlineWidth: 8, // 边框大小,
                    font: '14px sans-serif',
                    outlineWidth: 4, // 边框大小,
                    font: '16px sans-serif',
                    pixelOffset: { x: 0, y: -24 }
                })
            }
@@ -506,8 +417,9 @@
         * @param {*} layerName 图层名称
         * @param {*} positions 图层位置数据
         * @param {*} material 颜色
         * @param {*} distanceDisplayCondition 可见距离
         */
        layerPolygonAdd (layerName, positions, material) {
        layerPolygonAdd (layerName, positions, material, distanceDisplayCondition) {
            if (!layersObjcect[layerName] || layersObjcect[layerName] == null) {
                this.mapAddLayer(layerName, 'VectorLayer')
@@ -518,6 +430,7 @@
            polygon.setStyle({
                material: material,
                distanceDisplayCondition: distanceDisplayCondition,
                perPositionHeight: true,
            })
@@ -606,9 +519,6 @@
            tilesetLayer.addOverlay(tilesetObject[titlesetName])
            // global.viewer.flyTo(tilesetObject[titlesetName])
            this.toPosition(116.027212, 28.678499, 600, -3, -45)
            tilesetObject[titlesetName].on(global.DC.MouseEventType.CLICK, incident)
        },
@@ -640,7 +550,7 @@
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 20px;
        left: 420px;
        bottom: 10px;
        width: 36px;
        height: 36px;