Can anyone help me with displaying a Google Map using Vue.js? I have provided the code below, but I keep getting an error saying "maps is undefined" even though I have installed all the necessary dependencies for Google Maps.
<div id="map"></div>
Here is my script:
import Vue from 'vue'
import * as VueGoogleMaps from 'vue2-google-maps'
export default {
data: function() {
return {}
},
mounted() {
let myLatlng = new window.google.maps.LatLng(12.9716, 77.5946);
let mapOptions = {
zoom: 14,
center: myLatlng,
scrollwheel: true,
};
let map = new window.google.maps.Map(
document.getElementById("map"),
mapOptions
);
let marker = new window.google.maps.Marker({
position: myLatlng,
title: "Bangalore"
});