Creating basic google map
<template>
<GmapMap
:center="center"
:zoom="7"
map-type-id="terrain"
style="width: 100%; height: 400px"
@click="mapClicked"
>
<GmapMarker
:key="index"
v-for="(m, index) in markers"
:position="m.position"
:clickable="true"
:draggable="true"
@click="center=m.position"
/>
</GmapMap>
</template>
<script>
export default {
data() {
return {
center: { lat: 10.0, lng: 10.0 },
markers: [
{ position: { lat: 10.0, lng: 10.0 } },
{ position: { lat: 11.0, lng: 11.0 } },
]
}
},
}
</script>