mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
refactor(credits): use the globe engine
Map credits (maps/credits.js) are shown through a credits capability (engine.credits.addStatic) instead of the scene's credit display; the shared map scene takes the engine's credits, so the Cesium engine's maps and its credits part share one owner. Data credits (registerDataCredits, registerDynamicCredit, show/hideOsmCredit) take the globe engine and keep accepting a viewer from layers that still hold one; the scene registers the data credits on its engine. The Cesium credits part reads Viewer.creditDisplay, else the scene frame state display it aliases.
This commit is contained in:
1 parent
be56144d75
commit
83c13f330d
11 files changed
+169
-59
No files matched your search
@@ -8,7 +8,9 @@ import * as Cesium from 'cesium';
|
||||
*/
|
||||
export function createCesiumCredits(viewer) {
|
||||
const added = new Set();
|
||||
const display = () => viewer.creditDisplay;
|
||||
// Viewer.creditDisplay is the scene frame state's display.
|
||||
const display = () =>
|
||||
viewer.creditDisplay ?? viewer.scene?.frameState?.creditDisplay;
|
||||
const remove = (credit) => {
|
||||
if (!added.delete(credit)) return;
|
||||
display()?.removeStaticCredit(credit);
|
||||
|
||||
Reference in new issue
Block a user