您能告诉我如何在theStore
点击事件中将特定标记位置#street
的街景视图添加到地图中吗?
<button type="button" class="btn btn-default btn-sm" id="street">Strret View</button>
var theStore = {lat: -25.363, lng: 131.044};
var marker = new google.maps.Marker({
position: theStore,
map: map
});
google.maps.event.addDomListener(street, 'click', function () {
//Display Street View of theStore
});
答案 0 :(得分:1)
您只需将位置设置为某个标记的位置:
panorama = map.getStreetView();
panorama.setPosition(theStore);
panorama.setVisible(true);