@smarterplan/ngx-smarterplan-core 1.4.18 → 1.4.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/services/matterport-navigation.service.mjs +18 -1
- package/esm2022/lib/services/matterport.service.mjs +5 -1
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs +21 -0
- package/fesm2022/smarterplan-ngx-smarterplan-core.mjs.map +1 -1
- package/lib/services/matterport-navigation.service.d.ts +9 -0
- package/package.json +1 -1
|
@@ -2572,6 +2572,8 @@ class MatterportNavigationService {
|
|
|
2572
2572
|
currentRooms = [];
|
|
2573
2573
|
/** Sequence number of the floor currently visible in sdk.Floor.current (null = single-floor or unknown). */
|
|
2574
2574
|
currentFloorSequence = null;
|
|
2575
|
+
/** True while a floorplan transition was explicitly requested through action_toolbox_floorplan. */
|
|
2576
|
+
floorplanRequested = false;
|
|
2575
2577
|
// ── Bidirectional sid ↔ uuid lookup maps ──
|
|
2576
2578
|
// sid = short runtime key used by Matterport SDK (collection keys, Sweep.moveTo, Camera.pose.sweep)
|
|
2577
2579
|
// uuid = persistent identifier stored in the database (zone.sweepIDs, poi.matterportSweepID, startSweepID)
|
|
@@ -2638,12 +2640,27 @@ class MatterportNavigationService {
|
|
|
2638
2640
|
console.log('viewer is in transition, cannot go floorplan');
|
|
2639
2641
|
return;
|
|
2640
2642
|
}
|
|
2643
|
+
this.floorplanRequested = true;
|
|
2641
2644
|
try {
|
|
2642
2645
|
await sdk.Mode.moveTo('mode.floorplan');
|
|
2643
2646
|
}
|
|
2644
2647
|
catch (e) {
|
|
2645
2648
|
console.log('cannot go to floorplan', e);
|
|
2646
2649
|
}
|
|
2650
|
+
finally {
|
|
2651
|
+
this.floorplanRequested = false;
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
/**
|
|
2655
|
+
* When a dollhouse camera looks straight down, Matterport reports 'mode.floorplan'
|
|
2656
|
+
* (its "peekaboo" corrected mode) although the camera is still in dollhouse.
|
|
2657
|
+
* The native mode buttons are hidden, so such a switch that we did not request
|
|
2658
|
+
* is never a user action and must not be treated as a real mode change.
|
|
2659
|
+
*/
|
|
2660
|
+
isUnrequestedFloorplanSwitch(previousMode, newMode) {
|
|
2661
|
+
return (previousMode === 'mode.dollhouse' &&
|
|
2662
|
+
newMode === 'mode.floorplan' &&
|
|
2663
|
+
!this.floorplanRequested);
|
|
2647
2664
|
}
|
|
2648
2665
|
action_toolbox_inside_view(sdk) {
|
|
2649
2666
|
sdk.Mode.moveTo('mode.inside');
|
|
@@ -4645,6 +4662,10 @@ class MatterportService {
|
|
|
4645
4662
|
}.bind(this));
|
|
4646
4663
|
//Camera mode
|
|
4647
4664
|
this.sdk.Mode.current.subscribe((mode) => {
|
|
4665
|
+
if (this.navigationService.isUnrequestedFloorplanSwitch(this.cameraMode, mode)) {
|
|
4666
|
+
// Top-down dollhouse camera reported as floorplan: still dollhouse, ignore it
|
|
4667
|
+
return;
|
|
4668
|
+
}
|
|
4648
4669
|
if (this.cameraMode !== mode) {
|
|
4649
4670
|
this.navigationService.setCameraMode(mode);
|
|
4650
4671
|
// Refresh tag visibility on every mode change (INSIDE vs DOLLHOUSE vs FLOORPLAN)
|