[OpenLayers-Users] How can I catch an OL event inside a custom tool

Eric Lemoine eric.lemoine at camptocamp.com
Mon Mar 21 04:30:13 EDT 2011


On Mon, Mar 21, 2011 at 8:24 AM, David Alda Fernandez de Lezea
<dalda at ikt.es> wrote:
> Eric,
>
> Thanks for your response. I've done something like this:
>
> initialize: function(layer, options) {
>
> ...
>        this.EVENT_TYPES.push("featureselected");

Remove this.


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

Do this instead:

layer.events.on({
    featureselected: function(evt) {
        var feature = evt.feature;
    }
});



-- 
Eric Lemoine

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

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Users mailing list