我正在尝试将街景视图显示到信息窗口中,但我没有得到它,这是我的代码:有谁知道如何做到这一点?
非常感谢您的先进
function createMarker(myLatlng) {
var panoramaOptions = {
position: myLatlng,
pov: {
heading: 34,
pitch: 10,
zoom: 1
}
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'),panoramaOptions);
map.setStreetView(panorama);
var contentString = '<div id="pano" style="width:200px;height:200px;"></div>';
var image = '/artworks/icons/myMarker.png';
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: "myTitle",
icon: image
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(contentString);
infowindow.open(map,marker);
map.setCenter(myLatlng);
});
return marker;
}