[OpenLayers-Dev] Handler.Feature question and patch
tschaub at openplans.org
Fri Nov 9 12:11:58 EST 2007
Eric Lemoine wrote:
> Hello Tim and all,
> I've started working on changing things in Handler.Feature. Currently
> Handler.Feature has the notion of feature selection, which I think it
> shouldn't. The feature selection logic must be in
> Control.SelectFeature and not elsewhere. For example, I don't think
> Handler.Feature should keep a reference to a feature, this should be
> done in the upper-level object - the SelectFeature control. In
> addition, keeping references to selected objects is done in the vector
> layer, so that's another reason for Handler.Feature not to keep any
> reference on selected feature.
I agree that this code needs reworking.
I think the selection logic should be pushed to the vector layer.
It's a hassle that you have to have a select feature control to be able
to select/unselect a feature.
The select feature control could still have options for multiple or
single select, but it should pass the appropriate argument on to a
selectFeature method on the layer.
Sorry I cant give more time to your patch right now, but I agree that
things should be changed here.
> I'm attaching a patch to get a sense on what I'm doing. This isn't
> complete, as it most probably breaks Control.DragFeature. But you'll
> note that the patch simplifies the code, most notably it removes the
> complex select() method in Handler.Feature.
> What do you think? Does some work on that direction make sense?
More information about the Dev