谷歌地图不能垂直显示

Google Maps won't span vertically

本文关键字:显示 垂直 不能 谷歌地图      更新时间:2023-09-26

在单击标记时执行此代码。所有的工作都很好,除了地图不会在垂直方向span(它会在水平方向span)

这是我的代码(javascript)

 google.maps.event.addListener(marker, 'click', function() {
   infoBox.setContent('<div class="info_details">'+this.image+' <h2>'+this.title+'</h2> <div class="prop_details">'+this.type+' for '+this.type2+' - '+this.price+'</div>' );
   infoBox.open(map, this);    
   map.setCenter(this.position);      
   map.panBy(380,110);
 });

将infoBox的disableAutoPan -选项设置为true,否则调用panBy()会影响infoBox的自动平移。