Closed andremig-bentley closed 3 weeks ago
Did you do the following?
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.
@mergifyio backport release/4.9.x
backport release/4.9.x
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
.