Skip to content
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

Merged
merged 2 commits into from
Sep 3, 2014

Conversation

fredj
Copy link
Member

@fredj fredj commented Sep 3, 2014

To have the same be behavior as ol.layer.Vector: feature or feature overlay or ol.style.defaultStyleFunction.

styles = featureStyleFunction.call(feature, resolution);
} else {
styles = styleFunction(feature, resolution);
}
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, got it

@elemoine
Copy link
Member

elemoine commented Sep 3, 2014

It looks good to me.

But this makes me realize that we have other inconsistencies. For example the ol.FeatureOverlay#setStyle function doesn't work the same way as ol.layer.Vector#setStyle. Can be addressed separately.

@fredj
Copy link
Member Author

fredj commented Sep 3, 2014

But this makes me realize that we have other inconsistencies. For example the ol.FeatureOverlay#setStyle function doesn't work the same way as ol.layer.Vector#setStyle. Can be addressed separately.

New PR to come

fredj added a commit that referenced this pull request Sep 3, 2014
ol.FeatureOverlay: use the feature style if defined
@fredj fredj merged commit f188cfd into openlayers:master Sep 3, 2014
@fredj fredj deleted the featureoverlay-style branch September 3, 2014 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants