2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
|
|
|
<div>{{ center.lat }} - {{ center.lng }}</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2019-03-22 10:57:14 +01:00
|
|
|
import { Component, Prop, Vue } from 'vue-property-decorator';
|
2019-01-21 15:08:22 +01:00
|
|
|
|
|
|
|
@Component
|
|
|
|
export default class Location extends Vue {
|
|
|
|
@Prop(String) address!: string;
|
|
|
|
|
2019-03-22 10:57:14 +01:00
|
|
|
description = 'Paris, France';
|
2019-01-21 15:08:22 +01:00
|
|
|
center = { lat: 48.85, lng: 2.35 };
|
|
|
|
markers: any[] = [];
|
|
|
|
|
|
|
|
setPlace(place) {
|
|
|
|
this.center = {
|
|
|
|
lat: place.geometry.location.lat(),
|
2019-03-22 10:57:14 +01:00
|
|
|
lng: place.geometry.location.lng(),
|
2019-01-21 15:08:22 +01:00
|
|
|
};
|
|
|
|
this.markers = [
|
|
|
|
{
|
2019-03-22 10:57:14 +01:00
|
|
|
position: { lat: this.center.lat, lng: this.center.lng },
|
|
|
|
},
|
2019-01-21 15:08:22 +01:00
|
|
|
];
|
|
|
|
|
2019-03-22 10:57:14 +01:00
|
|
|
this.$emit('input', place.formatted_address);
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|