[OpenLayers-Dev] [vector-behavior] comments on recent commit
eric.c2c at gmail.com
Sun Jun 29 05:12:55 EDT 2008
Hi Tim. Yes i was indeed thinking about giving each feature an events
instance. I agree with you that we should consider performance. In any
way, my point is that vector layers should not be responsible for
triggering featuredestroyed events as features can be destroyed
directly without going through the vector layer. Thanks. Eric
2008/6/27, Tim Schaub <tschaub at opengeo.org>:
> Eric Lemoine wrote:
>> Some comments on your recent commit to vector-behavior (r7386). You
>> trigger "featuresdestroyed" while this event isn't in the EVENT_TYPES
>> array. Did you really want to trigger that event?
> This was probably the result of a sloppy merge on my part.
> I'll take a closer look as time permits.
>> In any way, I'm wondering if the vector layer should be responsible
>> for triggering "feature(s) destroyed" type events. One can do
>> feature.destroy() and in that case the layer doesn't even know the
>> feature is being destroyed. For that reason, I think it's the
>> feature's responsibility to trigger "featureremoved". Going further, I
>> think features should not be linked to a layer (currently features
>> have a "layer" property), vector layers should listen to
>> "featuredestroyed" events triggered by the features themselves and do
>> the job of removing the feature when such an event occurs.
> You mean give each feature an events instance?
> I don't think it's a bad idea to make more stuff observable - but I
> think we might want to look at any performance implications of this
> first (and perhaps consider how this could be done differently in 3.0).
>> Dev mailing list
>> Dev at openlayers.org
> Dev mailing list
> Dev at openlayers.org
More information about the Dev