xy-map 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +1 -0
- package/package.json +3 -1
- package/public/draco/README.md +32 -0
- package/public/draco/draco_decoder.js +52 -0
- package/public/draco/draco_decoder.wasm +0 -0
- package/public/draco/draco_encoder.js +33 -0
- package/public/draco/draco_wasm_wrapper.js +104 -0
- package/public/draco/gltf/draco_decoder.js +48 -0
- package/public/draco/gltf/draco_decoder.wasm +0 -0
- package/public/draco/gltf/draco_encoder.js +33 -0
- package/public/draco/gltf/draco_wasm_wrapper.js +104 -0
- package/public/img/blue/nx.png +0 -0
- package/public/img/blue/ny.png +0 -0
- package/public/img/blue/nz.png +0 -0
- package/public/img/blue/px.png +0 -0
- package/public/img/blue/py.png +0 -0
- package/public/img/blue/pz.png +0 -0
- package/public/img/blue.jpg +0 -0
- package/public/img/hdr/hdr1.hdr +0 -0
- package/public/img/hdr/hdr2.hdr +0 -0
- package/public/img/hdr/venice_sunset_1k.hdr +0 -0
- package/public/img/loading.gif +0 -0
- package/public/img/taoshan2/baseColor_1.png +0 -0
- package/public/img/taoshan2/baseColor_10.jpg +0 -0
- package/public/img/taoshan2/baseColor_11.jpg +0 -0
- package/public/img/taoshan2/baseColor_12.jpg +0 -0
- package/public/img/taoshan2/baseColor_13.jpg +0 -0
- package/public/img/taoshan2/baseColor_14.jpg +0 -0
- package/public/img/taoshan2/baseColor_15.jpg +0 -0
- package/public/img/taoshan2/baseColor_16.jpg +0 -0
- package/public/img/taoshan2/baseColor_17.jpg +0 -0
- package/public/img/taoshan2/baseColor_18.jpg +0 -0
- package/public/img/taoshan2/baseColor_19.jpg +0 -0
- package/public/img/taoshan2/baseColor_2.png +0 -0
- package/public/img/taoshan2/baseColor_20.jpg +0 -0
- package/public/img/taoshan2/baseColor_3.png +0 -0
- package/public/img/taoshan2/baseColor_4.jpg +0 -0
- package/public/img/taoshan2/baseColor_5.jpg +0 -0
- package/public/img/taoshan2/baseColor_6.jpg +0 -0
- package/public/img/taoshan2/baseColor_7.jpg +0 -0
- package/public/img/taoshan2/baseColor_8.jpg +0 -0
- package/public/img/taoshan2/baseColor_9.jpg +0 -0
- package/public/img/taoshan2/taoshan4.bin +0 -0
- package/public/img/taoshan2/taoshan4.gltf +1 -0
- package/public/img/waternormals.jpg +0 -0
- package/src/index.js +133 -123
- package/src/layers/Text.js +25 -19
- package/src/layers/model copy.js +314 -0
- package/src/layers/model.js +251 -148
- package/src/layers/scene.js +314 -0
- package/src/layers/water.js +239 -0
- package/src/map.js +28 -5
- package/src/package/mapLoad.vue +120 -0
- package/src/package/mapModel.vue +69 -0
- package/src/package/mapRain.vue +110 -0
- package/vue.config.js +1 -1
- package/public/img/30.gltf +0 -58151
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="mapLoad flex flex-col flex-align-center"
|
|
3
|
+
:class="{'loadOver' : !show}">
|
|
4
|
+
<img src="/img/loading.gif"
|
|
5
|
+
style="margin-top: 10%"
|
|
6
|
+
width="400" />
|
|
7
|
+
|
|
8
|
+
<div class="text-center"
|
|
9
|
+
style="width: 400px; margin-top: -90px">
|
|
10
|
+
<div class="mb-20">正在努力加载中...{{progress.toFixed(0)}}%</div>
|
|
11
|
+
<div class="progress-wrap">
|
|
12
|
+
<div class="progress-inner">
|
|
13
|
+
<div class="progress-nums"
|
|
14
|
+
:style="`width: ${progress}%`"></div>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
export default {
|
|
24
|
+
props: {
|
|
25
|
+
loading: { // 是否在加载
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true,
|
|
28
|
+
},
|
|
29
|
+
loadTime: { // 等待时长,毫秒
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 5000,
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
data () {
|
|
35
|
+
return {
|
|
36
|
+
progress: 0,
|
|
37
|
+
timer: '',
|
|
38
|
+
show: true,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
watch: {
|
|
42
|
+
loading: {
|
|
43
|
+
handler (val) {
|
|
44
|
+
if (!val) {
|
|
45
|
+
this.show = false
|
|
46
|
+
this.progress = 100
|
|
47
|
+
window.clearInterval(this.timer)
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
immediate: true,
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
destroyed () {
|
|
54
|
+
window.clearInterval(this.timer)
|
|
55
|
+
},
|
|
56
|
+
created () {
|
|
57
|
+
this.timer = setInterval(() => {
|
|
58
|
+
this.progress += 3
|
|
59
|
+
if (this.progress >= 99) {
|
|
60
|
+
window.clearInterval(this.timer)
|
|
61
|
+
}
|
|
62
|
+
}, this.loadTime / 30)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<style lang="scss" scoped>
|
|
68
|
+
.mapLoad {
|
|
69
|
+
position: absolute;
|
|
70
|
+
width: 100%;
|
|
71
|
+
height: 100%;
|
|
72
|
+
top: 0;
|
|
73
|
+
left: 0;
|
|
74
|
+
background-color: #d5f2fd;
|
|
75
|
+
z-index: 99999999;
|
|
76
|
+
transition: all 0.5s;
|
|
77
|
+
opacity: 1;
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
}
|
|
80
|
+
.loadOver {
|
|
81
|
+
opacity: 0;
|
|
82
|
+
pointer-events: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/*进度条*/
|
|
86
|
+
.progress-wrap {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 12px;
|
|
89
|
+
border-radius: 8px;
|
|
90
|
+
position: relative;
|
|
91
|
+
}
|
|
92
|
+
/*进度条底层背景样式*/
|
|
93
|
+
.progress-inner {
|
|
94
|
+
height: inherit;
|
|
95
|
+
background: rgb(142 193 255 / 20%);
|
|
96
|
+
border-radius: 8px;
|
|
97
|
+
}
|
|
98
|
+
/*进度层样式效果,使用动画效果*/
|
|
99
|
+
.progress-nums {
|
|
100
|
+
height: inherit;
|
|
101
|
+
border-radius: 6px;
|
|
102
|
+
background: repeating-linear-gradient(
|
|
103
|
+
-45deg,
|
|
104
|
+
#008bdd 25%,
|
|
105
|
+
#49beff 0,
|
|
106
|
+
#49beff 50%,
|
|
107
|
+
#008bdd 0,
|
|
108
|
+
#008bdd 75%,
|
|
109
|
+
#49beff 0
|
|
110
|
+
);
|
|
111
|
+
background-size: 16px 16px;
|
|
112
|
+
animation: panoramic 30s linear infinite;
|
|
113
|
+
}
|
|
114
|
+
/*定义动画*/
|
|
115
|
+
@keyframes panoramic {
|
|
116
|
+
to {
|
|
117
|
+
background-position: 200% 0;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div></div>
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script>
|
|
6
|
+
import {
|
|
7
|
+
addLayerModel,
|
|
8
|
+
} from './layers/model.js'
|
|
9
|
+
import {
|
|
10
|
+
addLayerScene,
|
|
11
|
+
} from '../layers/scene.js'
|
|
12
|
+
import {
|
|
13
|
+
addLayerWater,
|
|
14
|
+
} from './layers/water.js'
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
props: {
|
|
18
|
+
map: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => { }
|
|
21
|
+
},
|
|
22
|
+
id: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: '3dModel'
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
data () {
|
|
28
|
+
return {
|
|
29
|
+
scene: ''
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
mounted () {
|
|
33
|
+
this.init()
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
init () {
|
|
37
|
+
addLayerScene({
|
|
38
|
+
id: this.id,
|
|
39
|
+
position: [this.lng, this.lat],
|
|
40
|
+
directionalLight: [
|
|
41
|
+
{
|
|
42
|
+
color: 0xfffcce,
|
|
43
|
+
intensity: 1.5,
|
|
44
|
+
position: [-4800, 2400, -3200]
|
|
45
|
+
}
|
|
46
|
+
],
|
|
47
|
+
ambientLight: {
|
|
48
|
+
color: 0xFFFFFF,
|
|
49
|
+
intensity: 0.3,
|
|
50
|
+
},
|
|
51
|
+
sky: false,
|
|
52
|
+
// directionalLight: [],
|
|
53
|
+
// ambientLight: false,
|
|
54
|
+
shadow: false,
|
|
55
|
+
edit: false,
|
|
56
|
+
}).then(data => {
|
|
57
|
+
let { scene, sun } = data
|
|
58
|
+
console.log(scene)
|
|
59
|
+
this.addGLTF(scene, '/img/taoshan2.gltf')
|
|
60
|
+
this.addWater(scene, sun)
|
|
61
|
+
this.model = scene
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<canvas :id="id"
|
|
3
|
+
class="snow">不支持canvas</canvas>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
props: {
|
|
10
|
+
id: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'snow'
|
|
13
|
+
},
|
|
14
|
+
angle: { // 角度
|
|
15
|
+
type: Number,
|
|
16
|
+
default: -5
|
|
17
|
+
},
|
|
18
|
+
status: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: 'default' // 下雨状态
|
|
21
|
+
},
|
|
22
|
+
len: { // 雨滴长度
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 80
|
|
25
|
+
},
|
|
26
|
+
count: { // 雨滴数量
|
|
27
|
+
type: Number,
|
|
28
|
+
default: 500
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
data () {
|
|
32
|
+
return {
|
|
33
|
+
timer: '',
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
destroyed () {
|
|
37
|
+
window.clearInterval(this.timer)
|
|
38
|
+
},
|
|
39
|
+
mounted () {
|
|
40
|
+
this.start()
|
|
41
|
+
},
|
|
42
|
+
methods: {
|
|
43
|
+
start () {
|
|
44
|
+
const self = this
|
|
45
|
+
let canvas = document.getElementById(this.id)
|
|
46
|
+
let width = canvas.clientWidth
|
|
47
|
+
let height = canvas.clientHeight
|
|
48
|
+
|
|
49
|
+
let x2 = this.angle
|
|
50
|
+
let len = this.len
|
|
51
|
+
let count = this.count
|
|
52
|
+
let lineWidth = 1
|
|
53
|
+
|
|
54
|
+
if (this.status === 'small') {
|
|
55
|
+
x2 = 0
|
|
56
|
+
len = 50
|
|
57
|
+
count = 100
|
|
58
|
+
}
|
|
59
|
+
if (this.status === 'large') {
|
|
60
|
+
x2 = -35
|
|
61
|
+
count = 1000
|
|
62
|
+
lineWidth = 1.5
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
canvas.width = width
|
|
66
|
+
canvas.height = height
|
|
67
|
+
let ctx = canvas.getContext('2d')
|
|
68
|
+
|
|
69
|
+
self.timer = setInterval(clearCanvas, 50)
|
|
70
|
+
function clearCanvas () {
|
|
71
|
+
ctx.clearRect(0, 0, width, height)
|
|
72
|
+
draws()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function draw (x, y) {
|
|
76
|
+
//canvas写渐变:createLinearGradient(startX,startY,endX,endY)
|
|
77
|
+
let grd = ctx.createLinearGradient(x, y, x + x2, (y + len) * 5)
|
|
78
|
+
grd.addColorStop(0, 'rgba(255,255,255,0.1)')
|
|
79
|
+
grd.addColorStop(0.5, 'rgba(105,105,105,0.3)')
|
|
80
|
+
grd.addColorStop(1, 'rgba(255,255,255,0.5)')
|
|
81
|
+
ctx.strokeStyle = grd
|
|
82
|
+
|
|
83
|
+
ctx.beginPath()
|
|
84
|
+
ctx.moveTo(x, y)
|
|
85
|
+
ctx.lineTo(x + x2, y + len)
|
|
86
|
+
ctx.lineWidth = lineWidth
|
|
87
|
+
ctx.stroke()
|
|
88
|
+
ctx.closePath()
|
|
89
|
+
}
|
|
90
|
+
function draws () {
|
|
91
|
+
for (let i = 1; i <= count; i++) {
|
|
92
|
+
draw(Math.random() * width, Math.random() * height)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="scss" scoped>
|
|
101
|
+
.snow {
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 0;
|
|
104
|
+
left: 0;
|
|
105
|
+
width: 100%;
|
|
106
|
+
height: 100%;
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
background-color: rgba(145, 147, 184, 0.103);
|
|
109
|
+
}
|
|
110
|
+
</style>
|