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