信息窗口显示街景,但多个标记显示相同的街景。它采用最后一个地址以在所有标记中显示街景。
代码:
geocoder.geocode( { 'address': "{!acc.BillingCity}"}, function(results, status) {
alert("{!acc.BillingCity}");
if (status == google.maps.GeocoderStatus.OK) {
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
title : 'Click Here!!!'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map, marker);
});
var pano = null;
google.maps.event.addListener(infowindow, 'domready', function() {
if (pano != null) {
pano.unbind("position");
pano.setVisible(false);
}
pano = new google.maps.StreetViewPanorama(document.getElementById("content"), {
navigationControl: true,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.ANDROID
},
enableCloseButton: false,
addressControl: false,
linksControl: false
});
pano.bindTo("position", marker);
pano.setVisible(true);
});
google.maps.event.addListener(infowindow, 'closeclick', function() {
pano.unbind("position");
pano.setVisible(false);
pano = null;
});
markerBounds.extend(results[0].geometry.location);
map.fitBounds(markerBounds);
}else if(status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
wait = true;
setTimeout("wait = true", 2000);
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
如何处理(StreetViewPanorama)显示带有多个标记的街景。谢谢