[OpenLayers-Dev] 3016-new event-in "toState" method or triggered
adube at mapgears.com
Mon Mar 7 14:23:40 EST 2011
My... I should really read twice before annoying ppl with my useless
questions : the answer has already been given in the ticket by Eric.
"Let's use the toState method" is the answer.
Sorry for the noise,
On 11-03-07 02:03 PM, Alexandre Dube wrote:
> I'm working on this ticket  where I'm adding a new
> "featurestatechanged" event in the OL.Layer.Vector. It should be
> triggered every time a feature.state is set to a new value.
> Looking at OL.Feature.Vector, I can see that there is a "toState"
> method where I also need to trigger this new event. That makes me
> think : why isn't this method used everywhere when setting a new state
> ? It has been there for a long time  but doesn't seem to be much
> used (currently only by the OL.Control.TransformFeature control).
> So, would it be okay if every line of code using "feature.state =
> newState" were replaced by "feature.toState(newState)" to allow the
> new event to be triggered inside the toState method only, or should
> it be left as it is and add the event trigger after each
> "feature.state = newState" line ?
> Thanks for any comments,
>  http://trac.osgeo.org/openlayers/ticket/3016
>  http://trac.osgeo.org/openlayers/changeset/2336
More information about the Dev