forked from aws-samples/amazon-location-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.vue
79 lines (73 loc) · 1.6 KB
/
App.vue
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
<template>
<main>
<header>
<h1>Amazon Location × Amplify Geo</h1>
</header>
<section>
<div>
<Map
id="left"
:availableMaps="availableMaps"
@state-update="updateState"
@active-map-update="updateActiveMap"
:zoom="zoom"
:center="center"
:pitch="pitch"
:bearing="bearing"
:ActiveMap="ActiveMap"
/>
</div>
<div>
<Map
id="right"
:availableMaps="availableMaps"
@state-update="updateState"
@active-map-update="updateActiveMap"
:zoom="zoom"
:center="center"
:pitch="pitch"
:bearing="bearing"
:ActiveMap="ActiveMap"
/>
</div>
</section>
</main>
</template>
<script>
import { Geo } from 'aws-amplify';
import { ref } from 'vue';
import Map from './MapPane.vue';
export default {
components: { Map },
setup() {
const availableMaps = ref(Geo.getAvailableMaps());
const zoom = ref(14);
const center = ref([139.7648, 35.6794]);
const pitch = ref(30);
const bearing = ref(0);
const ActiveMap = ref(null);
function updateState(...args) {
zoom.value = args[0];
center.value = args[1];
bearing.value = args[2];
pitch.value = args[3];
}
function updateActiveMap(...args) {
ActiveMap.value = args[0];
}
return {
availableMaps,
zoom,
center,
pitch,
bearing,
ActiveMap,
updateState,
updateActiveMap,
};
},
};
</script>
<style>
@import '@/assets/style.css';
</style>