2019-01-21 15:08:22 +01:00
|
|
|
<template>
|
|
|
|
<div>{{ center.lat }} - {{ center.lng }}</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-02-18 08:57:00 +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;
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
description = "Paris, France";
|
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
center = { lat: 48.85, lng: 2.35 };
|
2020-02-18 08:57:00 +01:00
|
|
|
|
2019-01-21 15:08:22 +01:00
|
|
|
markers: any[] = [];
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
setPlace(place: any) {
|
2019-01-21 15:08:22 +01:00
|
|
|
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
|
|
|
];
|
|
|
|
|
2020-02-18 08:57:00 +01:00
|
|
|
this.$emit("input", place.formatted_address);
|
2019-01-21 15:08:22 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|