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

Add ol.geom.Polygon.fromExtent #2821

Merged
merged 1 commit into from
Oct 15, 2014
Merged

Add ol.geom.Polygon.fromExtent #2821

merged 1 commit into from
Oct 15, 2014

Conversation

elemoine
Copy link
Member

@tonio was positive about it, so here it is. Other suggestions for the function name are welcome.

@elemoine elemoine added this to the v3.1.0 milestone Oct 10, 2014
var maxX = extent[2];
var maxY = extent[3];
var flatCoordinates =
[minX, minY, maxX, minY, maxX, maxY, minX, maxY, minX, minY];
Copy link
Member

Choose a reason for hiding this comment

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

You might as well orient these clockwise so we don't have to duplicate the array for orientedFlatCoordinates_.

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 point. I'll change that.

@elemoine
Copy link
Member Author

PR updated. The coordinates passed to setFlatCoordinates are now oriented clockwise, and I've added a test ensuring that.

@fredj
Copy link
Member

fredj commented Oct 14, 2014

LGTM

@elemoine
Copy link
Member Author

@tschaub, do you agree with merging this?

@tschaub
Copy link
Member

tschaub commented Oct 14, 2014

Sounds good to me.

elemoine pushed a commit that referenced this pull request Oct 15, 2014
@elemoine elemoine merged commit 74fd55a into openlayers:master Oct 15, 2014
@elemoine elemoine deleted the polygon-from-extent branch April 27, 2015 15:37
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

3 participants