How to call Google Maps panorama mode via API?
Using JS, you can parameterize and display Google Maps in a custom way:
//Setup Maps
function initialize(){
var geoLatLong = {lat:-23.5615129,lng:-46.6581976};
var mapOptions = {
zoom: 15,
disableDefaultUI: true,
center: geoLatLong,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false,
streetViewControl: true,
mapTypeControl: false
};
var map = new google.maps.Map(document.getElementById('divparamaps'),mapOptions);
var image = 'logo.png';
var pinPersonalizado = new google.maps.Marker({
position: geoLatLong,
map: map,
icon: image,
title: 'Masp Museu de Arte de São Paulo Assis Chateubriand - Avenida Paulista, São Paulo - SP',
animation: google.maps.Animation.DROP
});
}
//Após o carregamento do Document, chama o maps
google.maps.event.addDomListener(document, "load", initialize);
<!-- Considerar o import da API no Header -->
<div id="divparamaps"></div>
In case, to call Street View Mode, you can use the conventional way of Google Maps (Dragging the yellow doll up to a point that accepts Panorama view), but would like to know how to call via DOM.
I believe I could link an Event to Mark / Pin like this:
pinPersonalizado.addListener('click', function() {
// Chama Street View
});
But I can not understand how this will happen. I tried some of the ways that did not work.
If someone has already used this practice, please share! If I am traveling and this is impossible, please also alert me and I will remove the question to avoid problems!