@aibee/crc-bmap 0.0.107 → 0.0.109
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.cjs.min.js +3 -3
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +42 -16
- package/lib/bmap.esm.js.map +2 -2
- package/lib/bmap.esm.min.js +3 -3
- package/lib/bmap.esm.min.js.map +3 -3
- package/lib/bmap.min.js +3 -3
- package/lib/bmap.min.js.map +3 -3
- package/lib/src/context.d.ts +1 -1
- package/lib/src/operations/hover/hover-helper.d.ts +1 -0
- package/lib/src/plugins/navigation/path.d.ts +1 -0
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -2794,6 +2794,14 @@ var HoverHelper = class extends EventDispatcher5 {
|
|
|
2794
2794
|
this.curGraphics.clear();
|
|
2795
2795
|
this.handleHoverGraphicsChange();
|
|
2796
2796
|
};
|
|
2797
|
+
onBodyPointerMove = (e) => {
|
|
2798
|
+
if (this.curGraphics.size) {
|
|
2799
|
+
const rect = this.context.container.getBoundingClientRect();
|
|
2800
|
+
if (e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom) {
|
|
2801
|
+
this.onPointerLevel();
|
|
2802
|
+
}
|
|
2803
|
+
}
|
|
2804
|
+
};
|
|
2797
2805
|
handleHoverGraphicsChange(graphics = this.curGraphics) {
|
|
2798
2806
|
this.dispatchEvent({ type: "hover-change", graphics: Array.from(graphics) });
|
|
2799
2807
|
}
|
|
@@ -2801,11 +2809,13 @@ var HoverHelper = class extends EventDispatcher5 {
|
|
|
2801
2809
|
this.context.addEventListener("pointer-over", this.onPointerMove);
|
|
2802
2810
|
this.context.addEventListener("pointer-move", this.onPointerMove);
|
|
2803
2811
|
this.context.addEventListener("pointer-level", this.onPointerLevel);
|
|
2812
|
+
document.body.addEventListener("pointermove", this.onBodyPointerMove);
|
|
2804
2813
|
}
|
|
2805
2814
|
unRegistryEvent() {
|
|
2806
2815
|
this.context.removeEventListener("pointer-over", this.onPointerMove);
|
|
2807
2816
|
this.context.removeEventListener("pointer-move", this.onPointerMove);
|
|
2808
2817
|
this.context.removeEventListener("pointer-level", this.onPointerLevel);
|
|
2818
|
+
document.body.removeEventListener("pointermove", this.onBodyPointerMove);
|
|
2809
2819
|
}
|
|
2810
2820
|
dispose() {
|
|
2811
2821
|
this.unRegistryEvent();
|
|
@@ -3219,7 +3229,7 @@ var Context = class extends EventDispatcher6 {
|
|
|
3219
3229
|
const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY);
|
|
3220
3230
|
this.dispatchEvent({ type: "pointer-move", e, graphics, pois, position });
|
|
3221
3231
|
};
|
|
3222
|
-
onPointerleave = () => {
|
|
3232
|
+
onPointerleave = (e) => {
|
|
3223
3233
|
this.dispatchEvent({ type: "pointer-level" });
|
|
3224
3234
|
};
|
|
3225
3235
|
onSelectionSelect = ({ graphics, isMultipleSelect }) => {
|
|
@@ -3234,6 +3244,8 @@ var Context = class extends EventDispatcher6 {
|
|
|
3234
3244
|
this.container.addEventListener("pointerover", this.onPointerover);
|
|
3235
3245
|
this.container.addEventListener("pointermove", this.onPointermove);
|
|
3236
3246
|
this.container.addEventListener("pointerleave", this.onPointerleave);
|
|
3247
|
+
this.container.addEventListener("pointercancel", this.onPointerleave);
|
|
3248
|
+
this.container.addEventListener("pointerout", this.onPointerleave);
|
|
3237
3249
|
this.selection.addEventListener("select", this.onSelectionSelect);
|
|
3238
3250
|
this.hoverHelper.addEventListener("hover-change", this.onHoverChange);
|
|
3239
3251
|
}
|
|
@@ -3243,6 +3255,8 @@ var Context = class extends EventDispatcher6 {
|
|
|
3243
3255
|
this.container.removeEventListener("pointerover", this.onPointerover);
|
|
3244
3256
|
this.container.removeEventListener("pointermove", this.onPointermove);
|
|
3245
3257
|
this.container.removeEventListener("pointerleave", this.onPointerleave);
|
|
3258
|
+
this.container.removeEventListener("pointercancel", this.onPointerleave);
|
|
3259
|
+
this.container.removeEventListener("pointerout", this.onPointerleave);
|
|
3246
3260
|
this.selection.removeEventListener("select", this.onSelectionSelect);
|
|
3247
3261
|
this.hoverHelper.removeEventListener("hover-change", this.onHoverChange);
|
|
3248
3262
|
}
|
|
@@ -3285,12 +3299,21 @@ var Context = class extends EventDispatcher6 {
|
|
|
3285
3299
|
* @param azimuthal 弧度
|
|
3286
3300
|
*/
|
|
3287
3301
|
setAzimuthalAngle(azimuthal, duration = 500) {
|
|
3302
|
+
const { maxAzimuthAngle, minAzimuthAngle } = this.control;
|
|
3303
|
+
const disable = maxAzimuthAngle === minAzimuthAngle;
|
|
3304
|
+
if (!disable) {
|
|
3305
|
+
if (azimuthal > maxAzimuthAngle && azimuthal < minAzimuthAngle) {
|
|
3306
|
+
return;
|
|
3307
|
+
}
|
|
3308
|
+
}
|
|
3288
3309
|
if (duration === 0) {
|
|
3289
3310
|
this.control.maxAzimuthAngle = azimuthal;
|
|
3290
3311
|
this.control.minAzimuthAngle = azimuthal;
|
|
3291
3312
|
this.control.update();
|
|
3292
|
-
|
|
3293
|
-
|
|
3313
|
+
if (!disable) {
|
|
3314
|
+
this.control.maxAzimuthAngle = maxAzimuthAngle;
|
|
3315
|
+
this.control.minAzimuthAngle = minAzimuthAngle;
|
|
3316
|
+
}
|
|
3294
3317
|
return;
|
|
3295
3318
|
}
|
|
3296
3319
|
return timeoutPromise(
|
|
@@ -3303,8 +3326,10 @@ var Context = class extends EventDispatcher6 {
|
|
|
3303
3326
|
this.control.update();
|
|
3304
3327
|
}).onComplete(() => {
|
|
3305
3328
|
this.control.enabled = true;
|
|
3306
|
-
|
|
3307
|
-
|
|
3329
|
+
if (!disable) {
|
|
3330
|
+
this.control.maxAzimuthAngle = maxAzimuthAngle;
|
|
3331
|
+
this.control.minAzimuthAngle = minAzimuthAngle;
|
|
3332
|
+
}
|
|
3308
3333
|
this.tweenGroup.remove(tween);
|
|
3309
3334
|
resolve(true);
|
|
3310
3335
|
}).onStart(() => {
|
|
@@ -3820,13 +3845,14 @@ var BMap = class extends EventDispatcher7 {
|
|
|
3820
3845
|
this.context.setAzimuthalAngle(this.config.control.defaultAzimuthal, 0);
|
|
3821
3846
|
this.context.setPolarAngle(this.config.control.defaultPolar, 0);
|
|
3822
3847
|
this.context.fitCameraToGround(void 0, 0);
|
|
3823
|
-
|
|
3824
|
-
this.context.control.minZoom =
|
|
3825
|
-
this.context.control.maxZoom =
|
|
3826
|
-
this.context.control.addEventListener("change", this.onControlChange);
|
|
3848
|
+
const basicZoom = this.context.camera.zoom;
|
|
3849
|
+
this.context.control.minZoom = basicZoom;
|
|
3850
|
+
this.context.control.maxZoom = basicZoom * 25;
|
|
3827
3851
|
if (this.type === "3d") {
|
|
3828
3852
|
this.context.fitCameraToGround(this.config.defaultPadding, 0, false);
|
|
3829
3853
|
}
|
|
3854
|
+
this.basicZoom = this.context.camera.zoom;
|
|
3855
|
+
this.context.control.addEventListener("change", this.onControlChange);
|
|
3830
3856
|
this.onControlChange();
|
|
3831
3857
|
this.context.cameraBound.setEnable(true);
|
|
3832
3858
|
}
|
|
@@ -4171,11 +4197,11 @@ var BMap = class extends EventDispatcher7 {
|
|
|
4171
4197
|
this.context.control.maxZoom = Infinity;
|
|
4172
4198
|
this.context.camera.zoom = 1;
|
|
4173
4199
|
this.context.setAzimuthalAngle(0, 0);
|
|
4174
|
-
const basicZoom = this.context.getFitCameraToGroundZoom(void 0, 0);
|
|
4175
|
-
this.basicZoom = basicZoom || 0;
|
|
4176
|
-
this.context.control.minZoom = this.basicZoom;
|
|
4177
|
-
this.context.control.maxZoom = this.basicZoom * 25;
|
|
4200
|
+
const basicZoom = this.context.getFitCameraToGroundZoom(void 0, 0) || 1;
|
|
4178
4201
|
this.context.camera.zoom = zoom;
|
|
4202
|
+
this.context.control.minZoom = basicZoom;
|
|
4203
|
+
this.context.control.maxZoom = basicZoom * 25;
|
|
4204
|
+
this.basicZoom = zoom;
|
|
4179
4205
|
this.context.control.addEventListener("change", this.onControlChange);
|
|
4180
4206
|
this.context.setAzimuthalAngle(azimuthal, 0);
|
|
4181
4207
|
this.context.cameraBound.setEnable(true);
|
|
@@ -4942,7 +4968,7 @@ var arrow_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAQCAMAA
|
|
|
4942
4968
|
// src/plugins/navigation/path.ts
|
|
4943
4969
|
var defaultConfig2 = {
|
|
4944
4970
|
texture_url: arrow_default,
|
|
4945
|
-
lineWidth:
|
|
4971
|
+
lineWidth: 8,
|
|
4946
4972
|
color: 16777215
|
|
4947
4973
|
};
|
|
4948
4974
|
var Path2 = class extends Object3D11 {
|
|
@@ -5045,7 +5071,7 @@ var Path2 = class extends Object3D11 {
|
|
|
5045
5071
|
),
|
|
5046
5072
|
depthTest: true,
|
|
5047
5073
|
sizeAttenuation: false,
|
|
5048
|
-
lineWidth: this.config.lineWidth,
|
|
5074
|
+
lineWidth: this.config.lineWidth * 2,
|
|
5049
5075
|
map: this.texture,
|
|
5050
5076
|
blending: NormalBlending,
|
|
5051
5077
|
repeat: new Vector25(this.getRepeat(), 1)
|
|
@@ -5388,7 +5414,7 @@ var Navigation = class extends Plugin {
|
|
|
5388
5414
|
} else {
|
|
5389
5415
|
this.path = new Path2(this, this.options.path);
|
|
5390
5416
|
this.path.create(cPath);
|
|
5391
|
-
this.path.position.z = this.bmap.context.currentFloor.groundMaxHeight +
|
|
5417
|
+
this.path.position.z = this.bmap.context.currentFloor.groundMaxHeight + 1;
|
|
5392
5418
|
this.bmap.context.scene.add(this.path);
|
|
5393
5419
|
}
|
|
5394
5420
|
if (this.startPoi) {
|