Hi,
try something like
var loadMask = new Ext.LoadMask(Ext.getBody(),{
msg:"Loading Layer. Please wait."
});
loadMask.show();
var numLoadingLayers = layerStore.getCount();
function checkLoaded() {
layer.events.unregister("loadend", checkLoaded, this);
numLoadingLayers--;
if (numLoadingLayers === 0) {
loadMask.hide();
}
}
layerStore.each(function(rec) {
var layer = rec.getLayer();
layer.events.register("loadend", checkLoaded, layer);
});
This has to run before the layers from the layerStore are added to the
map. And note that the above is untested, but it should point you in
the right direction.
Andreas.
On Mon, Dec 12, 2011 at 4:00 PM, Kai Volland <[email protected]> wrote:
> Hi,
>
> i'd like to use an Ext.LoadMask when loading Layers from my layertree.
> How to use it?
>
> I already tried loadMask.show() and loadMask.hide() on several events in
> the layerstore and the treepanel. But nothing worked for me.
>
> var loadMask = new Ext.LoadMask(Ext.getBody(),{
> msg:"Loading Layer. Please wait."
> //store: layerStore <<---- didn't work
> });
>
> Any ideas?
>
> Kind regards,
>
> Kai Volland
> _______________________________________________
> Users mailing list
> [email protected]
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
_______________________________________________
Users mailing list
[email protected]
http://www.geoext.org/cgi-bin/mailman/listinfo/users