-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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 support for polygon holes to CZML #7991
Conversation
For backwards compatibility we preserve the existing behavior of allowing an array of positions to be set. This makes the behavior more closely match the documentation. The ability to set an array of positions was undocumented, though some Sandcastle examples do this. This removes the need for conversion in PolygonGeometryUpdater at the point where the data is used.
…ositionsPacketData
Use CzmlDataSource.load in most tests. Compare against the values from the packet data rather than copy/pasting the expected values.
…d using intervals.
Thanks for the pull request @shunter!
Reviewers, don't forget to make sure that:
|
As an additional side note I spent some effort on code coverage for |
Awesome, thanks @shunter. Will look at this ASAP. |
@@ -104,8 +104,8 @@ define([ | |||
* | |||
* @param {JulianDate} time The time for which to retrieve the value. | |||
* @param {ReferenceFrame} referenceFrame The desired referenceFrame of the result. | |||
* @param {Cartesian3} [result] The object to store the value into, if omitted, a new instance is created and returned. | |||
* @returns {Cartesian3} The modified result parameter or a new instance if the result parameter was not supplied. | |||
* @param {Cartesian3[]} [result] The object to store the value into, if omitted, a new instance is created and returned. |
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.
Should this say "array of objects" instead of "object"? And is it a breaking API change?
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.
Not a breaking change, the documentation was wrong, not the code.
Just to clarify, If the above is correct, I still think it's worth mentioning in CHANGES, even if we don't consider it a breaking change. Just treat it like a bug and state that it now always returns a PolygonHirearchy |
That's the only question/comment I have. Another flawless PR, thanks @shunter |
It would store whatever value was set into it, without really caring what it was, which is what nearly all properties do.
Yes, it was documented as a property of type |
Thanks, I'll merge once green. |
Thanks again @shunter! I couldn't find any "holes" in your work... |
Holes are specified as an array of arrays of positions. Polygon holes can be constant, interval-based, or defined as references. Using references allows for each vertex of the hole to be expressed as a sampled value. This is essentially the same limitations as the existing array of positions.
These changes also change the behavior of
PolygonGraphics.hierarchy
to always produce aPolygonHierarchy
.This makes the behavior more closely match the documentation. Previously,
CzmlDataSource
would shove aCartesian
array into thehierarchy
property, and then all use sites had compatibility logic to adapt. For backwards compatibility, we preserve the existing behavior of allowing an array of positions to be set. The ability to set an array of positions was undocumented, though some Sandcastle examples do this.CzmlDataSource
no longer sets the incorrect type of data intohierarchy
, because we now need to handle holes.Fixes #3826
Sample CZML syntax for a constant set of holes.
Existing Sandcastle examples for CZML polygons now demonstrate holes using constant, intervals, and references.