-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Give precedence to feature styles #2394
Conversation
layer.setStyle(style); | ||
expect(layer.getStyleFunction()).to.be.a('function'); | ||
expect(layer.getStyleFunction()).not.to.be( | ||
ol.feature.defaultStyleFunction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no ol.feature.defaultStyleFunction
any more, right? I think this should be ol.style.defaults.styleFunction
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can cherry-pick c1d49a8 to fix this.
I added a test to make sure that feature styles take precedence. Please cherry-pick 16cdd35 if you agree. |
This looks good @tonio. Two cherry-picks in the comments above, and you may want to change the name of |
Thanks for the help on this Andreas. Wasn’t clear to me on how to write test for this. |
When you speak about styles, you e.g. give your polygon a "fill style". And if you don't, your features will be rendered with the "style defaults". Or the "default style". The former would suggest renaming the file, the latter would suggest renaming |
what about the default editing styles? Shouldn't they be moved too? |
@tonio are you planning to have this in for the gamma.3 release? |
I’ll try to make the asked changes this morning, early enough for you? On 25 July 2014 09:24, Bart van den Eijnden notifications@github.com
Antoine Abt Camptocamp France SAS Tel : 00 33 4 79 44 44 94 |
sure that is fine, I'll do the release in the afternoon |
Defaults styles now moved to |
@tonio is there more to be done for this PR to be merged? |
@bartvde not in my opinion. On 25 July 2014 10:42, Bart van den Eijnden notifications@github.com
Antoine Abt Camptocamp France SAS Tel : 00 33 4 79 44 44 94 |
I think this looks good now. Thanks @tonio! |
with this change you have default style defined in style, and default editing style defined in feature; this seems inconsistent to me |
@probins can you create a separate ticket for discussing this and set the milestone to gamma.4? TIA. I am going to merge this now since I am about to do the gamma.3 release. |
Give precedence to feature styles
@bartvde I can't set the milestone; I'll leave that to you |
thanks @probins I have set the milestone |
Fixes #1999.
It also:
ol.style.defaults
namespaceStyleFunction
definition &createStyleFunction
fromol.feature
tool.style