[OpenLayers-Users] Understanding events

Yves Moisan yves.moisan at boreal-is.com
Wed Dec 9 09:19:04 EST 2009


> Wrap your function in anonymous instead.
> 
> BTW map doesnt have loadend event but on vector layer
> http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.EVENT_TYPES
> http://dev.openlayers.org/docs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.EVENT_TYPES

Yes, I noticed that after thank you.

> 
> layers[0].events.register("loadend", layers[0], function(evt){
>   //do what you have to do here...
>    selectFeature(layers[0],oFeatures[0].fid));
> });

layers[0].events.register("loadend", layers[0], function(){
         //do what you have to do here...
         selectFeature(layers[0],oFeatures[0].fid);});

Works fine thanx !  I'll have to find pointers as to why putting no
argument or a dummy argument in the anonymous function doesn't matter.

Thanx !  And thanx Stephen too !

Yves






More information about the Users mailing list