[OpenLayers-Dev] SelectFeature and last/prevHighlighter

Eric Lemoine eric.lemoine at camptocamp.com
Tue May 10 02:33:50 EDT 2011


On Tue, May 10, 2011 at 7:20 AM, Slawomir Messner
<slawomir.messner at staff.uni-marburg.de> wrote:
> Hi,
> the use-case is that we have two SelectFeature controls. One for selecting
> features to know to which feature add attributes the other one for
> highlighting features that already have certain attributes. So if you select
> some features and then highlight some features to see which one has an
> attribute then you unhighlight them to un-/select or assign some attributes
> the selection disappears. Selecting happens by clicking or a box,
> un-/highlight by hover over a row of a table ("legend").

In your case, if I read you correctly, you programmatically
highlight/unhighlight features. And I think that's what reveals the
problem.

I can reproduce the problem on
http://openlayers.org/dev/examples/highlight-feature.html

- click on the feature on the right to select it
- in the FireBug console highlight the feature with
map.controls[4].highlight(map.layers[0].features[0])
- then unhighlight it with
map.controls[4].unhighlight(map.layers[0].features[0])
- bug: the feature turns yellow, while it should be blue

To fix this, I think we should move some logic from outFeature to
unhighlight, so this logic applies even when unhighlighting features
programmatically.

Feel free to create a ticket (and possibly a patch) for that.

Thanks,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com


More information about the Dev mailing list