-
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
10957 zoom to entities without globe fix #11226
10957 zoom to entities without globe fix #11226
Conversation
Thanks for the pull request @fullstacc!
Reviewers, don't forget to make sure that:
|
CLA submitted |
const ellipsoid = globe.ellipsoid; | ||
const terrainProvider = globe.terrainProvider; | ||
// Check if the globe is undefined and use a substitute ellipsoid if it is not | ||
const ellipsoid = globe ? globe.ellipsoid : Ellipsoid.WGS84; |
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.
Instead of assuming the ellipsoid value, I think it would actually be better to return early and skip some of these unneeded calculations below when globe
is undefined.
I believe when the globe is undefined, we can simply skip the hasHeightReference
block entirely as there is no ellipsoid to offset the position against, and we can just use the position as-is.
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.
thanks for the feedback! I added a condition to hasHeightReference
that skips that block if the globe is undefined. I also removed the ellipsoid being instantiated as Ellipsoid.WGS84
if one isn't present, and moved the ellipsoid being defined to within the hasHeightReference
block as you would need a globe for this anyway
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.
Thanks @fullstacc! This will be a helpful fix for sure!
After we determine the best approach, it would be appreciated if you could add:
- A summary of the fix to
CHANGES.md
- A unit test to make sure the issue doesn't reoccur in the future
Let us know if you need any guidance on those.
@ggetz , my apologies in advance: How should I structure my inputs to your CHANGES.md? Should I add a subheading between these two dated "2023-04-13" with my fixes listed? |
No worries! The next release will be 1.105 on May 1, 2023 (The release, 1.104, went out April 3, 2023). We should include all new changes under the |
hi @ggetz ! I'm revisiting this after repeated tries last week. It looks like the CI build fails due to an issue importing the Viewer in the Should I not be using this |
Hi @fullstacc, To be more explicit about the architecture, and to keep this from happening in the future, I moved Additionally, Finally, we use the I pushed a fix with the above changes. |
Fixes #10957 .
The behavior noted from the issue is fixed