@aibee/crc-bmap 0.0.75 → 0.0.77
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/README.md +1 -1
- package/example/index.css +22 -22
- package/example/index.html +63 -63
- package/example/src/main.ts +581 -577
- package/example/vite.config.ts +28 -28
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +3 -3
- package/lib/bmap.esm.js +22 -11
- package/lib/bmap.esm.js.map +3 -3
- 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/context.d.ts +2 -0
- package/lib/src/operations/hover/hover-helper.d.ts +2 -1
- package/package.json +47 -47
package/lib/bmap.esm.js
CHANGED
|
@@ -1020,7 +1020,6 @@ var Poi = class extends EventDispatcher2 {
|
|
|
1020
1020
|
this.overlay.div.style.userSelect = `none`;
|
|
1021
1021
|
this.overlay.div.appendChild(div);
|
|
1022
1022
|
this.div = div;
|
|
1023
|
-
this._changePosition();
|
|
1024
1023
|
this.resetSize();
|
|
1025
1024
|
return div;
|
|
1026
1025
|
}
|
|
@@ -2213,8 +2212,8 @@ var Selection = class extends EventDispatcher4 {
|
|
|
2213
2212
|
this.dispatchEvent({ type: "select", graphics: [...this._list], isMultipleSelect: this.isMultipleSelect });
|
|
2214
2213
|
}
|
|
2215
2214
|
registryEvent() {
|
|
2216
|
-
this.context.container.addEventListener("pointerdown", this.onPointerDown
|
|
2217
|
-
this.context.container.addEventListener("pointerup", this.onPointerUp
|
|
2215
|
+
this.context.container.addEventListener("pointerdown", this.onPointerDown);
|
|
2216
|
+
this.context.container.addEventListener("pointerup", this.onPointerUp);
|
|
2218
2217
|
this.context.container.addEventListener("pointerout", this.onPointerOut);
|
|
2219
2218
|
this.context.container.addEventListener("pointercancel", this.onPointerOut);
|
|
2220
2219
|
window.addEventListener("keydown", this.onKeyDown);
|
|
@@ -2222,8 +2221,8 @@ var Selection = class extends EventDispatcher4 {
|
|
|
2222
2221
|
this.boxSelection.addEventListener("selected", this.onBoxSelected);
|
|
2223
2222
|
}
|
|
2224
2223
|
unRegistryEvent() {
|
|
2225
|
-
this.context.container.removeEventListener("pointerdown", this.onPointerDown
|
|
2226
|
-
this.context.container.removeEventListener("pointerup", this.onPointerUp
|
|
2224
|
+
this.context.container.removeEventListener("pointerdown", this.onPointerDown);
|
|
2225
|
+
this.context.container.removeEventListener("pointerup", this.onPointerUp);
|
|
2227
2226
|
this.context.container.removeEventListener("pointerout", this.onPointerOut);
|
|
2228
2227
|
this.context.container.removeEventListener("pointercancel", this.onPointerOut);
|
|
2229
2228
|
window.removeEventListener("keydown", this.onKeyDown);
|
|
@@ -2250,7 +2249,7 @@ var HoverHelper = class extends EventDispatcher5 {
|
|
|
2250
2249
|
__publicField(this, "curGraphics", /* @__PURE__ */ new Set());
|
|
2251
2250
|
__publicField(this, "timer", new Timer());
|
|
2252
2251
|
__publicField(this, "graphicTimerMap", /* @__PURE__ */ new Map());
|
|
2253
|
-
__publicField(this, "onPointerMove", ({ graphics, pois }) => {
|
|
2252
|
+
__publicField(this, "onPointerMove", ({ graphics, pois, e }) => {
|
|
2254
2253
|
const poiGraphics = pois.map((item) => {
|
|
2255
2254
|
var _a;
|
|
2256
2255
|
return (_a = this.context.currentFloor) == null ? void 0 : _a.graphicLayer.graphicMap.get(item.options.id);
|
|
@@ -2261,11 +2260,23 @@ var HoverHelper = class extends EventDispatcher5 {
|
|
|
2261
2260
|
return;
|
|
2262
2261
|
}
|
|
2263
2262
|
const { time } = this.context.config.hover;
|
|
2264
|
-
const allGraphics = new Set(
|
|
2265
|
-
if (
|
|
2263
|
+
const allGraphics = /* @__PURE__ */ new Set();
|
|
2264
|
+
if (poiGraphics.length) {
|
|
2265
|
+
let resGraphic;
|
|
2266
|
+
let distance = 1e4;
|
|
2266
2267
|
poiGraphics.forEach((graphic) => {
|
|
2267
|
-
|
|
2268
|
+
const poi = pois.find((poi2) => poi2.options.id === graphic.options.id);
|
|
2269
|
+
const { x, y } = poi.clientPos;
|
|
2270
|
+
let curDistance = Math.sqrt(__pow(x - e.offsetX, 2) + __pow(y - e.offsetY, 2));
|
|
2271
|
+
if (curDistance < distance) {
|
|
2272
|
+
distance = curDistance;
|
|
2273
|
+
resGraphic = graphic;
|
|
2274
|
+
}
|
|
2268
2275
|
});
|
|
2276
|
+
allGraphics.add(resGraphic);
|
|
2277
|
+
}
|
|
2278
|
+
if (!allGraphics.size) {
|
|
2279
|
+
graphics.forEach((graphic) => allGraphics.add(graphic));
|
|
2269
2280
|
}
|
|
2270
2281
|
allGraphics.forEach((graphic) => {
|
|
2271
2282
|
if (this.graphicTimerMap.get(graphic)) {
|
|
@@ -2528,12 +2539,12 @@ var Context = class extends EventDispatcher6 {
|
|
|
2528
2539
|
__publicField(this, "onPointerover", (e) => {
|
|
2529
2540
|
const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);
|
|
2530
2541
|
const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY);
|
|
2531
|
-
this.dispatchEvent({ type: "pointer-over", graphics, pois, position });
|
|
2542
|
+
this.dispatchEvent({ type: "pointer-over", e, graphics, pois, position });
|
|
2532
2543
|
});
|
|
2533
2544
|
__publicField(this, "onPointermove", (e) => {
|
|
2534
2545
|
const { graphics, position } = this.getGraphicsByDeviceXy(e.offsetX, e.offsetY);
|
|
2535
2546
|
const pois = this.getPoisByDeviceXy(e.offsetX, e.offsetY);
|
|
2536
|
-
this.dispatchEvent({ type: "pointer-move", graphics, pois, position });
|
|
2547
|
+
this.dispatchEvent({ type: "pointer-move", e, graphics, pois, position });
|
|
2537
2548
|
});
|
|
2538
2549
|
__publicField(this, "onPointerleave", () => {
|
|
2539
2550
|
this.dispatchEvent({ type: "pointer-level" });
|