[OpenLayers-Dev] [vector-behavior] comments on recent commit

Eric Lemoine eric.c2c at gmail.com
Fri Jun 20 00:44:09 EDT 2008


Tim,

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?

 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.

Thanks,
--
Eric



More information about the Dev mailing list