Good day. I have this code that show street map base on the Lat and Longitude.
Button Click
<a id="street-view" class="btn btn-outline-primary btn-lg m-1 px-3" href="javascript:;">
<i class="fa fa-map small mr-2"></i>
View Neighbourhood
</a>
This ID display the Street View Map
<div id="street"></div>
CSS Code
#map,
#street {
display: none;
height: 450px;
width: 100%;
}
Js Code that display Map
// Initialize and add street view map
function initStreetView() {
// The location to load the street view at
const gpFarms = { lat: 4.836824, lng: 7.0115864 };
const streetDiv = document.getElementById("street");
const panorama = new google.maps.StreetViewPanorama(streetDiv, {
position: gpFarms,
});
}
I Want the street view Map to Display without Clicking the button