住所を指定してストリートビューを表示する単純なストリートビューがあります。
var geocoder = new google.maps.Geocoder();
var address = "344 Laguna Dr, Milpitas, CA 95035";
geocoder.geocode( { 'address': address},
function(results, status) {
//alert (results);
if (status == google.maps.GeocoderStatus.OK) {
//alert(results[0].geometry.location);
myStreetView = new google.maps.StreetViewPanorama(document.getElementById("map_canvas"));
myStreetView.setPosition(results[0].geometry.location);
var marker = new google.maps.Marker({
position: results[0].geometry.location,
map: myStreetView,
title:address
});
//alert ("yay");
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
ご覧のとおり、住所のマーカーをストリート ビューに追加します。私の質問は、ストリート ビューが北を向いていて、マーカーが南を向いているということです。特定されていない住所の場合、ストリート ビューがデフォルトで北を指すのではなく、住所のマーカーを指すように指定するにはどうすればよいですか?