@aibee/crc-bmap 0.0.56 → 0.0.58
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/example/src/main.ts +3 -2
- package/example/vite.config.ts +1 -1
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +27 -24
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +1 -1
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/bmap.d.ts +2 -1
- package/package.json +2 -2
package/lib/bmap.esm.js
CHANGED
|
@@ -2299,14 +2299,8 @@ var Context = class extends EventDispatcher6 {
|
|
|
2299
2299
|
this.container.addEventListener("pointerleave", this.onPointerleave);
|
|
2300
2300
|
this.selection.addEventListener("select", this.onSelectionSelect);
|
|
2301
2301
|
this.hoverHelper.addEventListener("hover-change", this.onHoverChange);
|
|
2302
|
-
if (this.config.resizeObserver) {
|
|
2303
|
-
const observe = new ResizeObserver(this.onWindowResize);
|
|
2304
|
-
observe.observe(this.container);
|
|
2305
|
-
this.observe = observe;
|
|
2306
|
-
}
|
|
2307
2302
|
}
|
|
2308
2303
|
unRegistryEvent() {
|
|
2309
|
-
var _a;
|
|
2310
2304
|
window.removeEventListener("resize", this.onWindowResize);
|
|
2311
2305
|
this.container.removeEventListener("click", this.onClick);
|
|
2312
2306
|
this.container.removeEventListener("pointerover", this.onPointerover);
|
|
@@ -2314,8 +2308,6 @@ var Context = class extends EventDispatcher6 {
|
|
|
2314
2308
|
this.container.removeEventListener("pointerleave", this.onPointerleave);
|
|
2315
2309
|
this.selection.removeEventListener("select", this.onSelectionSelect);
|
|
2316
2310
|
this.hoverHelper.removeEventListener("hover-change", this.onHoverChange);
|
|
2317
|
-
(_a = this.observe) == null ? void 0 : _a.disconnect();
|
|
2318
|
-
this.observe = null;
|
|
2319
2311
|
}
|
|
2320
2312
|
/**
|
|
2321
2313
|
* 设置纵向旋转角度
|
|
@@ -2481,6 +2473,8 @@ var Context = class extends EventDispatcher6 {
|
|
|
2481
2473
|
this.control.target.copy(position.clone().add(lookAtVector));
|
|
2482
2474
|
}).onComplete(() => {
|
|
2483
2475
|
this.tweenGroup.remove(tween);
|
|
2476
|
+
this.camera.position.copy(start.clone().sub(lookAtVector));
|
|
2477
|
+
this.control.target.copy(position.clone());
|
|
2484
2478
|
this.control.update();
|
|
2485
2479
|
this.control.enabled = true;
|
|
2486
2480
|
resolve(true);
|
|
@@ -2598,6 +2592,7 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2598
2592
|
__publicField(this, "floorDataMap", /* @__PURE__ */ new Map());
|
|
2599
2593
|
__publicField(this, "buildingGroundMap", /* @__PURE__ */ new Map());
|
|
2600
2594
|
__publicField(this, "currentBuildGround", null);
|
|
2595
|
+
__publicField(this, "observe", null);
|
|
2601
2596
|
__publicField(this, "onControlChange", () => {
|
|
2602
2597
|
const { camera: { zoom } } = this.context;
|
|
2603
2598
|
if (zoom !== this.prevCameraZoom) {
|
|
@@ -2631,6 +2626,22 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2631
2626
|
this.context.control.minAzimuthAngle = azimuthal;
|
|
2632
2627
|
}
|
|
2633
2628
|
});
|
|
2629
|
+
__publicField(this, "resize", () => {
|
|
2630
|
+
this.context.onWindowResize();
|
|
2631
|
+
const azimuthal = this.context.control.getAzimuthalAngle();
|
|
2632
|
+
const zoom = this.context.camera.zoom;
|
|
2633
|
+
this.context.control.minZoom = 0;
|
|
2634
|
+
this.context.control.maxZoom = Infinity;
|
|
2635
|
+
this.context.camera.zoom = 1;
|
|
2636
|
+
this.context.setAzimuthalAngle(0, 0);
|
|
2637
|
+
this.context.fitCameraToGround(void 0, 0);
|
|
2638
|
+
this.basicZoom = this.context.camera.zoom;
|
|
2639
|
+
this.context.control.minZoom = this.basicZoom;
|
|
2640
|
+
this.context.control.maxZoom = this.basicZoom * 25;
|
|
2641
|
+
this.context.camera.zoom = zoom;
|
|
2642
|
+
this.context.control.addEventListener("change", this.onControlChange);
|
|
2643
|
+
this.context.setAzimuthalAngle(azimuthal, 0);
|
|
2644
|
+
});
|
|
2634
2645
|
this.config = getConfig(config);
|
|
2635
2646
|
this.context = new Context(container, this.config);
|
|
2636
2647
|
this.registryEvent();
|
|
@@ -2885,10 +2896,18 @@ var BMap = class extends EventDispatcher7 {
|
|
|
2885
2896
|
registryEvent() {
|
|
2886
2897
|
window.addEventListener("keydown", this.onKeydown);
|
|
2887
2898
|
window.addEventListener("keyup", this.onKeyUp);
|
|
2899
|
+
if (this.config.resizeObserver) {
|
|
2900
|
+
const observe = new ResizeObserver(this.resize);
|
|
2901
|
+
observe.observe(this.container);
|
|
2902
|
+
this.observe = observe;
|
|
2903
|
+
}
|
|
2888
2904
|
}
|
|
2889
2905
|
unRegistryEvent() {
|
|
2906
|
+
var _a;
|
|
2890
2907
|
window.removeEventListener("keydown", this.onKeydown);
|
|
2891
2908
|
window.removeEventListener("keyup", this.onKeyUp);
|
|
2909
|
+
(_a = this.observe) == null ? void 0 : _a.disconnect();
|
|
2910
|
+
this.observe = null;
|
|
2892
2911
|
}
|
|
2893
2912
|
/**
|
|
2894
2913
|
* 配置坐标定点 2D/3D线性切换的快捷键
|
|
@@ -3021,22 +3040,6 @@ var BMap = class extends EventDispatcher7 {
|
|
|
3021
3040
|
removeSelectGraphic(graphic) {
|
|
3022
3041
|
this.context.selection.remove(graphic);
|
|
3023
3042
|
}
|
|
3024
|
-
resize() {
|
|
3025
|
-
this.context.onWindowResize();
|
|
3026
|
-
const azimuthal = this.context.control.getAzimuthalAngle();
|
|
3027
|
-
const zoom = this.context.camera.zoom;
|
|
3028
|
-
this.context.control.minZoom = 0;
|
|
3029
|
-
this.context.control.maxZoom = Infinity;
|
|
3030
|
-
this.context.camera.zoom = 1;
|
|
3031
|
-
this.context.setAzimuthalAngle(0, 0);
|
|
3032
|
-
this.context.fitCameraToGround(void 0, 0);
|
|
3033
|
-
this.basicZoom = this.context.camera.zoom;
|
|
3034
|
-
this.context.control.minZoom = this.basicZoom;
|
|
3035
|
-
this.context.control.maxZoom = this.basicZoom * 25;
|
|
3036
|
-
this.context.camera.zoom = zoom;
|
|
3037
|
-
this.context.control.addEventListener("change", this.onControlChange);
|
|
3038
|
-
this.context.setAzimuthalAngle(azimuthal, 0);
|
|
3039
|
-
}
|
|
3040
3043
|
dispose() {
|
|
3041
3044
|
this.context.dispose();
|
|
3042
3045
|
this.floorDataMap.clear();
|