[Users] GeoExt.MapPanel and TabPanel

Pierre Giraud pierre.giraud at camptocamp.com
Fri Sep 11 17:50:40 CEST 2009


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>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: [..]
>                                           })]
> });
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>



-- 
Pierre GIRAUD
Géomaticien, Analyste

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 93
Mail : pierre.giraud at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20090911/75f4fb02/attachment.htm 


More information about the Users mailing list