@aibee/crc-bmap 0.0.70 → 0.0.72
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 +2 -2
- package/example/vite.config.ts +1 -1
- package/lib/bmap.cjs.min.js +1 -1
- package/lib/bmap.cjs.min.js.map +4 -4
- package/lib/bmap.esm.js +30 -7
- package/lib/bmap.esm.js.map +3 -3
- package/lib/bmap.esm.min.js +1 -1
- package/lib/bmap.esm.min.js.map +4 -4
- package/lib/bmap.min.js +1 -1
- package/lib/bmap.min.js.map +4 -4
- package/lib/src/elements/poi.d.ts +2 -0
- package/lib/src/utils/index.d.ts +2 -0
- package/lib/src/utils/keyboard.d.ts +1 -0
- package/lib/src/utils/os.d.ts +1 -0
- package/package.json +1 -1
package/lib/bmap.esm.js
CHANGED
|
@@ -455,6 +455,17 @@ function disposeLoader() {
|
|
|
455
455
|
modelMap.clear();
|
|
456
456
|
}
|
|
457
457
|
|
|
458
|
+
// src/utils/os.ts
|
|
459
|
+
var isMac = navigator.userAgent.toUpperCase().indexOf("MAC") >= 0;
|
|
460
|
+
|
|
461
|
+
// src/utils/keyboard.ts
|
|
462
|
+
function isControl(key) {
|
|
463
|
+
if (isMac) {
|
|
464
|
+
return key === "Meta";
|
|
465
|
+
}
|
|
466
|
+
return key === "Control";
|
|
467
|
+
}
|
|
468
|
+
|
|
458
469
|
// src/context.ts
|
|
459
470
|
import {
|
|
460
471
|
EventDispatcher as EventDispatcher6,
|
|
@@ -890,7 +901,8 @@ var defaultOptions3 = {
|
|
|
890
901
|
position: { x: 0, y: 0, z: 0 },
|
|
891
902
|
icon_opacity: 1,
|
|
892
903
|
icon_border: { color: "#586EE0", width: 0 },
|
|
893
|
-
background: ""
|
|
904
|
+
background: "",
|
|
905
|
+
collision_hide_icon: true
|
|
894
906
|
};
|
|
895
907
|
var Poi = class extends EventDispatcher2 {
|
|
896
908
|
constructor(context, options) {
|
|
@@ -906,6 +918,7 @@ var Poi = class extends EventDispatcher2 {
|
|
|
906
918
|
__publicField(this, "size", { width: 0, height: 0 });
|
|
907
919
|
__publicField(this, "position", new Vector35());
|
|
908
920
|
__publicField(this, "userData", {});
|
|
921
|
+
__publicField(this, "showTextStatus", true);
|
|
909
922
|
__publicField(this, "_changePosition", () => {
|
|
910
923
|
});
|
|
911
924
|
this.options = proxyOptions(__spreadValues(__spreadValues({}, defaultOptions3), options), this);
|
|
@@ -954,7 +967,6 @@ var Poi = class extends EventDispatcher2 {
|
|
|
954
967
|
this.addEventListener("change-icon_border", ({ value }) => {
|
|
955
968
|
if (this.img) {
|
|
956
969
|
this.img.style.border = `${value.width}px solid ${value.color}`;
|
|
957
|
-
this.resetSize();
|
|
958
970
|
}
|
|
959
971
|
});
|
|
960
972
|
this.addEventListener("change-background", ({ value }) => {
|
|
@@ -1060,11 +1072,20 @@ var Poi = class extends EventDispatcher2 {
|
|
|
1060
1072
|
this.changeOverlayVisible(visible);
|
|
1061
1073
|
}
|
|
1062
1074
|
changeOverlayVisible(visible) {
|
|
1063
|
-
if (visible === this.overlay.visible) {
|
|
1075
|
+
if (visible === this.overlay.visible && this.options.collision_hide_icon) {
|
|
1064
1076
|
return;
|
|
1065
1077
|
}
|
|
1066
|
-
this.
|
|
1067
|
-
|
|
1078
|
+
if (this.options.collision_hide_icon) {
|
|
1079
|
+
this.overlay.visible = visible;
|
|
1080
|
+
this.overlay.div.style.visibility = visible ? "visible" : "hidden";
|
|
1081
|
+
} else {
|
|
1082
|
+
if (this.showTextStatus === visible) {
|
|
1083
|
+
return;
|
|
1084
|
+
}
|
|
1085
|
+
console.log("visible", visible);
|
|
1086
|
+
this.textDiv.style.display = visible ? "block" : "none";
|
|
1087
|
+
this.showTextStatus = visible;
|
|
1088
|
+
}
|
|
1068
1089
|
}
|
|
1069
1090
|
parentSetVisible(visible) {
|
|
1070
1091
|
if (!this.visible) {
|
|
@@ -2132,7 +2153,7 @@ var Selection = class extends EventDispatcher4 {
|
|
|
2132
2153
|
this.downPoint = null;
|
|
2133
2154
|
});
|
|
2134
2155
|
__publicField(this, "onKeyDown", (e) => {
|
|
2135
|
-
if (e.key
|
|
2156
|
+
if (isControl(e.key)) {
|
|
2136
2157
|
this.isMultipleSelect = true;
|
|
2137
2158
|
this.boxSelection.setEnable(true);
|
|
2138
2159
|
this.prevPanStatus = this.context.control.enablePan;
|
|
@@ -2142,7 +2163,7 @@ var Selection = class extends EventDispatcher4 {
|
|
|
2142
2163
|
}
|
|
2143
2164
|
});
|
|
2144
2165
|
__publicField(this, "onKeyUp", (e) => {
|
|
2145
|
-
if (e.key
|
|
2166
|
+
if (isControl(e.key)) {
|
|
2146
2167
|
this.isMultipleSelect = false;
|
|
2147
2168
|
this.boxSelection.setEnable(false);
|
|
2148
2169
|
this.context.control.enablePan = !!this.prevPanStatus;
|
|
@@ -3439,6 +3460,8 @@ export {
|
|
|
3439
3460
|
initScene,
|
|
3440
3461
|
initShape,
|
|
3441
3462
|
isContain,
|
|
3463
|
+
isControl,
|
|
3464
|
+
isMac,
|
|
3442
3465
|
loadModel,
|
|
3443
3466
|
proxyOptions,
|
|
3444
3467
|
setCirclePosition,
|