我有一个带有三个选项卡的选项卡面板。第三个选项卡是显示地图。我正在获取带有所需控件的地图,但它没有居中。点比选项卡的中心更偏西。所以我必须拖动地图将点带到 Tab 的中心。
选项卡面板代码
var infoPanel = new Ext.tab.Panel({
id: 'guestTabPan',
xtype: 'tabpanel',
title: 'Site Information',
autoDestroy: false,
items:[
{
id: 'siteTab',
title:'Site',
items:[
....
]
},{
title: 'Pressure',
id: 'pressureTab',
items:[
.....
]
},{
title: 'Map',
id: 'mapTab',
items:[
{
xtype: "panel",
id: 'mapTabPanel',
height: 1000,
layout: 'fit',
items:[
]
}
]
}
]
});
地图代码
var smallGoogleMap = {xtype: 'gmappanel',id :'gSmallSiteMap',width:'100%',height:1000,
zoomLevel:10,
gmapType: 'map',
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
setCenter: {
lat: SiteLat,
lng: SiteLng,
marker:{ title: SiteTitle}
}
};
Ext.getCmp('mapTabPanel').add(smallGoogleMap);
有什么猜测吗?