[Users] Fwd: GeoExt.LegendPanel too slow with too many sublayers

Vito Meuli v.meuli at tecnologieavanzate.it
Tue May 11 17:17:11 CEST 2010


Hi Andread, hi List!
I've deployed the faulty webgis.
The URL is http://www.servizi.taol.it/grottaglie_data/tawebgis5/grottaglietest.html

You can see I have a LOT of Layers (about 30) and sublayers (about 250) on the left, and a button "Legenda" on the right of the map toolbar.

The Layers are in a TreeLayer embedded in the viewport:
---------------------------------------
            {
                id: "tree",
                title: "Livelli tematici",
                xtype: "layertree",
                map: map,
                enableDD: true,
                model: model,
                lines: false,
                plugins: [mapfish.widgets.LayerTree.createContextualMenuPlugin(['opacitySlide'])]
            }
---------------------------------------
and I open the legend with a function activated from the button (when the page is fully loaded):
---------------------------------------
function openLegend(){
    // create the window on the first click and reuse on subsequent clicks
    if (!winLegenda) {
        winLegenda = new Ext.Window({
            applyTo: 'legenda-win',
            layout: 'fit',
            width: 600,
            height: 500,
            closeAction: 'hide',
            plain: true,

            items: new GeoExt.LegendPanel({
                id: "legend_panel",
                defaults: {
                    style: 'padding: 5px',
                    labelCls: 'legenda_titoli',
                    imageFormat: "image/png"
                },
                autoScroll: true
            }),
            buttons: [{
                text: 'Chiudi',
                handler: function(){
                    winLegenda.hide();
                }
            }]
        });
    }
    winLegenda.show();
};
------------------------------------------

Any idea?

Thank you for your help.
Regards
Vito


----- Messaggio originale -----
Da: "Andreas Hocevar" <ahocevar at opengeo.org>
A: "Vito Meuli" <v.meuli at tecnologieavanzate.it>
Cc: "GeoExt Users" <users at geoext.org>
Inviato: Martedì, 11 maggio 2010 9:42:23 GMT +01:00 Amsterdam/Berlino/Berna/Roma/Stoccolma/Vienna
Oggetto: Re: [Users] Fwd: GeoExt.LegendPanel too slow with too many sublayers

Hi,

just an idea (untested): try to create your LegendPanel *after* the tree, and after the map is rendered (e.g. in the Tree's or the MapPanel's "render" event).

The reason why I think this should work is because the tree, while it builds, will cause the layers to be configured with *only* the *visible* sublayers.

Regards,
Andreas.

On May 11, 2010, at 09:12 , Vito Meuli wrote:

> [Cross posting from Mapfish-Users]
> 
> Hi list!
> I'm facing a problem with my first production-lever webgis realized with Mapfish+GeoExt.
> 
> The customer requires a lot of WMS Layers (about 30), each Layer having a lot of sublayers, so I have about 300 sublayers in my map...non all displayed, of course! :-)
> They are in a mapfish.widgets.LayerTree, some displayed and a lot of them off.
> 
> I'm displaying the legend by means of a GeoExt.LegendPanel.
> 
> Now the problem is that GeoExt.LegendPanel loads all of the sublayers images, without considering weather the Layers are on or off...you can imagine it takes 2 minutes to load the LegendPanel!
> No good.
> 
> I'm using old (some months) version of Mapfish and GeoExt...
> What version are they? I don't know! How can I tell from the code what version  are they? 
> (I messed up code folders from different version in the process of solving some bugs in the last few months).
> 
> I cannot find any message in the list about such a problem.
> 
> Can you advise some solution?
> * New version of GeoExt?
> * Any parameter that can correct the bad behaviour?
> 
> * Reducing the number of sublayers, I know it shoud be done, but it costs a lot of data analisys to understand which sublayers can be merged in a single sublayer.
> 
> I'll have the webgis published in a few days, if you need to look at the code.
> 
> Thank you in advance!
> Cheers
> Vito Meuli
> -- 
> ing. Vito Meuli
> Tecnologie Avanzate s.r.l.
> via B. Croce 49
> 70015 Noci
> BARI
> 
> web: www.tecnologieavanzate.it
> tel. +390804979652
> fax. +390804979263
> 
> -- 
> ing. Vito Meuli
> Tecnologie Avanzate s.r.l.
> via B. Croce 49
> 70015 Noci
> BARI
> 
> web: www.tecnologieavanzate.it
> tel. +390804979652
> fax. +390804979263
> _______________________________________________
> 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.


-- 
ing. Vito Meuli
Tecnologie Avanzate s.r.l.
via B. Croce 49
70015 Noci
BARI

web: www.tecnologieavanzate.it
tel. +390804979652
fax. +390804979263


More information about the Users mailing list