Eric,

Thanks for your response. I've done something like this:

initialize: function(layer, options) {
        
...
        this.EVENT_TYPES.push("featureselected"); 
...

this.events.on({
        featureselected: function(evt) {
                var myEvt = evt;        
        }
});

}

But I can't get inside this method (I'm debugging with firebug). Is this the 
way you meant??

Thanks.
 
Un saludo,
 
··················································································

David Alda Fernández de Lezea
Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y Biodiversidad
 
IKT
Granja Modelo s/n · 01192 · Arkaute (Araba)

··················································································
Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
··················································································
email: [email protected]                                web: www.ikt.es
··················································································

-----Mensaje original-----
De: Eric Lemoine [mailto:[email protected]] 
Enviado el: viernes, 18 de marzo de 2011 14:32
Para: David Alda Fernandez de Lezea
CC: [email protected]
Asunto: Re: [OpenLayers-Users] How can I catch an OL event inside a custom tool

On Friday, March 18, 2011, David Alda Fernandez de Lezea <[email protected]> wrote:
> Hi list,
>
> I've developed a custom tool that makes some geometric operations using a 
> selected feature, and I want this tool to be active only when there is 1 
> feature selected in the layer. If the selection is empty the tool must 
> deactitvated. How can I catch that event (featureselected) from my tool?? Any 
> ideas?

Your tool must have a reference to the vector layer and register to the 
"featureselected" events.

--
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : [email protected]
http://www.camptocamp.com
_______________________________________________
Users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to