[Users] Loadmask
Andreas Hocevar
ahocevar at opengeo.org
Mon Dec 12 20:17:11 CET 2011
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 <kaivolland at web.de> 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
> 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