liuyg
2022-01-25 117dc4cec546f830bc941ea314dcbdb9b370b211
src/components/campusNav/index.vue
@@ -46,8 +46,8 @@
                            <ul>
                                <li v-for="(item, index) in toNameList"
                                    :key="index"
                                    @click="loadPopup(item)">
                                    {{item.name}}
                                    @click="originChange(item)">
                                    {{item.mechanismname}}
                                </li>
                            </ul>
                        </div>
@@ -64,8 +64,8 @@
                            <ul>
                                <li v-for="(item, index) in comeNameList"
                                    :key="index"
                                    @click="loadPopup(item)">
                                    {{item.name}}
                                    @click="terminusChange(item)">
                                    {{item.mechanismname}}
                                </li>
                            </ul>
                        </div>
@@ -114,7 +114,9 @@
            // 出发名称
            'getToName',
            // 到达名称
            'comeName'
            'comeName',
            // 点信息
            'pointPosition'
        ])
    },
    watch: {
@@ -275,7 +277,7 @@
                        routes += lineArr
                    })
                    routes = routes.substr(0, routes.length - 1)
                    routes = startLog + ',' + startLat + ';' + routes + endLog + ',' + endLat
                    const polyline = new this.DC.Polyline(routes)
                    polyline.setStyle({
@@ -287,7 +289,7 @@
                        clampToGround: true
                    })
                    this.routeLayer.addOverlay(polyline)
                    if (this.twoOrThree == '3 维') {
                    if (this.twoOrThree == '真三维') {
                        this.viewer.flyTo(this.routeLayer)
                    } else {
                        var longitude = null
@@ -310,7 +312,7 @@
                        this.viewer.camera.setView({
                            // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                            // fromDegrees()方法,将经纬度和高程转换为世界坐标
                            destination: this.DC.Namespace.Cesium.Cartesian3.fromDegrees(longitude, latitude, 300),
                            destination: this.DC.Namespace.Cesium.Cartesian3.fromDegrees(longitude, latitude, 600),
                            orientation: {
                                // 指向
                                heading: this.DC.Namespace.Cesium.Math.toRadians(0, 0),
@@ -349,7 +351,7 @@
                        routes += lineArr
                    })
                    routes = routes.substr(0, routes.length - 1)
                    routes = startLog + ',' + startLat + ';' + routes + endLog + ',' + endLat
                    const polyline = new this.DC.Polyline(routes)
                    polyline.setStyle({
@@ -362,7 +364,7 @@
                    })
                    this.routeLayer.addOverlay(polyline)
                    if (this.twoOrThree == '3 维') {
                    if (this.twoOrThree == '真三维') {
                        this.viewer.flyTo(this.routeLayer)
                    } else {
                        var longitude = null
@@ -385,7 +387,7 @@
                        this.viewer.camera.setView({
                            // Cesium的坐标是以地心为原点,一向指向南美洲,一向指向亚洲,一向指向北极州
                            // fromDegrees()方法,将经纬度和高程转换为世界坐标
                            destination: this.DC.Namespace.Cesium.Cartesian3.fromDegrees(longitude, latitude, 300),
                            destination: this.DC.Namespace.Cesium.Cartesian3.fromDegrees(longitude, latitude, 600),
                            orientation: {
                                // 指向
                                heading: this.DC.Namespace.Cesium.Math.toRadians(0, 0),
@@ -449,6 +451,37 @@
                    this.comeNameShow = false
                }
            }
        },
        originChange (param) {
            console.log(param, 456)
            this.$store.commit('SET_POINTPOSITION', [
                Number(param.jd),
                Number(param.wd),
                Number(param.gd),
                Number(param.heading),
                Number(param.pitch),
                Number(param.roll)
            ])
            this.$store.commit('SET_GETTONAME', param.mechanismname)
            this.$store.commit('SET_STARTINGPOINT', this.pointPosition)
            this.toNameShow = false
            this.toNameList = []
        },
        terminusChange (param) {
            this.$store.commit('SET_POINTPOSITION', [
                Number(param.jd),
                Number(param.wd),
                Number(param.gd),
                Number(param.heading),
                Number(param.pitch),
                Number(param.roll)
            ])
            this.$store.commit('SET_COMENAME', param.mechanismname)
            this.$store.commit('SET_TERMINUS', this.pointPosition)
            this.comeNameShow = false
            this.comeNameList = []
        }
    }
}