feat(ui): tilt and north-up compass controls (#571)

Supersedes #442 by @yashveeeeeeer, ported onto the current component layout with fixes from review.

Verified before merge: format, package boundaries, unit suite, build, and the browser tracking suite; a browser harness for the change where one applies; adversarial review applied.

Co-authored-by: Yashveer Singh <[email protected]>
This commit is contained in:
Bilawal SidhuandYashveer Singh authored and GitHub committed 2026-09-14 21:15:29 -05:00
1 parent fb5ee5aa36
commit d9fac6d88e
14 files changed
+895 -13

No files matched your search

+18
View File
@@ -15,6 +15,7 @@ import { CctvControls } from './cctv.js';
import { RadioControls } from './radio.js';
import { LocationControls } from './location.js';
import { bindClearLayersControl } from './layers.js';
import { bindCameraOrientationControls } from './cameraOrientationControls.js';
import { createMapSourceControls } from './mapSource.js';
import { STYLES } from './effects.js';
import { bindDisplayControls } from './displayControls.js';
@@ -590,6 +591,7 @@ export class StyleManager {
this._initGlobalContextPanel();
this._initLocationBar();
this._initShareButton();
this._initCameraOrientationControls();
this._initClearSelectedLayersButton();
this._initHUDToggle();
this._initModels3dToggle();
@@ -3269,6 +3271,21 @@ export class StyleManager {
);
}
/** Wire Google Maps-style tilt and north-up camera actions. */
_initCameraOrientationControls() {
this._cameraOrientationControls?.destroy();
this._cameraOrientationControls = bindCameraOrientationControls({
viewer: this.viewer,
elements: {
tiltButton: this._tiltMapBtn,
northButton: this._northUpBtn,
},
runNavigation: (noun, navigate) =>
this._runExplicitNavigation(noun, navigate),
showToast: (message) => this._showToast(message),
});
}
/**
* Clear every selected data layer without resetting visual, map, HUD, or
* camera state. A layer may still release camera work it owns as part of its
@@ -3659,6 +3676,7 @@ export class StyleManager {
this._displayControls?.destroy();
this._frameRateMonitor?.destroy();
this._mapSourceControls?.destroy();
this._cameraOrientationControls?.destroy();
this._clearLayersControl?.destroy();
this._locationControls?.destroy();
this._cctvControls?.destroy();