Looking to integrate a street view panorama using the Google Maps API in my VueJS project. I followed the documentation provided by Google maps here, and here is the basic template:
<div id="map"></div>
<div id="pano"></div>
Here is the corresponding script section:
mounted() {
var fenway = { lat: 42.345573, lng: -71.098326 };
var latlng = new google.maps.LatLng(42.345573, -71.098326);
map = new google.maps.Map(document.getElementById('map'), {
center: latlng,
zoom: 14
});
var panorama = new google.maps.StreetViewPanorama(
document.getElementById("pano"),
{
position: fenway,
pov: {
heading: 34,
pitch: 10
}
}
);
map.setStreetView(panorama);
}
I have included this in index.html
<script src="https://maps.googleapis.com/maps/api/js?key=API_KEY">
</script>