-
Notifications
You must be signed in to change notification settings - Fork 4
/
SamplePosition.vue
47 lines (45 loc) · 1004 Bytes
/
SamplePosition.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
<template>
<div v-if="coords">
<GmapMap
:center="center"
:zoom="15"
map-type-id="satellite"
style="width: 500px; height: 300px"
>
<GmapMarker
v-for="(m, index) in markers"
:key="`marker_${index}`"
:position="m.position"
:clickable="true"
:draggable="true"
@click="center=m.position"
/>
<GmapCircle
:center="center"
:radius="accuracy"
/>
</GmapMap>
</div>
</template>
<script>
import { mapGeolocationGetters } from 'quasar-app-extension-geolocation/src/store'
export default {
computed: {
center () {
return this.coords && { lat: this.latitude, lng: this.longitude }
},
centerMapper () {
return this.center && { position: this.center }
},
markers () {
return this.centerMapper ? [this.centerMapper] : []
},
...mapGeolocationGetters([
'coords',
'latitude',
'longitude',
'accuracy'
])
}
}
</script>