@earthview/core 0.2.5 → 0.2.7

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/dist/index.mjs CHANGED
@@ -23134,13 +23134,14 @@ class dm {
23134
23134
  bottom: 0;
23135
23135
  background: transparent;
23136
23136
  z-index: 10000;
23137
+ pointer-events: auto;
23137
23138
  `, t.onclick = (e) => {
23138
23139
  e.stopPropagation(), this.options.onCancel(), this.destroy();
23139
23140
  }, t;
23140
23141
  }
23141
23142
  createElement() {
23142
23143
  const t = this.options.theme === "dark", e = document.createElement("div");
23143
- e.className = "text-input-modal-container", e.style.cssText = `
23144
+ e.style.userSelect = "none", e.className = "text-input-modal-container", e.style.cssText = `
23144
23145
  position: fixed;
23145
23146
  z-index: 10001;
23146
23147
  width: 280px;
@@ -23163,6 +23164,7 @@ class dm {
23163
23164
  padding: 8px 12px;
23164
23165
  border-bottom: 1px solid ${t ? "#3d3d3d" : "#eee"};
23165
23166
  background: ${t ? "#252525" : "#f5f5f5"};
23167
+ user-select: none;
23166
23168
  `;
23167
23169
  const i = document.createElement("span");
23168
23170
  return i.style.cssText = `
@@ -23562,10 +23564,11 @@ class um extends Lt {
23562
23564
  },
23563
23565
  onDelete: n,
23564
23566
  theme: this.currentTheme,
23565
- t: c
23567
+ t: c,
23568
+ container: this.mapView?.getTargetElement()
23566
23569
  },
23567
23570
  { x: l, y: h }
23568
- );
23571
+ ), this.textInputModal.getElement().style.userSelect = "none";
23569
23572
  }
23570
23573
  hideTextInputModal() {
23571
23574
  this.textInputModal && (this.textInputModal.destroy(), this.textInputModal = null), this.isInputActive = !1;
@@ -31384,23 +31387,33 @@ class ar extends Lt {
31384
31387
  duration: 300
31385
31388
  }), n && n.onClick && n.onClick(n, e);
31386
31389
  const a = t.getProperties(), l = a.bubbleBoxCoverImage && a.bubbleBoxCoverImage.trim() !== "", h = a.bubbleBoxTitle && a.bubbleBoxTitle.trim() !== "", c = a.bubbleBoxDescription && a.bubbleBoxDescription.trim() !== "", u = (document.body.getAttribute("data-theme") || "dark") === "dark", f = u ? "#1e1e1e" : "#ffffff", g = u ? "#333" : "#e0e0e0", p = u ? "#fff" : "#333", m = u ? "#aaa" : "#666", y = document.createElement("div");
31387
- y.style.position = "absolute", y.style.zIndex = "10000", y.style.background = f, y.style.border = `1px solid ${g}`, y.style.borderRadius = "8px", y.style.boxShadow = "0 4px 12px rgba(0,0,0,0.3)", y.style.width = `${this.popupWidth}px`, y.style.maxWidth = `${this.popupWidth}px`, y.style.overflow = "hidden";
31390
+ y.style.position = "absolute", y.style.zIndex = "10000", y.style.background = f, y.style.border = `1px solid ${g}`, y.style.borderRadius = "8px", y.style.boxShadow = "0 4px 12px rgba(0,0,0,0.3)", y.style.width = `${this.popupWidth}px`, y.style.maxWidth = `${this.popupWidth}px`, y.style.overflow = "hidden", y.style.userSelect = "none";
31388
31391
  let x = "";
31389
31392
  l && (x += `<div style="height: ${this.coverImageHeight}px; overflow: hidden;">
31390
- <img src="${a.bubbleBoxCoverImage}" style="width: 100%; height: 100%; object-fit: cover;" />
31391
- </div>`), x += '<div style="padding: 12px;">', h && (x += `<div style="font-size: 14px; font-weight: 600; color: ${p}; margin-bottom: 8px;">${a.bubbleBoxTitle}</div>`), c && (x += `<div style="font-size: 12px; color: ${m}; line-height: 1.5;">${a.bubbleBoxDescription}</div>`), x += "</div>", y.innerHTML = x;
31392
- const E = this.view.getTargetElement();
31393
- getComputedStyle(E).position === "static" && (E.style.position = "relative"), E.appendChild(y);
31394
- const w = t.getGeometry(), C = this.view.getPixelFromCoordinate(w.getCoordinates()), v = E.getBoundingClientRect(), _ = y.offsetWidth, b = y.offsetHeight;
31395
- if (!(C[0] >= 0 && C[0] <= v.width && C[1] >= 0 && C[1] <= v.height)) {
31396
- y.style.display = "none", this.currentPopup = y;
31397
- return;
31398
- }
31399
- let P = C[0] - v.left - _ / 2, L = C[1] - v.top - b - 15;
31400
- L < 5 && (L = C[1] - v.top + 15), P = Math.max(5, Math.min(P, v.width - _ - 5)), L = Math.max(5, Math.min(L, v.height - b - 5)), y.style.left = `${P}px`, y.style.top = `${L}px`, y.style.display = "block", this.currentPopup = y;
31393
+ <img src="${a.bubbleBoxCoverImage}" style="width: 100%; height: 100%; object-fit: cover;" />
31394
+ </div>`), x += '<div style="padding: 12px;">', h && (x += `<div style="font-size: 14px; font-weight: 600; color: ${p}; margin-bottom: 8px;">${this.escapeHtml(a.bubbleBoxTitle)}</div>`), c && (x += `<div style="font-size: 12px; color: ${m}; line-height: 1.5;">${this.escapeHtml(a.bubbleBoxDescription)}</div>`), x += "</div>", y.innerHTML = x;
31395
+ const E = t.getGeometry(), w = this.view.getPixelFromCoordinate(E.getCoordinates()), C = this.view.getTargetElement(), v = C.getBoundingClientRect(), _ = y.offsetWidth, b = y.offsetHeight;
31396
+ let S = w[0] - v.left - _ / 2, P = w[1] - v.top - b - 15 + 45;
31397
+ S = Math.max(10, Math.min(S, v.width - _ - 10)), P = Math.max(10, Math.min(P, v.height - b - 10)), y.style.left = `${S}px`, y.style.top = `${P}px`, getComputedStyle(C).position === "static" && (C.style.position = "relative"), C.appendChild(y), this.currentPopup = y;
31398
+ }
31399
+ updatePopupPosition() {
31400
+ !this.currentPopup || !this.currentFeature || (this.updateFrame && cancelAnimationFrame(this.updateFrame), this.updateFrame = requestAnimationFrame(() => {
31401
+ if (!this.currentPopup || !this.currentFeature) return;
31402
+ const t = this.currentFeature.getGeometry(), e = this.view.getPixelFromCoordinate(t.getCoordinates()), n = this.view.getTargetElement().getBoundingClientRect(), r = this.currentPopup.offsetWidth, o = this.currentPopup.offsetHeight;
31403
+ let a = e[0] - n.left - r / 2, l = e[1] - n.top - o - 15 + 45;
31404
+ if (a = Math.max(10, Math.min(a, n.width - r - 10)), l = Math.max(10, Math.min(l, n.height - o - 10)), !(e[0] >= 0 && e[0] <= n.width && e[1] >= 0 && e[1] <= n.height)) {
31405
+ this.currentPopup.style.display = "none";
31406
+ return;
31407
+ }
31408
+ this.currentPopup.style.display = "block", this.currentPopup.style.left = `${a}px`, this.currentPopup.style.top = `${l}px`;
31409
+ }));
31410
+ }
31411
+ escapeHtml(t) {
31412
+ const e = document.createElement("div");
31413
+ return e.textContent = t, e.innerHTML;
31401
31414
  }
