1

这是我的代码

panoramaOptions = {
enableCloseButton : true,
visible : false
};

myPano = new google.maps.StreetViewPanorama(document.getElementById("pano"), panoramaOptions);

var mapOptions = {
    center: currentCenter,
    zoom: defaultZoom,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    overviewMapControl: true,
    streetViewControl: false,
    streetView : myPano
};
map = new google.maps.Map(document.getElementById("map"), mapOptions);  

map.setStreetView(myPano);

google.maps.event.addListener(map,"click", function(e) {
map.setCenter(e.latLng);
myPano.setPosition(e.latLng);

if (marker != null) {
        marker.setMap(null);
}

marker = new google.maps.Marker({
        icon: new google.maps.MarkerImage("http:///maps.gstatic.com/mapfiles/cb/man_arrow-0.png"),
        map: map,
        draggable: true,
        position: e.latLng
});

marker.setMap(map);
myPano.setVisible(true);
});

现在的问题是有时街景不会出现。如何解决这个问题?

4

0 回答 0