[Geoprisma-users] Re: [Geoprisma-dev] Layer loading problem

Stephen Woodbridge woodbri at swoodbridge.com
Fri Dec 4 18:11:35 EST 2009


Oops forgot the list.

Stephen Woodbridge wrote:
> Yves Moisan wrote:
>>>> How can I wait for the layer to display before selecting ?
>>>>   
>>> You could register a "loadend" event.  See the EditFeature.js for 
>>> event registration and callback functions examples.
>>
>> Yes, I've tried all flavours of event types and objects.  I tried
>> looking for tutorials on how to use events.  I don't even know if I
>> register the event on the map or the control.  I know it's just a matter
>> of having the layer loaded because the minute I stick in a debugger or
>> alert everything works.  I'm close.
>>
>> Pointers appreciated.
> 
> Yves,
> 
> http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Layer-js.html 
> 
> 
> scroll down to the EVENTS.
> 
> But it might be easies to to just set a delay timer that fires once and 
> selects the feature.
> 
> var mylayer = new OpenLayers.Layer....
> 
> mylayer.events.register("loadend", objtoselect, function(e) {
>    // select object this
>    // unregister event handler
> });
> 
> -Steve
> 



More information about the Geoprisma-users mailing list