I added a marker, but I need to substitute my coordinates from the database. how to change center and markers [0] .position to your this.order.coordinates.lat and lng

export default { name: "order-view", data: () => ({ order: { title: '', description: '', coordinates: '', address:'', date: '', time_period:'', budget_scale_id: '', user: { first_name: '', last_name: '', } }, zoom: 2, center: { lat: 0, lng: 0 }, markers: [{ position: { lat: 0, lng: 0, } }], }), async mounted() { let order = await this.$store.dispatch('orders/getOrder', { id: this.$route.params.id }); this.order = order.order; this.order.user = order.user; }, } <gmap-map class="form-control maps" :zoom="zoom" :center="center"> <GmapMarker v-for="(marker, index) in markers" :key="index" :position="marker.position" :clickable="false" :draggable="false" /> </gmap-map> 

    1 answer 1

    It turns out that there was a type mismatch, it worked, I do not see any visible errors. it was worth only sparsing

     async created() { let order = await this.$store.dispatch('orders/getOrder', { id: this.$route.params.id }); this.order = order.order; this.order.user = order.user; this.markers[0].position.lat = parseFloat(this.order.coordinates.lat); this.markers[0].position.lng = parseFloat(this.order.coordinates.lng); },