31402
31415
  hidePopup() {
31403
- this.currentPopup && (this.currentPopup.remove(), this.currentPopup = null), this.currentFeature = null;
31416
+ this.currentPopup && (this.currentPopup.parentNode && this.currentPopup.parentNode.removeChild(this.currentPopup), this.currentPopup = null), this.currentFeature = null;
31404
31417
  }
31405
31418
  clearAllMarkers() {
31406
31419
  this.animationFrames.forEach((t, e) => {
@@ -31419,19 +31432,6 @@ class ar extends Lt {
31419
31432
  updateData(t) {
31420
31433
  t.markers && (this.clearAllMarkers(), t.markers.forEach((e) => this.addMarker(e)));
31421
31434
  }
31422
- updatePopupPosition() {
31423
- !this.currentPopup || !this.currentFeature || (this.updateFrame && cancelAnimationFrame(this.updateFrame), this.updateFrame = requestAnimationFrame(() => {
31424
- if (!this.currentPopup || !this.currentFeature) return;
31425
- const t = this.currentFeature.getGeometry(), e = this.view.getPixelFromCoordinate(t.getCoordinates()), n = this.view.getTargetElement().getBoundingClientRect(), r = this.currentPopup.offsetWidth, o = this.currentPopup.offsetHeight;
31426
- if (!(e[0] >= 0 && e[0] <= n.width && e[1] >= 0 && e[1] <= n.height)) {
31427
- this.currentPopup.style.display = "none";
31428
- return;
31429
- }
31430
- this.currentPopup.style.display = "block";
31431
- let l = e[0] - n.left - r / 2, h = e[1] - n.top - o - 15;
31432
- l = Math.max(5, Math.min(l, n.width - r - 5)), h = Math.max(5, Math.min(h, n.height - o - 5)), this.currentPopup.style.left = `${l}px`, this.currentPopup.style.top = `${h}px`;
31433
- }));
31434
- }
31435
31435
  destroy() {
31436
31436
  this.animationFrames.forEach((t, e) => {
31437
31437
  this.stopAnimation(e);
@@ -33095,6 +33095,7 @@ class e_ {
33095
33095
  border-radius: 8px;
33096
33096
  padding: 4px;
33097
33097
  backdrop-filter: blur(4px);
33098
+ user-select: none;
33098
33099
  `, this.scrollUpBtn = this.createScrollButton("▲", this.options.t.topScroll || "Top Scroll"), e.appendChild(this.scrollUpBtn), this.scrollUpBtn.style.display = "none";
33099
33100
  const i = document.createElement("div");
33100
33101
  i.className = "toolbar-scroll-container", i.style.cssText = `
@@ -33306,6 +33307,7 @@ class lr {
33306
33307
  overflow: hidden;
33307
33308
  display: flex;
33308
33309
  flex-direction: column;
33310
+ user-select: none;
33309
33311
  `;
33310
33312
  let n = 328;
33311
33313
  if (this.element?.parentElement) {
@@ -33335,6 +33337,7 @@ class lr {
33335
33337
  padding: 2px 10px;
33336
33338
  border-bottom: 1px solid ${t ? "#333" : "#e0e0e0"};
33337
33339
  background: ${t ? "#2d2d2d" : "#f5f5f5"};
33340
+ user-select: none;
33338
33341
  `;
33339
33342
  const o = document.createElement("span");
33340
33343
  o.style.cssText = `color: ${t ? "#fff" : "#333"}; font-size: 12px; font-weight: 500;`, o.textContent = this.options.title, r.appendChild(o);
@@ -33429,6 +33432,7 @@ class i_ {
33429
33432
  return t.style.cssText = `
33430
33433
  width: 100%;
33431
33434
  height: 100%;
33435
+ user-select: none;
33432
33436
  `, t;
33433
33437
  }
33434
33438
  isSystemLayer(t) {
@@ -33568,6 +33572,7 @@ class i_ {
33568
33572
  border-left: ${n ? "3px solid #00aaff" : "3px solid transparent"};
33569
33573
  transition: all 0.2s;
33570
33574
  border-bottom: 1px solid ${r ? "#333" : "#eee"};
33575
+ user-select: none;
33571
33576
  `, a.onmouseenter = () => {
33572
33577
  n || (a.style.background = r ? "#2a2a2a" : "#f5f5f5");
33573
33578
  }, a.onmouseleave = () => {
@@ -33686,6 +33691,7 @@ class i_ {
33686
33691
  background: ${i ? "#2d2d2d" : "#f5f5f5"};
33687
33692
  border-bottom: 1px solid ${i ? "#333" : "#e0e0e0"};
33688
33693
  flex-shrink: 0;
33694
+ user-select: none;
33689
33695
  `;
33690
33696
  const d = document.createElement("span");
33691
33697
  d.style.cssText = `color: ${i ? "#fff" : "#333"}; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;`, d.textContent = `${e} - ${this.options.t.coordinateData || "coordinateData"}`, c.appendChild(d);
@@ -33850,6 +33856,7 @@ class i_ {
33850
33856
  background: ${i ? "#2d2d2d" : "#f5f5f5"};
33851
33857
  border-bottom: 1px solid ${i ? "#444" : "#ddd"};
33852
33858
  flex-shrink: 0;
33859
+ user-select: none;
33853
33860
  `;
33854
33861
  const g = document.createElement("span");
33855
33862
  g.style.cssText = `color: ${i ? "#fff" : "#333"}; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1;`, g.textContent = this.options.t.details || "details", f.appendChild(g);
@@ -34031,6 +34038,7 @@ class n_ {
34031
34038
  return t.style.cssText = `
34032
34039
  width: 100%;
34033
34040
  height: 100%;
34041
+ user-select: none;
34034
34042
  `, t;
34035
34043
  }
34036
34044
  render() {
@@ -34086,6 +34094,7 @@ class s_ {
34086
34094
  return t.style.cssText = `
34087
34095
  width: 100%;
34088
34096
  height: 100%;
34097
+ user-select: none;
34089
34098
  `, t;
34090
34099
  }
34091
34100
  render() {
@@ -34216,6 +34225,7 @@ class r_ {
34216
34225
  return t.style.cssText = `
34217
34226
  width: 100%;
34218
34227
  height: 100%;
34228
+ user-select: none;
34219
34229
  `, t;
34220
34230
  }
34221
34231
  render() {
@@ -34361,6 +34371,7 @@ class ke {
34361
34371
  backdrop-filter: blur(8px);
34362
34372
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
34363
34373
  cursor: default;
34374
+ user-select: none;
34364
34375
  `;
34365
34376
  const i = `
34366
34377
  width: 28px;
@@ -34697,6 +34708,7 @@ class o_ {
34697
34708
  backdrop-filter: blur(8px);
34698
34709
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
34699
34710
  cursor: default;
34711
+ user-select: none;
34700
34712
  `;
34701
34713
  const i = `
34702
34714
  width: 28px;
@@ -34792,6 +34804,7 @@ class a_ {
34792
34804
  color: ${t ? "#fff" : "#333"};
34793
34805
  pointer-events: none;
34794
34806
  border: 1px solid ${t ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
34807
+ user-select: none;
34795
34808
  `, e.textContent = "", e;
34796
34809
  }
34797
34810
  updateScale(t) {
@@ -34827,6 +34840,7 @@ class l_ {
34827
34840
  flex-direction: column;
34828
34841
  gap: 12px;
34829
34842
  display: none;
34843
+ user-select: none;
34830
34844
  `, this.spinner = document.createElement("div"), this.spinner.className = "loading-spinner", this.spinner.style.cssText = `
34831
34845
  width: 40px;
34832
34846
  height: 40px;
@@ -34884,6 +34898,7 @@ class h_ {
34884
34898
  overflow: hidden;
34885
34899
  display: flex;
34886
34900
  flex-direction: column;
34901
+ user-select: none;
34887
34902
  `, e;
34888
34903
  }
34889
34904
  getPointData() {
@@ -34930,6 +34945,7 @@ class h_ {
34930
34945
  border-bottom: 1px solid ${t ? "#333" : "#e0e0e0"};
34931
34946
  background: ${t ? "#2d2d2d" : "#f5f5f5"};
34932
34947
  flex-shrink: 0;
34948
+ user-select: none;
34933
34949
  `;
34934
34950
  const i = document.createElement("span");
34935
34951
  i.style.cssText = `color: ${t ? "#fff" : "#333"}; font-size: 12px; font-weight: 500;`, i.textContent = this.options.t.coordinateData, e.appendChild(i);
@@ -35091,6 +35107,7 @@ class h_ {
35091
35107
  background: ${i ? "#2d2d2d" : "#f5f5f5"};
35092
35108
  border-bottom: 1px solid ${i ? "#444" : "#ddd"};
35093
35109
  flex-shrink: 0;
35110
+ user-select: none;
35094
35111
  `;
35095
35112
  const g = document.createElement("span");
35096
35113
  g.style.cssText = `color: ${i ? "#fff" : "#333"}; font-size: 13px; font-weight: 600;`, g.textContent = this.options.t.details, f.appendChild(g);
@@ -37719,7 +37736,7 @@ class G_ {
37719
37736
  theme: this.theme,
37720
37737
  t: this.t,
37721
37738
  onClose: () => {
37722
- this.handleTogglePopup(null), this.callbacks.onClearMeasurements();
37739
+ this.handleTogglePopup(null);
37723
37740
  }
37724
37741
  });
37725
37742
  const n = new r_({
@@ -38280,7 +38297,7 @@ class X_ {
38280
38297
  }
38281
38298
  createElement() {
38282
38299
  const t = this.options.theme === "dark", e = document.createElement("div");
38283
- e.className = "image-input-modal-container", e.style.cssText = `
38300
+ e.className = "image-input-modal-container", e.style.userSelect = "none", e.style.cssText = `
38284
38301
  position: fixed;
38285
38302
  z-index: 10001;
38286
38303
  width: 300px;
@@ -38309,6 +38326,7 @@ class X_ {
38309
38326
  padding: 8px 12px;
38310
38327
  border-bottom: 1px solid ${t ? "#3d3d3d" : "#eee"};
38311
38328
  background: ${t ? "#252525" : "#f5f5f5"};
38329
+ user-select: none;
38312
38330
  `;
38313
38331
  const i = document.createElement("span");
38314
38332
  return i.style.cssText = `
@@ -38688,10 +38706,11 @@ class j_ extends Lt {
38688
38706
  },
38689
38707
  onDelete: n,
38690
38708
  theme: this.currentTheme,
38691
- t: c
38709
+ t: c,
38710
+ container: this.mapView?.getTargetElement()
38692
38711
  },
38693
38712
  { x: l, y: h }
38694
- );
38713
+ ), this.imageInputModal.getElement().style.userSelect = "none";
38695
38714
  }
38696
38715
  hideImageInputModal() {
38697
38716
  this.imageInputModal && (this.imageInputModal.destroy(), this.imageInputModal = null), this.isInputActive = !1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earthview/core",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "A reliable geographic information graphics system developed based on OpenLayers.",
5
5
  "author": "happyboy",
6
6
  "license": "AGPL-3.0-only",