@aibee/crc-bmap 0.0.56 → 0.0.57

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/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
  * 设置纵向旋转角度
@@ -2598,6 +2590,7 @@ var BMap = class extends EventDispatcher7 {
2598
2590
  __publicField(this, "floorDataMap", /* @__PURE__ */ new Map());
2599
2591
  __publicField(this, "buildingGroundMap", /* @__PURE__ */ new Map());
2600
2592
  __publicField(this, "currentBuildGround", null);
2593
+ __publicField(this, "observe", null);
2601
2594
  __publicField(this, "onControlChange", () => {
2602
2595
  const { camera: { zoom } } = this.context;
2603
2596
  if (zoom !== this.prevCameraZoom) {
@@ -2631,6 +2624,22 @@ var BMap = class extends EventDispatcher7 {
2631
2624
  this.context.control.minAzimuthAngle = azimuthal;
2632
2625
  }
2633
2626
  });
2627
+ __publicField(this, "resize", () => {
2628
+ this.context.onWindowResize();
2629
+ const azimuthal = this.context.control.getAzimuthalAngle();
2630
+ const zoom = this.context.camera.zoom;
2631
+ this.context.control.minZoom = 0;
2632
+ this.context.control.maxZoom = Infinity;
2633
+ this.context.camera.zoom = 1;
2634
+ this.context.setAzimuthalAngle(0, 0);
2635
+ this.context.fitCameraToGround(void 0, 0);
2636
+ this.basicZoom = this.context.camera.zoom;
2637
+ this.context.control.minZoom = this.basicZoom;
2638
+ this.context.control.maxZoom = this.basicZoom * 25;
2639
+ this.context.camera.zoom = zoom;
2640
+ this.context.control.addEventListener("change", this.onControlChange);
2641
+ this.context.setAzimuthalAngle(azimuthal, 0);
2642
+ });
2634
2643
  this.config = getConfig(config);
2635
2644
  this.context = new Context(container, this.config);
2636
2645
  this.registryEvent();
@@ -2885,10 +2894,18 @@ var BMap = class extends EventDispatcher7 {
2885
2894
  registryEvent() {
2886
2895
  window.addEventListener("keydown", this.onKeydown);
2887
2896
  window.addEventListener("keyup", this.onKeyUp);
2897
+ if (this.config.resizeObserver) {
2898
+ const observe = new ResizeObserver(this.resize);
2899
+ observe.observe(this.container);
2900
+ this.observe = observe;
2901
+ }
2888
2902
  }
2889
2903
  unRegistryEvent() {
2904
+ var _a;
2890
2905
  window.removeEventListener("keydown", this.onKeydown);
2891
2906
  window.removeEventListener("keyup", this.onKeyUp);
2907
+ (_a = this.observe) == null ? void 0 : _a.disconnect();
2908
+ this.observe = null;
2892
2909
  }
2893
2910
  /**
2894
2911
  * 配置坐标定点 2D/3D线性切换的快捷键
@@ -3021,22 +3038,6 @@ var BMap = class extends EventDispatcher7 {
3021
3038
  removeSelectGraphic(graphic) {
3022
3039
  this.context.selection.remove(graphic);
3023
3040
  }
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
3041
  dispose() {
3041
3042
  this.context.dispose();
3042
3043
  this.floorDataMap.clear();