@realsee/dnalogel 2.0.0-alpha.20 → 2.0.0-alpha.23
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/CHANGELOG.md +10 -0
- package/dist/PanoMeasurePlugin/index.js +7 -1
- package/dist/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +1 -2
- package/dist/floorplan/PanoFloorplanRadarPlugin/index.js +47 -41
- package/dist/index.es.js +54 -42
- package/dist/index.js +54 -42
- package/dist/index.umd.js +54 -42
- package/docs/classes/ModelRoomLabelController.html +6 -6
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ModelFloorplanErrorType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelFloorplanParameterType.html +1 -1
- package/docs/interfaces/ModelFloorplanViewEvent.html +2 -2
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCompassPluginData.html +1 -1
- package/docs/interfaces/PanoCompassPluginParameterType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +6 -6
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/RoomLabel.html +7 -7
- package/docs/interfaces/TopviewFloorplanPluginParameterType.html +8 -8
- package/docs/modules.html +12 -12
- package/libs/PanoMeasurePlugin/Controller/index.js +5 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/style.js +1 -0
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/floorplan/PanoFloorplanRadarPlugin/Components/Camera.js +46 -30
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.d.ts +1 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +1 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 2.0.0-alpha.23
|
|
4
|
+
- 1.fix: 修复 PanoFloorplanRadarPlugin reload 数据时报错
|
|
5
|
+
- 2.fix: 修复 PanoFloorplanRadarPlugin reload 户型图数据后雷达图标位置没有适配
|
|
6
|
+
|
|
7
|
+
## 2.0.0-alpha.22
|
|
8
|
+
- 1.fix: 修复 PanoMeasurePlugin disable 状态下仍有背景色占位问题。
|
|
9
|
+
|
|
10
|
+
## 2.0.0-alpha.21
|
|
11
|
+
- 1.fix: 修复 PanoMeasurePlugin 仅初始化 UI 面板仍占位为题。
|
|
12
|
+
|
|
3
13
|
## 2.0.0-alpha.20
|
|
4
14
|
- 1.fix: 修复 PanoMeasurePlugin hide 时 UI 面板仍占位为题。
|
|
5
15
|
|
|
@@ -4619,6 +4619,7 @@ var htmlString = `
|
|
|
4619
4619
|
`;
|
|
4620
4620
|
|
|
4621
4621
|
const uiWrapperStyle = {
|
|
4622
|
+
display: 'none',
|
|
4622
4623
|
position: 'absolute',
|
|
4623
4624
|
top: '0',
|
|
4624
4625
|
left: '0',
|
|
@@ -5406,6 +5407,7 @@ class MeasureController {
|
|
|
5406
5407
|
this.container.style.pointerEvents = 'none';
|
|
5407
5408
|
this.container.style.width = '100%';
|
|
5408
5409
|
this.container.style.height = '100%';
|
|
5410
|
+
this.container.style.opacity = '0';
|
|
5409
5411
|
this.container.style.background = 'rgba(0, 0, 0, 0.15)';
|
|
5410
5412
|
this.controllerParams = {
|
|
5411
5413
|
five: this.five,
|
|
@@ -5451,6 +5453,8 @@ class MeasureController {
|
|
|
5451
5453
|
return;
|
|
5452
5454
|
this.hasOpen = true;
|
|
5453
5455
|
this.five.scene.add(this.group);
|
|
5456
|
+
// 修改透明度
|
|
5457
|
+
this.container.style.opacity = '1';
|
|
5454
5458
|
// 隐藏点位和鼠标聚焦环
|
|
5455
5459
|
this.five.helperVisible = false;
|
|
5456
5460
|
this.controller = new WatchController(this.controllerParams);
|
|
@@ -5466,6 +5470,8 @@ class MeasureController {
|
|
|
5466
5470
|
disable() {
|
|
5467
5471
|
var _a, _b, _c, _d;
|
|
5468
5472
|
this.hasOpen = false;
|
|
5473
|
+
// 修改透明度
|
|
5474
|
+
this.container.style.opacity = '0';
|
|
5469
5475
|
// 展示点位和鼠标聚焦环
|
|
5470
5476
|
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
5471
5477
|
(_b = this.useUIController) === null || _b === void 0 ? void 0 : _b.hide();
|
|
@@ -5518,7 +5524,7 @@ class MeasureController {
|
|
|
5518
5524
|
}
|
|
5519
5525
|
}
|
|
5520
5526
|
|
|
5521
|
-
const PanoMeasurePlugin = function
|
|
5527
|
+
const PanoMeasurePlugin = function PanoMeasurePlugin(five, params) {
|
|
5522
5528
|
return new MeasureController(five, params);
|
|
5523
5529
|
};
|
|
5524
5530
|
|
|
@@ -14,8 +14,7 @@ export default class PanoFloorplanRadarPluginController {
|
|
|
14
14
|
private wrapperSelector;
|
|
15
15
|
private data?;
|
|
16
16
|
private wrapper;
|
|
17
|
-
private extraObjects
|
|
18
|
-
private originExtraObjects?;
|
|
17
|
+
private extraObjects;
|
|
19
18
|
private configs;
|
|
20
19
|
constructor(five: Five, params?: PanoFloorplanRadarPluginControllerParameter);
|
|
21
20
|
dispose: () => void;
|
|
@@ -75,58 +75,54 @@ function create_fragment$8(ctx) {
|
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
function getCameraRotateTransform(longitude) {
|
|
79
|
+
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
80
|
+
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
81
|
+
|
|
82
|
+
return `rotate(${rotate}deg)`;
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
function instance$8($$self, $$props, $$invalidate) {
|
|
86
|
+
let positionTransform;
|
|
87
|
+
let rotateTransform;
|
|
79
88
|
let { five } = $$props;
|
|
80
89
|
let { pxmm } = $$props;
|
|
81
90
|
let { floorplanData } = $$props;
|
|
82
91
|
let { cameraImageUrl } = $$props;
|
|
92
|
+
let panoIndex = five.getCurrentState().panoIndex;
|
|
93
|
+
let longitude = five.getCurrentState().longitude;
|
|
83
94
|
|
|
84
95
|
/** 获取相机在当前 Five 状态下的位移 */
|
|
85
|
-
function getCameraPositionTransform(panoIndex) {
|
|
86
|
-
const observer = floorplanData.observers[panoIndex];
|
|
96
|
+
function getCameraPositionTransform(floorplanData, panoIndex) {
|
|
87
97
|
const bounding = floorplanData.bounding;
|
|
98
|
+
const floorplanObserver = floorplanData.observers[panoIndex];
|
|
99
|
+
if (!floorplanObserver) return '';
|
|
88
100
|
const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
|
|
89
101
|
const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
const top = Math.floor(observer.positionInImage.y * clientHeight);
|
|
102
|
+
const left = Math.floor(floorplanObserver.positionInImage.x * clientWidth);
|
|
103
|
+
const top = Math.floor(floorplanObserver.positionInImage.y * clientHeight);
|
|
93
104
|
return `translate(${left}px, ${top}px)`;
|
|
94
105
|
}
|
|
95
106
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const { longitude } = five.getCurrentState();
|
|
99
|
-
|
|
100
|
-
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
101
|
-
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
102
|
-
|
|
103
|
-
return `rotate(${rotate}deg)`;
|
|
107
|
+
function onFivePanoWillArrive(_panoIndex) {
|
|
108
|
+
$$invalidate(6, panoIndex = _panoIndex);
|
|
104
109
|
}
|
|
105
110
|
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const changeRotate = throttle(
|
|
111
|
-
() => {
|
|
112
|
-
$$invalidate(1, rotateTransform = getCameraRotationTransform());
|
|
111
|
+
const onFiveCameraDirectionUpdate = throttle(
|
|
112
|
+
pose => {
|
|
113
|
+
$$invalidate(7, longitude = pose.longitude);
|
|
113
114
|
},
|
|
114
115
|
1000 / 60
|
|
115
116
|
);
|
|
116
117
|
|
|
117
|
-
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
118
|
-
let rotateTransform = getCameraRotationTransform();
|
|
119
|
-
|
|
120
|
-
let positionTransform = getCameraPositionTransform(five.getCurrentState().panoIndex);
|
|
121
|
-
|
|
122
118
|
svelte.onMount(() => {
|
|
123
|
-
five.on('panoWillArrive',
|
|
124
|
-
five.on('cameraDirectionUpdate',
|
|
119
|
+
five.on('panoWillArrive', onFivePanoWillArrive);
|
|
120
|
+
five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
125
121
|
});
|
|
126
122
|
|
|
127
123
|
svelte.onDestroy(() => {
|
|
128
|
-
five.off('panoWillArrive',
|
|
129
|
-
five.off('cameraDirectionUpdate',
|
|
124
|
+
five.off('panoWillArrive', onFivePanoWillArrive);
|
|
125
|
+
five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
130
126
|
});
|
|
131
127
|
|
|
132
128
|
$$self.$$set = $$props => {
|
|
@@ -136,7 +132,27 @@ function instance$8($$self, $$props, $$invalidate) {
|
|
|
136
132
|
if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
|
|
137
133
|
};
|
|
138
134
|
|
|
139
|
-
|
|
135
|
+
$$self.$$.update = () => {
|
|
136
|
+
if ($$self.$$.dirty & /*floorplanData, panoIndex*/ 96) {
|
|
137
|
+
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
138
|
+
$$invalidate(2, positionTransform = getCameraPositionTransform(floorplanData, panoIndex));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if ($$self.$$.dirty & /*longitude*/ 128) {
|
|
142
|
+
$$invalidate(1, rotateTransform = getCameraRotateTransform(longitude));
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return [
|
|
147
|
+
cameraImageUrl,
|
|
148
|
+
rotateTransform,
|
|
149
|
+
positionTransform,
|
|
150
|
+
five,
|
|
151
|
+
pxmm,
|
|
152
|
+
floorplanData,
|
|
153
|
+
panoIndex,
|
|
154
|
+
longitude
|
|
155
|
+
];
|
|
140
156
|
}
|
|
141
157
|
|
|
142
158
|
class Camera extends internal.SvelteComponent {
|
|
@@ -1531,13 +1547,7 @@ class PanoFloorplanRadarPluginController {
|
|
|
1531
1547
|
enumerable: true,
|
|
1532
1548
|
configurable: true,
|
|
1533
1549
|
writable: true,
|
|
1534
|
-
value:
|
|
1535
|
-
});
|
|
1536
|
-
Object.defineProperty(this, "originExtraObjects", {
|
|
1537
|
-
enumerable: true,
|
|
1538
|
-
configurable: true,
|
|
1539
|
-
writable: true,
|
|
1540
|
-
value: void 0
|
|
1550
|
+
value: []
|
|
1541
1551
|
});
|
|
1542
1552
|
Object.defineProperty(this, "configs", {
|
|
1543
1553
|
enumerable: true,
|
|
@@ -1598,7 +1608,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
1598
1608
|
this.render();
|
|
1599
1609
|
}
|
|
1600
1610
|
setExtraObjectsWith3DPositions(data) {
|
|
1601
|
-
this.originExtraObjects = data;
|
|
1602
1611
|
if (!this.data)
|
|
1603
1612
|
return;
|
|
1604
1613
|
this.extraObjects = formatExtraObjects(data, this.five, this.data);
|
|
@@ -1613,9 +1622,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
1613
1622
|
}
|
|
1614
1623
|
if (!this.data || !this.wrapper)
|
|
1615
1624
|
return;
|
|
1616
|
-
if (!this.extraObjects && this.originExtraObjects) {
|
|
1617
|
-
this.extraObjects = formatExtraObjects(this.originExtraObjects, this.five, this.data);
|
|
1618
|
-
}
|
|
1619
1625
|
const props = {
|
|
1620
1626
|
five: this.five,
|
|
1621
1627
|
floorplanData: this.data,
|
package/dist/index.es.js
CHANGED
|
@@ -4675,58 +4675,54 @@ function create_fragment$7(ctx) {
|
|
|
4675
4675
|
};
|
|
4676
4676
|
}
|
|
4677
4677
|
|
|
4678
|
+
function getCameraRotateTransform(longitude) {
|
|
4679
|
+
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
4680
|
+
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
4681
|
+
|
|
4682
|
+
return `rotate(${rotate}deg)`;
|
|
4683
|
+
}
|
|
4684
|
+
|
|
4678
4685
|
function instance$7($$self, $$props, $$invalidate) {
|
|
4686
|
+
let positionTransform;
|
|
4687
|
+
let rotateTransform;
|
|
4679
4688
|
let { five } = $$props;
|
|
4680
4689
|
let { pxmm } = $$props;
|
|
4681
4690
|
let { floorplanData } = $$props;
|
|
4682
4691
|
let { cameraImageUrl } = $$props;
|
|
4692
|
+
let panoIndex = five.getCurrentState().panoIndex;
|
|
4693
|
+
let longitude = five.getCurrentState().longitude;
|
|
4683
4694
|
|
|
4684
4695
|
/** 获取相机在当前 Five 状态下的位移 */
|
|
4685
|
-
function getCameraPositionTransform(panoIndex) {
|
|
4686
|
-
const observer = floorplanData.observers[panoIndex];
|
|
4696
|
+
function getCameraPositionTransform(floorplanData, panoIndex) {
|
|
4687
4697
|
const bounding = floorplanData.bounding;
|
|
4698
|
+
const floorplanObserver = floorplanData.observers[panoIndex];
|
|
4699
|
+
if (!floorplanObserver) return '';
|
|
4688
4700
|
const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
|
|
4689
4701
|
const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
|
|
4690
|
-
|
|
4691
|
-
const
|
|
4692
|
-
const top = Math.floor(observer.positionInImage.y * clientHeight);
|
|
4702
|
+
const left = Math.floor(floorplanObserver.positionInImage.x * clientWidth);
|
|
4703
|
+
const top = Math.floor(floorplanObserver.positionInImage.y * clientHeight);
|
|
4693
4704
|
return `translate(${left}px, ${top}px)`;
|
|
4694
4705
|
}
|
|
4695
4706
|
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
const { longitude } = five.getCurrentState();
|
|
4699
|
-
|
|
4700
|
-
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
4701
|
-
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
4702
|
-
|
|
4703
|
-
return `rotate(${rotate}deg)`;
|
|
4707
|
+
function onFivePanoWillArrive(_panoIndex) {
|
|
4708
|
+
$$invalidate(6, panoIndex = _panoIndex);
|
|
4704
4709
|
}
|
|
4705
4710
|
|
|
4706
|
-
const
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
const changeRotate = throttle(
|
|
4711
|
-
() => {
|
|
4712
|
-
$$invalidate(1, rotateTransform = getCameraRotationTransform());
|
|
4711
|
+
const onFiveCameraDirectionUpdate = throttle(
|
|
4712
|
+
pose => {
|
|
4713
|
+
$$invalidate(7, longitude = pose.longitude);
|
|
4713
4714
|
},
|
|
4714
4715
|
1000 / 60
|
|
4715
4716
|
);
|
|
4716
4717
|
|
|
4717
|
-
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
4718
|
-
let rotateTransform = getCameraRotationTransform();
|
|
4719
|
-
|
|
4720
|
-
let positionTransform = getCameraPositionTransform(five.getCurrentState().panoIndex);
|
|
4721
|
-
|
|
4722
4718
|
onMount(() => {
|
|
4723
|
-
five.on('panoWillArrive',
|
|
4724
|
-
five.on('cameraDirectionUpdate',
|
|
4719
|
+
five.on('panoWillArrive', onFivePanoWillArrive);
|
|
4720
|
+
five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
4725
4721
|
});
|
|
4726
4722
|
|
|
4727
4723
|
onDestroy(() => {
|
|
4728
|
-
five.off('panoWillArrive',
|
|
4729
|
-
five.off('cameraDirectionUpdate',
|
|
4724
|
+
five.off('panoWillArrive', onFivePanoWillArrive);
|
|
4725
|
+
five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
4730
4726
|
});
|
|
4731
4727
|
|
|
4732
4728
|
$$self.$$set = $$props => {
|
|
@@ -4736,7 +4732,27 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
|
4736
4732
|
if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
|
|
4737
4733
|
};
|
|
4738
4734
|
|
|
4739
|
-
|
|
4735
|
+
$$self.$$.update = () => {
|
|
4736
|
+
if ($$self.$$.dirty & /*floorplanData, panoIndex*/ 96) {
|
|
4737
|
+
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
4738
|
+
$$invalidate(2, positionTransform = getCameraPositionTransform(floorplanData, panoIndex));
|
|
4739
|
+
}
|
|
4740
|
+
|
|
4741
|
+
if ($$self.$$.dirty & /*longitude*/ 128) {
|
|
4742
|
+
$$invalidate(1, rotateTransform = getCameraRotateTransform(longitude));
|
|
4743
|
+
}
|
|
4744
|
+
};
|
|
4745
|
+
|
|
4746
|
+
return [
|
|
4747
|
+
cameraImageUrl,
|
|
4748
|
+
rotateTransform,
|
|
4749
|
+
positionTransform,
|
|
4750
|
+
five,
|
|
4751
|
+
pxmm,
|
|
4752
|
+
floorplanData,
|
|
4753
|
+
panoIndex,
|
|
4754
|
+
longitude
|
|
4755
|
+
];
|
|
4740
4756
|
}
|
|
4741
4757
|
|
|
4742
4758
|
class Camera extends SvelteComponent {
|
|
@@ -5443,13 +5459,7 @@ class PanoFloorplanRadarPluginController {
|
|
|
5443
5459
|
enumerable: true,
|
|
5444
5460
|
configurable: true,
|
|
5445
5461
|
writable: true,
|
|
5446
|
-
value:
|
|
5447
|
-
});
|
|
5448
|
-
Object.defineProperty(this, "originExtraObjects", {
|
|
5449
|
-
enumerable: true,
|
|
5450
|
-
configurable: true,
|
|
5451
|
-
writable: true,
|
|
5452
|
-
value: void 0
|
|
5462
|
+
value: []
|
|
5453
5463
|
});
|
|
5454
5464
|
Object.defineProperty(this, "configs", {
|
|
5455
5465
|
enumerable: true,
|
|
@@ -5510,7 +5520,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
5510
5520
|
this.render();
|
|
5511
5521
|
}
|
|
5512
5522
|
setExtraObjectsWith3DPositions(data) {
|
|
5513
|
-
this.originExtraObjects = data;
|
|
5514
5523
|
if (!this.data)
|
|
5515
5524
|
return;
|
|
5516
5525
|
this.extraObjects = formatExtraObjects(data, this.five, this.data);
|
|
@@ -5525,9 +5534,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
5525
5534
|
}
|
|
5526
5535
|
if (!this.data || !this.wrapper)
|
|
5527
5536
|
return;
|
|
5528
|
-
if (!this.extraObjects && this.originExtraObjects) {
|
|
5529
|
-
this.extraObjects = formatExtraObjects(this.originExtraObjects, this.five, this.data);
|
|
5530
|
-
}
|
|
5531
5537
|
const props = {
|
|
5532
5538
|
five: this.five,
|
|
5533
5539
|
floorplanData: this.data,
|
|
@@ -12352,6 +12358,7 @@ var htmlString = `
|
|
|
12352
12358
|
`;
|
|
12353
12359
|
|
|
12354
12360
|
const uiWrapperStyle = {
|
|
12361
|
+
display: 'none',
|
|
12355
12362
|
position: 'absolute',
|
|
12356
12363
|
top: '0',
|
|
12357
12364
|
left: '0',
|
|
@@ -13051,6 +13058,7 @@ class MeasureController {
|
|
|
13051
13058
|
this.container.style.pointerEvents = 'none';
|
|
13052
13059
|
this.container.style.width = '100%';
|
|
13053
13060
|
this.container.style.height = '100%';
|
|
13061
|
+
this.container.style.opacity = '0';
|
|
13054
13062
|
this.container.style.background = 'rgba(0, 0, 0, 0.15)';
|
|
13055
13063
|
this.controllerParams = {
|
|
13056
13064
|
five: this.five,
|
|
@@ -13096,6 +13104,8 @@ class MeasureController {
|
|
|
13096
13104
|
return;
|
|
13097
13105
|
this.hasOpen = true;
|
|
13098
13106
|
this.five.scene.add(this.group);
|
|
13107
|
+
// 修改透明度
|
|
13108
|
+
this.container.style.opacity = '1';
|
|
13099
13109
|
// 隐藏点位和鼠标聚焦环
|
|
13100
13110
|
this.five.helperVisible = false;
|
|
13101
13111
|
this.controller = new WatchController(this.controllerParams);
|
|
@@ -13111,6 +13121,8 @@ class MeasureController {
|
|
|
13111
13121
|
disable() {
|
|
13112
13122
|
var _a, _b, _c, _d;
|
|
13113
13123
|
this.hasOpen = false;
|
|
13124
|
+
// 修改透明度
|
|
13125
|
+
this.container.style.opacity = '0';
|
|
13114
13126
|
// 展示点位和鼠标聚焦环
|
|
13115
13127
|
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
13116
13128
|
(_b = this.useUIController) === null || _b === void 0 ? void 0 : _b.hide();
|
|
@@ -13163,7 +13175,7 @@ class MeasureController {
|
|
|
13163
13175
|
}
|
|
13164
13176
|
}
|
|
13165
13177
|
|
|
13166
|
-
const PanoMeasurePlugin = function
|
|
13178
|
+
const PanoMeasurePlugin = function PanoMeasurePlugin(five, params) {
|
|
13167
13179
|
return new MeasureController(five, params);
|
|
13168
13180
|
};
|
|
13169
13181
|
|
package/dist/index.js
CHANGED
|
@@ -4702,58 +4702,54 @@ function create_fragment$7(ctx) {
|
|
|
4702
4702
|
};
|
|
4703
4703
|
}
|
|
4704
4704
|
|
|
4705
|
+
function getCameraRotateTransform(longitude) {
|
|
4706
|
+
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
4707
|
+
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
4708
|
+
|
|
4709
|
+
return `rotate(${rotate}deg)`;
|
|
4710
|
+
}
|
|
4711
|
+
|
|
4705
4712
|
function instance$7($$self, $$props, $$invalidate) {
|
|
4713
|
+
let positionTransform;
|
|
4714
|
+
let rotateTransform;
|
|
4706
4715
|
let { five } = $$props;
|
|
4707
4716
|
let { pxmm } = $$props;
|
|
4708
4717
|
let { floorplanData } = $$props;
|
|
4709
4718
|
let { cameraImageUrl } = $$props;
|
|
4719
|
+
let panoIndex = five.getCurrentState().panoIndex;
|
|
4720
|
+
let longitude = five.getCurrentState().longitude;
|
|
4710
4721
|
|
|
4711
4722
|
/** 获取相机在当前 Five 状态下的位移 */
|
|
4712
|
-
function getCameraPositionTransform(panoIndex) {
|
|
4713
|
-
const observer = floorplanData.observers[panoIndex];
|
|
4723
|
+
function getCameraPositionTransform(floorplanData, panoIndex) {
|
|
4714
4724
|
const bounding = floorplanData.bounding;
|
|
4725
|
+
const floorplanObserver = floorplanData.observers[panoIndex];
|
|
4726
|
+
if (!floorplanObserver) return '';
|
|
4715
4727
|
const clientWidth = (bounding.max.x - bounding.min.x) * pxmm;
|
|
4716
4728
|
const clientHeight = (bounding.max.y - bounding.min.y) * pxmm;
|
|
4717
|
-
|
|
4718
|
-
const
|
|
4719
|
-
const top = Math.floor(observer.positionInImage.y * clientHeight);
|
|
4729
|
+
const left = Math.floor(floorplanObserver.positionInImage.x * clientWidth);
|
|
4730
|
+
const top = Math.floor(floorplanObserver.positionInImage.y * clientHeight);
|
|
4720
4731
|
return `translate(${left}px, ${top}px)`;
|
|
4721
4732
|
}
|
|
4722
4733
|
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
const { longitude } = five.getCurrentState();
|
|
4726
|
-
|
|
4727
|
-
// 为什么要加 45 ==> 因为 UI 给的图初始角度是 -45
|
|
4728
|
-
const rotate = Math.floor(longitude / Math.PI * 180) * -1 + 45;
|
|
4729
|
-
|
|
4730
|
-
return `rotate(${rotate}deg)`;
|
|
4734
|
+
function onFivePanoWillArrive(_panoIndex) {
|
|
4735
|
+
$$invalidate(6, panoIndex = _panoIndex);
|
|
4731
4736
|
}
|
|
4732
4737
|
|
|
4733
|
-
const
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
const changeRotate = throttle(
|
|
4738
|
-
() => {
|
|
4739
|
-
$$invalidate(1, rotateTransform = getCameraRotationTransform());
|
|
4738
|
+
const onFiveCameraDirectionUpdate = throttle(
|
|
4739
|
+
pose => {
|
|
4740
|
+
$$invalidate(7, longitude = pose.longitude);
|
|
4740
4741
|
},
|
|
4741
4742
|
1000 / 60
|
|
4742
4743
|
);
|
|
4743
4744
|
|
|
4744
|
-
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
4745
|
-
let rotateTransform = getCameraRotationTransform();
|
|
4746
|
-
|
|
4747
|
-
let positionTransform = getCameraPositionTransform(five.getCurrentState().panoIndex);
|
|
4748
|
-
|
|
4749
4745
|
svelte.onMount(() => {
|
|
4750
|
-
five.on('panoWillArrive',
|
|
4751
|
-
five.on('cameraDirectionUpdate',
|
|
4746
|
+
five.on('panoWillArrive', onFivePanoWillArrive);
|
|
4747
|
+
five.on('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
4752
4748
|
});
|
|
4753
4749
|
|
|
4754
4750
|
svelte.onDestroy(() => {
|
|
4755
|
-
five.off('panoWillArrive',
|
|
4756
|
-
five.off('cameraDirectionUpdate',
|
|
4751
|
+
five.off('panoWillArrive', onFivePanoWillArrive);
|
|
4752
|
+
five.off('cameraDirectionUpdate', onFiveCameraDirectionUpdate);
|
|
4757
4753
|
});
|
|
4758
4754
|
|
|
4759
4755
|
$$self.$$set = $$props => {
|
|
@@ -4763,7 +4759,27 @@ function instance$7($$self, $$props, $$invalidate) {
|
|
|
4763
4759
|
if ('cameraImageUrl' in $$props) $$invalidate(0, cameraImageUrl = $$props.cameraImageUrl);
|
|
4764
4760
|
};
|
|
4765
4761
|
|
|
4766
|
-
|
|
4762
|
+
$$self.$$.update = () => {
|
|
4763
|
+
if ($$self.$$.dirty & /*floorplanData, panoIndex*/ 96) {
|
|
4764
|
+
// 初始状态,不能等 mount 之后再计算,那样第一次 camera 展示的时候也会有动画
|
|
4765
|
+
$$invalidate(2, positionTransform = getCameraPositionTransform(floorplanData, panoIndex));
|
|
4766
|
+
}
|
|
4767
|
+
|
|
4768
|
+
if ($$self.$$.dirty & /*longitude*/ 128) {
|
|
4769
|
+
$$invalidate(1, rotateTransform = getCameraRotateTransform(longitude));
|
|
4770
|
+
}
|
|
4771
|
+
};
|
|
4772
|
+
|
|
4773
|
+
return [
|
|
4774
|
+
cameraImageUrl,
|
|
4775
|
+
rotateTransform,
|
|
4776
|
+
positionTransform,
|
|
4777
|
+
five,
|
|
4778
|
+
pxmm,
|
|
4779
|
+
floorplanData,
|
|
4780
|
+
panoIndex,
|
|
4781
|
+
longitude
|
|
4782
|
+
];
|
|
4767
4783
|
}
|
|
4768
4784
|
|
|
4769
4785
|
class Camera extends internal.SvelteComponent {
|
|
@@ -5470,13 +5486,7 @@ class PanoFloorplanRadarPluginController {
|
|
|
5470
5486
|
enumerable: true,
|
|
5471
5487
|
configurable: true,
|
|
5472
5488
|
writable: true,
|
|
5473
|
-
value:
|
|
5474
|
-
});
|
|
5475
|
-
Object.defineProperty(this, "originExtraObjects", {
|
|
5476
|
-
enumerable: true,
|
|
5477
|
-
configurable: true,
|
|
5478
|
-
writable: true,
|
|
5479
|
-
value: void 0
|
|
5489
|
+
value: []
|
|
5480
5490
|
});
|
|
5481
5491
|
Object.defineProperty(this, "configs", {
|
|
5482
5492
|
enumerable: true,
|
|
@@ -5537,7 +5547,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
5537
5547
|
this.render();
|
|
5538
5548
|
}
|
|
5539
5549
|
setExtraObjectsWith3DPositions(data) {
|
|
5540
|
-
this.originExtraObjects = data;
|
|
5541
5550
|
if (!this.data)
|
|
5542
5551
|
return;
|
|
5543
5552
|
this.extraObjects = formatExtraObjects(data, this.five, this.data);
|
|
@@ -5552,9 +5561,6 @@ class PanoFloorplanRadarPluginController {
|
|
|
5552
5561
|
}
|
|
5553
5562
|
if (!this.data || !this.wrapper)
|
|
5554
5563
|
return;
|
|
5555
|
-
if (!this.extraObjects && this.originExtraObjects) {
|
|
5556
|
-
this.extraObjects = formatExtraObjects(this.originExtraObjects, this.five, this.data);
|
|
5557
|
-
}
|
|
5558
5564
|
const props = {
|
|
5559
5565
|
five: this.five,
|
|
5560
5566
|
floorplanData: this.data,
|
|
@@ -12379,6 +12385,7 @@ var htmlString = `
|
|
|
12379
12385
|
`;
|
|
12380
12386
|
|
|
12381
12387
|
const uiWrapperStyle = {
|
|
12388
|
+
display: 'none',
|
|
12382
12389
|
position: 'absolute',
|
|
12383
12390
|
top: '0',
|
|
12384
12391
|
left: '0',
|
|
@@ -13078,6 +13085,7 @@ class MeasureController {
|
|
|
13078
13085
|
this.container.style.pointerEvents = 'none';
|
|
13079
13086
|
this.container.style.width = '100%';
|
|
13080
13087
|
this.container.style.height = '100%';
|
|
13088
|
+
this.container.style.opacity = '0';
|
|
13081
13089
|
this.container.style.background = 'rgba(0, 0, 0, 0.15)';
|
|
13082
13090
|
this.controllerParams = {
|
|
13083
13091
|
five: this.five,
|
|
@@ -13123,6 +13131,8 @@ class MeasureController {
|
|
|
13123
13131
|
return;
|
|
13124
13132
|
this.hasOpen = true;
|
|
13125
13133
|
this.five.scene.add(this.group);
|
|
13134
|
+
// 修改透明度
|
|
13135
|
+
this.container.style.opacity = '1';
|
|
13126
13136
|
// 隐藏点位和鼠标聚焦环
|
|
13127
13137
|
this.five.helperVisible = false;
|
|
13128
13138
|
this.controller = new WatchController(this.controllerParams);
|
|
@@ -13138,6 +13148,8 @@ class MeasureController {
|
|
|
13138
13148
|
disable() {
|
|
13139
13149
|
var _a, _b, _c, _d;
|
|
13140
13150
|
this.hasOpen = false;
|
|
13151
|
+
// 修改透明度
|
|
13152
|
+
this.container.style.opacity = '0';
|
|
13141
13153
|
// 展示点位和鼠标聚焦环
|
|
13142
13154
|
(_a = this.controller) === null || _a === void 0 ? void 0 : _a.dispose();
|
|
13143
13155
|
(_b = this.useUIController) === null || _b === void 0 ? void 0 : _b.hide();
|
|
@@ -13190,7 +13202,7 @@ class MeasureController {
|
|
|
13190
13202
|
}
|
|
13191
13203
|
}
|
|
13192
13204
|
|
|
13193
|
-
const PanoMeasurePlugin = function
|
|
13205
|
+
const PanoMeasurePlugin = function PanoMeasurePlugin(five, params) {
|
|
13194
13206
|
return new MeasureController(five, params);
|
|
13195
13207
|
};
|
|
13196
13208
|
|