[Geoprisma-dev] Layer loading problem

Stephen Woodbridge woodbri at swoodbridge.com
Fri Dec 4 20:16:22 EST 2009


Yves,

Here are some examples of using loadend event on a layer:

I think this is doing exactly what you want:
http://n2.nabble.com/How-to-stop-registering-events-td3911670.html

Some other random ones:

layer.events.register("loadend", layer, function() {
console.log(layer.features.length); });

http://trac.openlayers.org/browser/trunk/openlayers/examples/layerLoadMonitoring.html

Found these in:
http://www.google.com/#hl=en&source=hp&q=openlayers+event+loadend+example

Hope this helps.

-Steve

Yves Moisan wrote:
>> Yves,
>>
>> http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Layer-js.html
>>
> Hi Stephen,
> 
> Thank you for your answer.  I've seen the reference page many times, but
> I would prefer a simple tutorial.  I mean, what I'm doing is relatively
> simple ...
> 
>> scroll down to the EVENTS.
>>
>> But it might be easies to to just set a delay timer that fires once and 
>> selects the feature.
> 
> I like that much less because you are at the mercy of the network.
> Events are way better IMO.  Just gotta find out what the machinery is.
> 
> Thanx for your input.
> 
> Have a good weekend,
> 
> Yves
>> var mylayer = new OpenLayers.Layer....
>>
>> mylayer.events.register("loadend", objtoselect, function(e) {
>>     // select object this
>>     // unregister event handler
>> });
>>
>> -Steve
> 




More information about the Geoprisma-dev mailing list