shuishen
2022-04-27 510ae9f8768cd16c39fde70e1ae40b164500d5d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/* * @Author: Morpheus * @Name: 地图测距 * @Date: 2021-11-13 16:04:27 * @Last
Modified by: Morpheus * @Last Modified time: 2022-02-15 14:28:44 */
 
<template>
    <public-box class="technique-box">
        <template slot="public-box-header">
            <div class="title">
                <span>数据动画</span>
            </div>
            <img class="close deblurring" src="/img/navicon/close.png" alt @click="closeModel" />
        </template>
        <template slot="public-box-content">
            <ul>
                <li>
                    流动线
                    <el-switch
                        v-model="plineShow"
                        :active-value="true"
                        :inactive-value="false"
                        @change="plineChange"
                    ></el-switch>
                </li>
                <li>
                    发光轨迹线
                    <el-switch
                        v-model="rayPlineShow"
                        :active-value="true"
                        :inactive-value="false"
                        @change="rayPlineChange"
                    ></el-switch>
                </li>
                <li>
                    扩散圆
                    <el-switch
                        v-model="circleDiffShow"
                        :active-value="true"
                        :inactive-value="false"
                        @change="circleDiffChange"
                    ></el-switch>
                </li>
 
                <li>
                    波纹雷达
                    <el-switch
                        v-model="circleRadarShow"
                        :active-value="true"
                        :inactive-value="false"
                        @change="circleRadarChange"
                    ></el-switch>
                </li>
            </ul>
        </template>
    </public-box>
</template>
 
<script>
 
let plineLayers = null
let lineOne = null
let lineTwo = null
let lineThree = null
let lineFour = null
 
let rayPline = null
let rayPlineEl = null
let circleDiff = null
let circleDiffEl = null
let circleRadar = null
let circleRadarEl = null
export default {
    data () {
        return {
            plineShow: false,
            rayPlineShow: false,
            circleDiffShow: false,
            circleRadarShow: false
        }
    },
    mounted () {
    },
    methods: {
        closeModel () {
            this.$router.push('/pcLayout/default')
        },
        loadPline () {
            plineLayers = new global.DC.VectorLayer('layer')
            global.viewer.addLayer(plineLayers)
 
            lineOne = new global.DC.Polyline('114.035, 27.634; 114.042, 27.634').setStyle({
                width: 5,
                material: new global.DC.PolylineFlowMaterialProperty({
                    color: global.DC.Color.RED,
                    speed: 5
                }),
                clampToGround: true
            })
 
            lineTwo = new global.DC.Polyline('114.042, 27.634; 114.042, 27.627').setStyle({
                width: 5,
                material: new global.DC.PolylineFlowMaterialProperty({
                    color: global.DC.Color.ORANGE,
                    speed: 5
                }),
                clampToGround: true
            })
 
            lineThree = new global.DC.Polyline('114.035, 27.627; 114.035, 27.634').setStyle({
                width: 5,
                material: new global.DC.PolylineFlowMaterialProperty({
                    color: global.DC.Color.YELLOW,
                    speed: 10
                }),
                clampToGround: true
            })
 
            lineFour = new global.DC.Polyline('114.042, 27.627; 114.035, 27.627').setStyle({
                width: 5,
                material: new global.DC.PolylineFlowMaterialProperty({
                    color: global.DC.Color.GREEN,
                    speed: 10
                }),
                clampToGround: true
            })
 
            plineLayers.addOverlay(lineOne).addOverlay(lineTwo).addOverlay(lineThree).addOverlay(lineFour)
            global.viewer.flyToPosition('114.03928435,27.62197062,1000.56,0,-45')
        },
        removePline () {
            lineOne != null && lineTwo != null && lineThree != null && lineFour != null && plineLayers.removeOverlay(lineOne).removeOverlay(lineTwo).removeOverlay(lineThree).removeOverlay(lineFour)
            plineLayers != null && global.viewer.removeLayer(plineLayers)
            lineOne = null
            lineTwo = null
            lineThree = null
            lineFour = null
            plineLayers = null
        },
        plineChange (e) {
            if (e) {
                this.loadPline()
            } else {
                this.removePline()
            }
        },
        loadRayPline () {
            rayPline = new global.DC.VectorLayer('rayPline')
            global.viewer.addLayer(rayPline)
 
            rayPlineEl = new global.DC.Polyline('114.034, 27.6268; 114.042, 27.6268')
            rayPlineEl.setStyle({
                width: 20,
                material: new global.DC.PolylineLightingTrailMaterialProperty({
                    color: global.DC.Color.YELLOW,
                    speed: 5.0
                }),
                clampToGround: true
            })
            rayPline.addOverlay(rayPlineEl)
            global.viewer.flyToPosition('114.03928435,27.61897062,1000.56,0,-45')
        },
        removeRayPline () {
            rayPlineEl != null && rayPline.removeOverlay(rayPlineEl)
            rayPline != null && global.viewer.removeLayer(rayPline)
            rayPlineEl = null
            rayPline = null
        },
        rayPlineChange (e) {
            if (e) {
                this.loadRayPline()
            } else {
                this.removeRayPline()
            }
        },
        loadCircleDiff () {
            circleDiff = new global.DC.VectorLayer('circleDiff').addTo(global.viewer)
            const center = global.DC.Position.fromObject({ lng: 114.03928435, lat: 27.62997062 })
            circleDiffEl = new global.DC.Circle(center, 200)
            circleDiffEl.setStyle({
                material: new global.DC.CircleDiffuseMaterialProperty({
                    color: global.DC.Color.RED.withAlpha(0.2),
                    speed: 8.0
                })
            })
            circleDiff.addOverlay(circleDiffEl)
            global.viewer.flyToPosition('114.03928435,27.62397062,800.56,0,-45')
        },
        removeCircleDiff () {
            circleDiffEl != null && circleDiff.addOverlay(circleDiffEl)
            circleDiff != null && global.viewer.removeLayer(circleDiff)
            circleDiffEl = null
            circleDiff = null
        },
        circleDiffChange (e) {
            if (e) {
                this.loadCircleDiff()
            } else {
                this.removeCircleDiff()
            }
        },
        loadCircleRadar () {
            circleRadar = new global.DC.VectorLayer('circleRadar').addTo(global.viewer)
            const center = global.DC.Position.fromObject({ lng: 114.03928435, lat: 27.62997062 })
            circleRadarEl = new global.DC.Circle(center, 200)
            circleRadarEl.setStyle({
                material: new global.DC.RadarWaveMaterialProperty({
                    color: new global.DC.Color(0, 1.0, 1.0, 0.8),
                    speed: 5.0
                })
            })
            circleRadar.addOverlay(circleRadarEl)
            global.viewer.flyToPosition('114.03928435,27.62397062,800.56,0,-45')
        },
        removeCircleRadar () {
            circleRadarEl != null && circleRadar.addOverlay(circleRadarEl)
            circleRadar != null && global.viewer.removeLayer(circleRadar)
            circleRadarEl = null
            circleRadar = null
        },
        circleRadarChange (e) {
            if (e) {
                this.loadCircleRadar()
            } else {
                this.removeCircleRadar()
            }
        }
    },
    destroyed () {
        this.removePline()
        this.removeRayPline()
        this.removeCircleDiff()
        this.removeCircleRadar()
    }
}
</script>
 
<style lang="sass" scoped>
.move
    cursor: move
</style>