-
Notifications
You must be signed in to change notification settings - Fork 214
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 Undefined mercatorOrigin Check to computeMercatorFractionToDb #7269
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
andremig-bentley
requested review from
bbastings,
aruniverse,
ben-polinsky and
a team
as code owners
October 15, 2024 18:39
Did you do the following?
|
I was able to get the model initially causing the associated bug. Without these changes, the error in the screenshot below appeared when trying to open the model in DTA. With these changes, the model opened and the background map behaved as expected when navigating through the view. |
pmconne
reviewed
Oct 21, 2024
Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
pmconne
approved these changes
Oct 21, 2024
ben-polinsky
approved these changes
Oct 21, 2024
@Mergifyio backport release/4.9.x |
✅ Backports have been created
|
mergify bot
pushed a commit
that referenced
this pull request
Nov 6, 2024
) Co-authored-by: andremig-bentley <andremig-bentley@users.noreply.github.com> Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com> (cherry picked from commit a05e3b6)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to address this issue: /~https://github.com/iTwin/itwinjs-backlog/issues/1243
Currently, there is an edge case where if new
BackgroundMapGeometry
is created with project extents centered at(0,0,0)
and anecefLocation.origin
of(0,0,0)
, the creation of theBackgroundMapGeometry
will fail. When the point(0,0,0)
is converted from ECEF to aCartographic
usingCartographic.fromEcef
, the function will returnundefined
and cause an error to occur on the creation ofBackgroundMapGeometry
in the above scenario.To fix this,
ecefToPixelFraction
has been changed to now also returnundefined
iffromEcef
returnsundefined
, and a check has been added tocomputeMercatorFractionToDb
to return an identity transform ifmercatorOrigin
,mercatorX
, ormercatorY
isundefined
due to the change inecefToPixelFraction
. A test has also been added toBackgroundMapGeometry.test.ts
which tests the scenario where the project extents are centered at(0,0,0)
and theecefLocation.origin
is(0,0,0)
and confirms the succesful creation ofBackgroundMapGeometry
.