[Users] GeoExt.MapPanel and TabPanel

Luca Casagrande luca.casagrande at gmail.com
Fri Sep 11 18:03:29 CEST 2009


Hi Pierre and thanks for your answer,
adding null as you suggested brings the same problem :(
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.

Ciao
Luca


Pierre Giraud ha scritto:
> Hum, I don't think that you create your map object the right way.
> new OpenLayers.Map(options)
> 
> As per OpenLayers, options should be given as second argument. The first
> one is the id of the div you want to put the map into which isn't
> required when you use a MapPanel.
> In your case, you'd better try with the following :
> 
> new OpenLayers.Map(null, options)
> 
> Regards,
> Pierre
> 
> On Fri, Sep 11, 2009 at 4:55 PM, Luca Casagrande
> <luca.casagrande at gmail.com <mailto:luca.casagrande at gmail.com>> wrote:
> 
>     Hello folks,
>     I have some troubles with GeoExt.MapPanel and Ext.TabPanel (the code
>     is at the end of the message):
>     - if I set as activeTab the one with the map, it doesn't load the
>     overlay layers and firebug says:
> 
>     tile is undefined
>     [Break on this error] tile.unload();\nGrid.js (riga 563)
>     bottomLeftTile is undefined
>     [Break on this error] bounds = new
>     OpenLayers.Bounds(bottomLeftTile.bounds.left, \n
> 
>     - if I set as activeTab the other one, all is fine.
>     Can this be related to DOM loading?
> 
>     Thanks
>     Ciao
>     Luca
> 
>     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',
>                                                    closable : false,
>                                                    map: new
>     OpenLayers.Map(options),
>                                                    center: [lon, lat],
>                                                    zoom: 0,
>                                                    layers: [..]
>                                               })]
>     });



More information about the Users mailing list