-
-
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
ol.FeatureOverlay: use the feature style if defined #2676
Conversation
55cc6fd
to
e775c01
Compare
styles = featureStyleFunction.call(feature, resolution); | ||
} else { | ||
styles = styleFunction(feature, resolution); | ||
} |
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.
Minor, but you could use the ternary notation here.
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.
I wanted to avoid to call the function twice
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.
styles = goog.isDef(featureStyleFunction) ?
featureStyleFunction.call(feature, resolution) : styleFunction(feature, resolution);
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.
ok, got it
It looks good to me. But this makes me realize that we have other inconsistencies. For example the |
New PR to come |
Same behavior as ol.layer.Vector
e775c01
to
9a23778
Compare
ol.FeatureOverlay: use the feature style if defined
To have the same be behavior as ol.layer.Vector: feature or feature overlay or ol.style.defaultStyleFunction.