Currently I am outputting 2 google maps on the page, the first outputs the normal road map view, the second, street view.
Is there a way that I could load only one instance of a Google map but when clicking on a button, it'll toggle to street view?
Worked out it out by declaring a var panorama
and set to setVisible
on click of button:
var panorama = map.getStreetView();
panorama.setPosition(latlng);
panorama.setPov({
heading: 45,
pitch:-10}
);
$("#myBtn").on('click', function(){
panorama.setVisible(true);
});