[Users] Openlayers 2.11 and Map tabs
Dan Ramage
dan at inlet.geol.sc.edu
Tue Nov 29 20:49:52 CET 2011
Ah, I was wondering if that might be the cause.
I ended up having to set deferredRender: false on all the panels that made
up a tab, as well as the tabPanel.
Thanks for the suggestion!
Dan
-----Original Message-----
From: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] On Behalf
Of Andreas Hocevar
Sent: Tuesday, November 29, 2011 2:04 PM
To: Dan Ramage
Cc: users at geoext.org
Subject: Re: [Users] Openlayers 2.11 and Map tabs
Oh sorry, I just saw that we're on the GeoExt list here, and not
OpenLayers. I seem to remember that I was able to solve this by
configuring the TabPanel with
deferredRender: false
Minimal example:
new Ext.TabPanel({
deferredRender: false,
width: 600,
height: 400,
renderTo: document.body,
activeTab: 0,
items: [{
xtype: "gx_mappanel",
title: "map 1",
layers: [new OpenLayers.Layer.OSM()],
center: [0,0],
zoom: 1
}, {
xtype: "gx_mappanel",
title: "map 2",
layers: [new OpenLayers.Layer.WMS("wms",
"http://demo.opengeo.org/geoserver/wms", {layers: "world"})],
center: [0,0],
zoom: 1
}]
});
Andreas.
On Tue, Nov 29, 2011 at 7:27 PM, Dan Ramage <dan at inlet.geol.sc.edu> wrote:
> Thanks, however that had no affect.
> I also tried get the extents then calling zoomToExtent() which didn't
work.
> However, calling setCenter() does cause the map to be drawn. Looks like I
> need to investigate what setCenter() does to cause the map to be drawn.
>
> Dan
>
> -----Original Message-----
> From: andreas.hocevar at gmail.com [mailto:andreas.hocevar at gmail.com] On
Behalf
> Of Andreas Hocevar
> Sent: Tuesday, November 29, 2011 1:12 PM
> To: Dan Ramage
> Cc: users at geoext.org
> Subject: Re: [Users] Openlayers 2.11 and Map tabs
>
> Try to call map.updateSize() when you hit a tab for the first time.
>
> Andreas.
>
> On Tue, Nov 29, 2011 at 5:36 PM, Dan Ramage <dan at inlet.geol.sc.edu> wrote:
>> I've been experimenting with OL2.11 and noticed that on my maps with
tabs,
>> when I open a different tab nothing happens in the map area. If I zoom,
> then
>> the map fills in(baselayers, WMS layers). Some bits of the map are
present
>> initially such as the Permalink and the Google logo for the baselayer.
>>
>>
>>
>> Seems like there might be an init function not being triggered.
>>
>>
>>
>>
>>
>> Dan
>>
>> _______________________________________________
>> Users mailing list
>> Users at geoext.org
>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
>
> --
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list