Looking to integrate the vue google maps package? You can find it here: https://github.com/xkjyeah/vue-google-maps
Within a mounted()
lifecycle hook, I am attempting to set the layer as shown below:
mounted() {
this.$refs.gmap.$mapPromise.then((map) => {
let options = {
url: 'https://beeline.kg/ru/binaries/content/assets/kmz-files/3g-v2.kmz'
}
let kml = new google.maps.KmlLayer(options)
kml.setMap(this.$refs.gmap)
})
},
Encountering an error in console stating: "InvalidValueError: setMap: not an instance of Map"
The reference this.$refs.gmap
points to a google maps component defined like this:
<GmapMap
ref="gmap"
:center="{lat: lat, lng: lng}"
:zoom="5"
map-type-id="roadmap"
style="width: 100%; height: 500px"
:options="{
mapTypeControl: false
}"
>
</GmapMap>
It seems that the issue lies here:
let kml = new google.maps.KmlLayer(options)
How can I correctly instantiate a new google maps object when using this particular package?