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
| <template>
| <div class="bottom_btn">
| <div class="btn_box">
| <span> 经度:{{lng }}</span>
| </div>
| <div class="btn_box">
| <span>纬度:{{lat }}</span>
| </div>
| <div class="btn_box">
| <span>高度:{{alt }}米</span>
| </div>
| </div>
| </template>
|
| <script lang="ts" setup>
| import {
| ref,
| onMounted,
| onBeforeUnmount,
| reactive,
| defineProps,
| defineEmits,
| } from "vue";
| const lng = ref(null);
| const lat = ref(null);
| const alt = ref(null);
| const setMouseEvents = (res) => {
| if (res.type == "MOUSE_MOVE") {
| lng.value = res.longitude;
| lat.value = res.latitude;
| alt.value = res.altitude;
| }
| };
| onMounted(() => {
| window.addMouseEvents = setMouseEvents;
| });
| </script>
| <style lang="less" scoped>
| .bottom_btn {
| position: absolute;
| bottom: 15px;
| left: 75px;
| display: flex;
| .btn_box {
| margin-right: 10px;
| background-size: 100% 100%;
| font-size: 16px;
| cursor: pointer;
| display: flex;
| justify-content: center;
| align-items: center;
| span {
| color: #fff;
| }
| }
| }
| </style>
|
|