Streetview有时不会出现在Google Maps v3中

时间:2013-03-02 20:18:14

标签: google-maps google-maps-api-3 google-street-view

这是我的代码

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);
});

现在的问题是,有时街景不会来。怎么解决这个问题?

0 个答案:

没有答案