OpenLayers OpenLayers

Ticket #916 (closed feature: fixed)

Opened 1 year ago

Last modified 1 year ago

keep selected features drawn with the right style

Reported by: pgiraud Assigned to: crschmidt
Priority: minor Milestone: 2.5 Release
Component: Layer.Vector Version: 2.4
Keywords: Cc:
State:

Description

Way to reproduce : If user selects a feature and then zoom in or out, the layer is redrawn but the selected feature appears with the default layer style. Though the feature is still selected. And to get it hilighted again, user need to select it twice. The first time to remove it from the layer.selectedFeatures and the second to really get it selected.

the drawFeature method in Layer.Vector probably need to test if feature is in the selectedFeatures array before it renders it with the correct style.

Attachments

select_style.patch (1.1 kB) - added by crschmidt on 09/01/07 00:45:38.
select-feature.patch (2.1 kB) - added by crschmidt on 09/12/07 00:30:02.
916.patch (2.2 kB) - added by crschmidt on 09/12/07 00:52:20.
916.2.patch (2.2 kB) - added by crschmidt on 09/12/07 01:08:44.

Change History

09/01/07 00:42:10 changed by crschmidt

Problem is that the layer doesn't actually know what style the feature should be drawn in. I think this says that we need a different handling of this in the control: specifically, actually changing the style of the feature, and then storing the old style so it can be retrieved when we need it to reset it.

09/01/07 00:45:38 changed by crschmidt

  • attachment select_style.patch added.

09/01/07 00:46:30 changed by crschmidt

Turns out that the implementation for this was half done, but never finished: the originalStyle was stored, but the feature.style property was never blown away, and the 'unselect' process was actually a direct copy paste of the 'select' process, rather than being the inverse.

09/01/07 00:46:37 changed by crschmidt

  • keywords set to needstests.

09/12/07 00:30:02 changed by crschmidt

  • attachment select-feature.patch added.

09/12/07 00:30:12 changed by crschmidt

  • keywords changed from needstests to review.

09/12/07 00:52:20 changed by crschmidt

  • attachment 916.patch added.

09/12/07 01:08:44 changed by crschmidt

  • attachment 916.2.patch added.

09/12/07 01:11:02 changed by euzuro

  • keywords changed from review to commit.

all good. tests pass FF and ie6. prease committing

09/12/07 01:12:06 changed by crschmidt

  • keywords deleted.
  • status changed from new to closed.
  • resolution set to fixed.

(In [4232]) Erik helps me fix tests. I threaten to kill him for criticizing my lack of semicolons. All is well. Fix for "keep selected features drawn with the right style". (Closes #916)