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

Fix Rectangle.union when rectangle spans entire globe #9866

Merged
merged 1 commit into from
Oct 13, 2021
Merged

Conversation

IanLilleyT
Copy link
Contributor

The code used to call CesiumMath.convertLongitudeRange which

converts a longitude value, in radians, to the range [-Math.PI, Math.PI)

So when the rectangle.east equals Math.PI, it will get converted to -Math.PI. If the rectangle spans the entire globe, this creates a rectangle that has 0 width.

I replaced it with CesiumMath.negativePiToPi which returns

the angle in the range [-CesiumMath.PI, CesiumMath.PI]

Sandcastle demonstrating the fix

@cesium-concierge
Copy link

Thanks for the pull request @IanLilleyT!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@lilleyse lilleyse merged commit 9504ffd into main Oct 13, 2021
@lilleyse lilleyse deleted the rectangleUnion branch October 13, 2021 00:09
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.

3 participants