OpenLayers OpenLayers

Ticket #1173 (closed feature: fixed)

Opened 9 months ago

Last modified 9 months ago

New vector style property "display"

Reported by: ahocevar Assigned to:
Priority: minor Milestone: 2.6 Release
Component: Renderer.Elements Version: 2.5
Keywords: Cc:
State: Complete

Description

Attached is a very small patch that adds a style property "display" to vector feature style hashes. This property can be used to render a style hidden, so the feature will be invisible.

Technically speaking, features with style:display="none" will not be rendered at all. If there is a DOM node for the feature, it will be removed.

This property will be used by the upcoming styles framework to hide features that are outside the minScale/maxScale range

Attachments

style-display.diff (1.8 kB) - added by ahocevar on 11/25/07 20:17:50.
styles-display-r5342.diff (1.8 kB) - added by ahocevar on 12/04/07 17:21:21.
Updated patch against r5342.
patch-1173-r5438-A0.diff (2.8 kB) - added by elemoine on 12/16/07 14:19:19.
Andreas' patch + tests
patch-1173-r5535-A0.diff (3.1 kB) - added by ahocevar on 12/20/07 08:48:18.
Fixed patch, successfully tested in FF2 and IE6.

Change History

11/25/07 20:17:50 changed by ahocevar

  • attachment style-display.diff added.

(follow-up: ↓ 2 ) 12/01/07 08:24:55 changed by crschmidt

Hm. I'm slightly concerned about this, only because I'm worried about what happens if for some reason we have a selected feature that has its style switch to 'none' -- do I need to be worried? I'm not sure, but it's the first thing that comes to mind.

(in reply to: ↑ 1 ) 12/01/07 15:22:34 changed by ahocevar

Replying to crschmidt:

Hm. I'm slightly concerned about this, only because I'm worried about what happens if for some reason we have a selected feature that has its style switch to 'none' -- do I need to be worried? I'm not sure, but it's the first thing that comes to mind.

You do not need to worry. The only thing that will happen is that the feature will disappear on select, but you can still use e.g. OpenLayers.Control.SelectFeature.unselect to unselect it.

(follow-up: ↓ 4 ) 12/02/07 08:00:16 changed by elemoine

Thanks Andreas. I'm in favor for your patch.

Note that I have tests for this patch, based on pgiraud's tests for the renderers (#1128). They also rely on my fix to test_Elements.html (#1172). I'll attach a patch here once my patch for #1172 is applied to trunk.

(in reply to: ↑ 3 ) 12/02/07 08:01:49 changed by elemoine

Replying to elemoine:

Thanks Andreas. I'm in favor for your patch. Note that I have tests for this patch, based on pgiraud's tests for the renderers (#1128). They also rely on my fix to test_Elements.html (#1172). I'll attach a patch here once my patch for #1172 is applied to trunk.

oops, my patch to test_Elements.html is in #1184, not in #1172. Sorry for the confusion.

12/04/07 17:21:21 changed by ahocevar

  • attachment styles-display-r5342.diff added.

Updated patch against r5342.

12/13/07 23:37:25 changed by crschmidt

elemoine: #1184 is in, do you still have tests for this?

12/13/07 23:39:31 changed by crschmidt

  • keywords changed from review to commit.

If we can get some tests in, I'm fine with this being committed. Eric, please pull your tests in, then go ahead and commit when you feel comfortable with it.

12/14/07 12:06:05 changed by elemoine

  • state set to Unreviewed.

Will do. But I'm in the office right now and I left the patch at home :-)

12/14/07 17:21:59 changed by crschmidt

  • state changed from Unreviewed to Commit.

12/16/07 14:19:19 changed by elemoine

  • attachment patch-1173-r5438-A0.diff added.

Andreas' patch + tests

12/16/07 14:20:36 changed by elemoine

I attached a patch that includes tests. I'll test it tomorrow again and commit it if all tests pass on FF and IE.

12/20/07 08:48:18 changed by ahocevar

  • attachment patch-1173-r5535-A0.diff added.

Fixed patch, successfully tested in FF2 and IE6.

12/20/07 09:09:30 changed by ahocevar

Eric, there was a minor problem in test_Elements.js. Attached patch-1173-r5535-A0.diff. Tests pass in FF2 and IE6.

12/20/07 14:20:23 changed by elemoine

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

(In [5541]) Add style property "display" to vector feature style. If display is "none" the feature won't be rendered and there's a DOM node for that feature it'll be removed. Commiting this on behalf of ahocevar. Thanks Andreas for the patch. r=crschmidt. (closes #1173).