【发布时间】:2012-02-08 20:14:15
【问题描述】:
目标:获取TEXT地址,然后同时显示街景和地图视图
参考网站:
http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html
我的网站: http://www.iamvishal.com/dev/property/P2154(请点击地图查看地图)
问题:我能够正确显示地图和地址,但街景没有改变。知道为什么吗?
我的 js 变量地址在这种情况下保存文本地址“323235 Balmoral Terrace Heaton Newcastle Upon Tyne”
function initialize()
{
var fenway = new google.maps.LatLng(42.345573,-71.098326);
var mapOptions = {
center: fenway,
zoom: 14,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(
document.getElementById("map_canvas"), mapOptions);
var panoramaOptions = {
position: fenway,
pov: {
heading: 34,
pitch: 10,
zoom: 1
}
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById("pano"),
panoramaOptions);
map.setStreetView(panorama);
var geocoderTwo = new google.maps.Geocoder();
geocoderTwo.geocode({"address":address},function(results, status)
{
if (status == google.maps.GeocoderStatus.OK)
{
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker
({
map: map,
position: results[0].geometry.location
});
}
else
{
alert("Geocode was not successful for the following reason: " + status);
}
}
);
}
【问题讨论】:
标签: google-maps google-maps-api-3