-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathWidgetMap3D.vue
More file actions
66 lines (60 loc) · 1.08 KB
/
WidgetMap3D.vue
File metadata and controls
66 lines (60 loc) · 1.08 KB
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
<template>
<div class="widget widget-map-3d">
<h3 class="title">{{title}}</h3>
<div class="canvas-container" ref="container">
<canvas ref="canvas"></canvas>
</div>
</div>
</template>
<script>
import GL from '@/gl/'
import { mapGetters } from 'vuex'
export default {
name: 'WidgetMap3D',
props: {
title: {
type: String,
default: "title"
}
},
computed: {
...mapGetters({
'windowWidth': 'ui/windowWidth'
})
},
watch: {
windowWidth () {
this.gl.handleResize()
}
},
mounted () {
this.gl = new GL(this.$refs.canvas, this.$refs.container)
},
beforeDestroy () {
this.gl.destroy()
}
}
</script>
<style lang="scss">
@import "./../../styles/variables.scss";
div.widget.widget-map-3d {
display: block;
.title {
color: $accent-color;
margin: 2px 5px 0;
text-align: left;
font-variant: small-caps;
font-size: 1rem;
}
.canvas-container {
overflow: hidden;
width: 100%;
height: 220px;
canvas{
margin: auto;
width: 100%;
height: 220px;
}
}
}
</style>