I know there is a loadstart and loadend event for each layer. I'm certain
there is a more elegant solution that this, but you could create a dynamic
list yourself. Maybe something like this?


//add eventListeners to your layers like this:
var OSMLayer = new OpenLayers.Layer.OSM("OpenStreetMap","
http://tile.openstreetmap.org/${z}/${x}/${y}.png",{eventListeners:
{"loadstart": layerLoadStart,"loadend": layerLoadEnd}})


//create an object with your layers
var layers=new Object
function layerLoadStart(e){

//using the id of the layer, mark it as 'started'
layers[e.object.id]="started"
}
function layerLoadEnd(e){

//when it finishes, mark it as 'loaded'
layers[e.object.id]="loaded"

}

On Wed, Apr 18, 2012 at 3:23 AM, Tobias Reinicke <[email protected]> wrote:

> Hello All,
>
> I might have missed where this has been written, but is there not a
> "loadend" event for the entire map (rather than on a layer basis?). If
> not, what is the best way to check that all layers on a map have
> finished loading? I know there was some work done on the Loading Panel
> add-in, but as far as I can tell this iterates through all layers and
> registers loadend events on them.
>
> Any help would be be much appreciated.
>
> Regards,
>
> Toby
> _______________________________________________
> Users mailing list
> [email protected]
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
>
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to