-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: do not uncache spatial on reference change
Uncaching on reference change leads to a race condition if the browser has internally cached files that are to be fetched. If cells happen to be cached before the reference change is invoked, those cells will be disposed. Reference change should only occur on cell change.
- Loading branch information
1 parent
7dca018
commit f2f49ec
Showing
4 changed files
with
115 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { LngLatAlt } from "../../api/interfaces/LngLatAlt"; | ||
import { enuToGeodetic, geodeticToEnu } from "../../geo/GeoCoords"; | ||
|
||
export function resetEnu(reference: LngLatAlt, prevEnu: number[], prevReference: LngLatAlt): number[] { | ||
const [prevX, prevY, prevZ] = prevEnu; | ||
const [lng, lat, alt] = enuToGeodetic( | ||
prevX, | ||
prevY, | ||
prevZ, | ||
prevReference.lng, | ||
prevReference.lat, | ||
prevReference.alt); | ||
|
||
return geodeticToEnu( | ||
lng, | ||
lat, | ||
alt, | ||
reference.lng, | ||
reference.lat, | ||
reference.alt); | ||
} |
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
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
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