我有一个单一标记和单个infoBubble的谷歌地图。单击标记时出现infobubble。问题在于信息泡沫直接出现在标记上,而不是结束。查看截图:infoBubble错误定位在标记上
infoBubble关闭: infoBubble是开放的: 这是代码,我使用的地理编码器,因为我有只名叫地址:
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myOptions = {
zoom: 14,
center: results[0].geometry.location,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
//i am using simple InfoBubble initialization
var infoBubble = new InfoBubble(
{
map: map,
content: "<h2>"+name+"</h2><div>"+street+"</div><div>"+city+", "+zip+"</div>"
});
google.maps.event.addListener(marker, 'click', function(e) {
infoBubble.open(map,marker);
});
}
});
任何线索,这是为什么发生了什么?
我已经试过了,结果没变。 – user985409 2013-02-27 12:22:39