[OpenLayers-Users] featureadded not passing single feature to event listener, returning all features

Carlos Krefft ckrefft at rsmas.miami.edu
Fri Mar 18 15:06:58 EDT 2011


Rookie mistake correct code is:

 

    function featureAdded(event) {

        console.log(event.feature);

    }

 

 

 

From: openlayers-users-bounces at lists.osgeo.org
[mailto:openlayers-users-bounces at lists.osgeo.org] On Behalf Of Carlos Krefft
Sent: Friday, March 18, 2011 11:22 AM
To: users at openlayers.org
Subject: [OpenLayers-Users] featureadded not passing single feature to event
listener, returning all features

 

When I add the "featureadded" event listener I seem to get all features
passed. Same thing with "beforefeatureadded"

 

In the code below "this" returns all features instead of ONE feauture. Is
this a bug or am I doing something wrong?

 

 

myLayer.events.register("featureadded", CSTARS.UI.Map.Results.Layer,
featureAdded);

 

    function featureAdded() {

        console.log(this);

    }

 

 

Relevant Documentation:

http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLay
ers/Layer/Vector-js.html

 

 

 

Kind Regards,

Carlos 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110318/542b0615/attachment.html


More information about the Users mailing list