From 86ebf84ab4e69b3e206e8755b94638924ae10284 Mon Sep 17 00:00:00 2001 From: geireann Date: Thu, 20 Mar 2025 11:59:29 -0400 Subject: adjusted mapbox when used with a nativewidth/height. fixed dragging a mapbox to not display the wrong location until forced to re-render --- src/client/views/nodes/MapBox/MapBox.scss | 5 +++++ src/client/views/nodes/MapBox/MapBox.tsx | 22 ++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/MapBox/MapBox.scss b/src/client/views/nodes/MapBox/MapBox.scss index fdd8a29d7..8fbb6e82e 100644 --- a/src/client/views/nodes/MapBox/MapBox.scss +++ b/src/client/views/nodes/MapBox/MapBox.scss @@ -27,6 +27,9 @@ gap: 5px; align-items: center; width: calc(100% - 40px); + z-index: 1; + position: relative; + background: lightGray; } .mapbox-settings-panel { @@ -171,6 +174,8 @@ .mapBox-wrapper { width: 100%; + transform-origin: top left; + .mapBox-input { box-sizing: border-box; border: 1px solid transparent; diff --git a/src/client/views/nodes/MapBox/MapBox.tsx b/src/client/views/nodes/MapBox/MapBox.tsx index d642784c0..e79951df0 100644 --- a/src/client/views/nodes/MapBox/MapBox.tsx +++ b/src/client/views/nodes/MapBox/MapBox.tsx @@ -822,10 +822,7 @@ export class MapBox extends ViewBoxAnnotatableComponent() { @computed get preAnimationViewState() { - if (!this._isAnimating) { - return this.mapboxMapViewState; - } - return undefined; + return !this._isAnimating ? this.mapboxMapViewState : undefined; } @action @@ -1133,8 +1130,8 @@ export class MapBox extends ViewBoxAnnotatableComponent() { }; render() { - const scale = this._props.NativeDimScaling?.() || 1; - const parscale = scale === 1 ? 1 : (this.ScreenToLocalBoxXf().Scale ?? 1); + const scale = (this._props.NativeDimScaling?.() || 1) + 0.001; + const parscale = (this.ScreenToLocalBoxXf().Scale ?? 1); return (
@@ -1142,9 +1139,9 @@ export class MapBox extends ViewBoxAnnotatableComponent() { className="mapBox-wrapper" onWheel={e => e.stopPropagation()} onPointerDown={e => e.button === 0 && !e.ctrlKey && e.stopPropagation()} - style={{ transformOrigin: 'top left', transform: `scale(${scale})`, width: `calc(100% - ${this.sidebarWidthPercent})`, pointerEvents: this.pointerEvents() }}> + style={{ transform: `scale(${scale})`, width: `calc(100% - ${this.sidebarWidthPercent})`, pointerEvents: this.pointerEvents() }}> {!this._routeToAnimate && ( -
+
this.handleSearchChange(e.target.value)} /> } type={Type.TERT} onClick={() => this.toggleSettings()} />
@@ -1172,15 +1169,15 @@ export class MapBox extends ViewBoxAnnotatableComponent() {
Bearing:
- +
Pitch:
- +
Zoom:
- +
Show terrain:
@@ -1214,9 +1211,10 @@ export class MapBox extends ViewBoxAnnotatableComponent() { )}