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
| /* * @Author: Morpheus * @Name: 地图测距 * @Date: 2021-11-13 16:04:27 * @Last
| Modified by: Morpheus * @Last Modified time: 2022-02-15 14:28:44 */
|
| <template>
| <div>
| <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">
| <el-button type="primary" size="mini" @click.stop="showClick">显示</el-button>
|
| <el-button type="danger" size="mini" @click.stop="closeClick">关闭</el-button>
| </template>
| </public-box>
|
| <video
| id="video"
| style="position: fixed; visibility: hidden"
| muted
| autoplay
| loop
| crossorigin
| controls
| >
| <source src="http://dc.dvgis.cn/examples/data/demo.mp4" type="video/mp4" />
| </video>
| </div>
| </template>
|
| <script>
| let videoLayer = null
| let cameraVideo = null
|
| export default {
| data () {
| return {}
| },
| created () { },
| mounted () {
| },
| methods: {
| closeModel () {
| this.$router.push('/pcLayout/default')
| },
| showClick () {
| if (videoLayer != null) return
| videoLayer = new global.DC.CameraVideoLayer('video-layer').addTo(
| global.viewer
| )
|
| cameraVideo = new global.DC.CameraVideo(
| new global.DC.Position(114.03935976, 27.62939045, 155, 4.2, -90),
| document.getElementById('video')
| )
| cameraVideo.setStyle({
| fov: 60,
| far: 120,
| near: 1,
| aspectRatio: 1.3,
| alpha: 0.7
| })
|
| videoLayer.addOverlay(cameraVideo)
|
| global.viewer.flyToPosition(
| new global.DC.Position(
| 114.03935976,
| 27.62939045,
| 300,
| Number(180),
| Number(-90),
| Number(0)
| )
| )
| },
|
| closeClick () {
| cameraVideo != null && videoLayer.removeOverlay(cameraVideo)
| cameraVideo = null
| videoLayer != null && global.viewer.removeLayer(videoLayer)
| videoLayer = null
| }
| },
| destroyed () {
| this.closeClick()
| }
| }
| </script>
|
| <style lang="sass" scoped>
| .move
| cursor: move
| </style>
|
|