[Users] GeoExt.MapPanel and TabPanel
Andreas Hocevar
ahocevar at opengeo.org
Fri Sep 11 18:17:17 CEST 2009
Luca Casagrande wrote:
> Hi Pierre and thanks for your answer,
> adding null as you suggested brings the same problem :(
>
Understandable. OpenLayers.Map also accepts a single argument configuration.
> What I don't understand is why if I set as active tab the first one,
> the page loads with no error and all is working fine.
>
The problem is the way ExtJS hides elements by default, by setting
style.display to none. Try setting hideMode to "offsets" in your
mapPanel config, and see
http://www.extjs.com/deploy/dev/docs/source/Component.html#cfg-Ext.Component-hideMode
for more details.
>> Code:
>> var mapTab = new Ext.TabPanel({
>> region: 'center',
>> deferredRender: false,
>> activeTab: 0,
>> items: [{
>> html: '<p>Test</p>',
>> title:'Welcome!',
>> closable: false,
>> autoScroll: true
>> },
>> new GeoExt.MapPanel({
>> title: ' Test',
>>
hideMode: 'offsets',
>> closable : false,
>> map: new
>> OpenLayers.Map(options),
>> center: [lon, lat],
>> zoom: 0,
>> layers: [..]
>> })]
>> });
>>
Please report back if this fixes your issue.
Regards,
Andreas.
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list