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

Hit detection respects min and maxResolution #2109

Merged
merged 1 commit into from May 25, 2014
Merged

Hit detection respects min and maxResolution #2109

merged 1 commit into from May 25, 2014

Conversation

elemoine
Copy link
Member

This fixes the bug reported in #2106, where the hit detection code detects features that are not actually rendered because the current resolution is outside the resolution range defined on the vector layer.

Please review.

closes #2106.

* @param {ol.layer.LayerState} layerState Layer state.
* @param {number} resolution Resolution.
* @return {boolean} Visible at resolution?
* @public
Copy link
Member

Choose a reason for hiding this comment

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

This would be the first @public annotation in the library. Any reason for it?

Copy link
Member Author

Choose a reason for hiding this comment

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

No I'll remove it.

@tschaub
Copy link
Member

tschaub commented May 23, 2014

A couple of doc comments, but otherwise this looks good to me.

@elemoine
Copy link
Member Author

Thanks for the review. I'll make changes and merge.

* the layer's minResolution and maxResolution.
* @param {ol.layer.LayerState} layerState Layer state.
* @param {number} resolution Resolution.
* @return {boolean} Visible at resolution?
Copy link
Member

Choose a reason for hiding this comment

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

Also minor, but if you're making doc changes, I'd like to see us start getting consistent about documenting boolean returns. I think they should all be documented as positive assertions. E.g. "The layer is visible at the given resolution." If true, the assertion holds. If false, it doesn't.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call.

elemoine pushed a commit that referenced this pull request May 25, 2014
Hit detection respects min and maxResolution
@elemoine elemoine merged commit 8cd5f6d into openlayers:master May 25, 2014
@elemoine elemoine deleted the visibleandinrange branch May 25, 2014 12:43
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.

forEachFeatureAtPixel finds Features in invisible layers
2 participants