目标:获取TEXT地址,然后在同一时间显示的街道视图和地图视图如何改变街景在谷歌地图3
参考网站:
http://code.google.com/apis/maps/documentation/javascript/examples/streetview-simple.html
我的网站: http://www.iamvishal.com/dev/property/P2154(请点击地图视图查看地图)
问题:我能够正确显示地图和地址,但instreet视图不会改变。任何想法为什么?
我的JS变量的地址在此情况下按住文本地址“323235巴尔莫勒尔露台希顿泰恩河畔纽卡斯尔”
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);
}
}
);
}
你是如何得到intLat,intLong问题?做ü拥有该 – 2012-02-09 19:15:17
代码,你可以只使用你的“芬威”经纬度? – duncan 2012-02-10 09:06:38
可惜没因为我需要一个文本字符串,然后获得地理编码geocoderTwo.geocode({“地址”:地址},功能(结果状态) – 2012-02-10 13:26:17