bigmap-plugin 1.0.7 → 1.0.8
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 +2 -0
- package/dist/bigmap-plugin.js +108 -108
- package/dist/bigmap-plugin.umd.cjs +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -961,6 +961,8 @@ api.setContourVisible(false) // 关闭
|
|
|
961
961
|
|
|
962
962
|
**开启后会自动加载并显示当前视区的高程数字**(形如 `1,500 m`,标注间隔 = 等高距 × `labelEvery`)。若此刻地形瓦片尚未加载完成,会每 500ms 自动重试,最长约 10s;关闭等高线或切换 2D 会立即终止重试。
|
|
963
963
|
|
|
964
|
+
关闭等高线时会**同步清除已显示的高程数字**(不只是隐藏),重新开启后按当前视区重新采样,因此不会出现「等高线关了、数字还留在图上」的残留。切换 2D / 3D 同理:切到 2D 清除,切回 3D 自动恢复。
|
|
965
|
+
|
|
964
966
|
高程数字依赖「当前视区」的地形,且不会随相机自动跟随,因此**相机停止移动后会自动重算**(防抖 400ms,两次重算最小间隔 1200ms,避免连续拖动时高频采样地形);移动结束后地形瓦片才补齐的场景也会在地形加载完成时补算。可通过 `refreshOnMove: false` 关闭,改为自行调用 `loadContourLabels`。
|
|
965
967
|
|
|
966
968
|
每次重算都是**整体替换**:先清空上一视区的数字,再按当前视区重新采样。因此从山区拖动到平原(当前视区没有等高线)时,原来的数字会一并移除,不会残留。
|
package/dist/bigmap-plugin.js
CHANGED
|
@@ -1154,7 +1154,7 @@ function fi(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
return t.billboardMap.delete(u), _t(t, d), c;
|
|
1156
1156
|
}, o = (u, c, d, f) => {
|
|
1157
|
-
const g = parseFloat(c[d.fieldMapping.lng]) || 0, b = parseFloat(c[d.fieldMapping.lat]) || 0, y = parseFloat(c[d.fieldMapping.altitude]) || 0, p = u.Cartesian3.fromDegrees(g, b, y),
|
|
1157
|
+
const g = parseFloat(c[d.fieldMapping.lng]) || 0, b = parseFloat(c[d.fieldMapping.lat]) || 0, y = parseFloat(c[d.fieldMapping.altitude]) || 0, p = u.Cartesian3.fromDegrees(g, b, y), w = t.billboardCollection.add({
|
|
1158
1158
|
position: p,
|
|
1159
1159
|
image: c.icon,
|
|
1160
1160
|
width: c.width || d.width,
|
|
@@ -1164,7 +1164,7 @@ function fi(e) {
|
|
|
1164
1164
|
disableDepthTestDistance: ln.NEAR,
|
|
1165
1165
|
verticalOrigin: u.VerticalOrigin.BOTTOM
|
|
1166
1166
|
});
|
|
1167
|
-
return
|
|
1167
|
+
return w.pointData = c, { billboard: w, position: p, lng: g, lat: b, altitude: y };
|
|
1168
1168
|
}, a = async (u, c, d, f = "append") => {
|
|
1169
1169
|
try {
|
|
1170
1170
|
if (f === "replace" && r(), !await n()) return;
|
|
@@ -1179,10 +1179,10 @@ function fi(e) {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
}, p = performance.now();
|
|
1181
1181
|
t.gridIndex || (t.gridIndex = /* @__PURE__ */ new Map());
|
|
1182
|
-
const
|
|
1182
|
+
const w = Array.isArray(u) ? u : [], v = w.length, S = De.BATCH_SIZE, P = De.YIELD_BUDGET_MS;
|
|
1183
1183
|
let T = performance.now(), k = 0;
|
|
1184
1184
|
for (let E = 0; E < v; E += S) {
|
|
1185
|
-
const I =
|
|
1185
|
+
const I = w.slice(E, E + S);
|
|
1186
1186
|
for (const B of I) {
|
|
1187
1187
|
if (!B.icon) {
|
|
1188
1188
|
k += 1, Bt || (Bt = !0, m.warn(
|
|
@@ -1190,27 +1190,27 @@ function fi(e) {
|
|
|
1190
1190
|
));
|
|
1191
1191
|
continue;
|
|
1192
1192
|
}
|
|
1193
|
-
const x = B[y.fieldMapping.id],
|
|
1193
|
+
const x = B[y.fieldMapping.id], C = x != null && x !== "" ? String(x) : ci(), L = i(C), { billboard: D, position: j, lng: U, lat: Y, altitude: le } = o(
|
|
1194
1194
|
b,
|
|
1195
1195
|
B,
|
|
1196
1196
|
y,
|
|
1197
|
-
|
|
1197
|
+
C
|
|
1198
1198
|
);
|
|
1199
|
-
t.billboardMap.set(
|
|
1199
|
+
t.billboardMap.set(C, D);
|
|
1200
1200
|
const re = {
|
|
1201
1201
|
...B,
|
|
1202
|
-
id:
|
|
1202
|
+
id: C,
|
|
1203
1203
|
lng: U,
|
|
1204
1204
|
lat: Y,
|
|
1205
1205
|
altitude: le,
|
|
1206
1206
|
icon: B.icon
|
|
1207
1207
|
};
|
|
1208
|
-
L !== void 0 ? t.pointDataCache[L] = re : (t.cacheIdIndex.set(
|
|
1208
|
+
L !== void 0 ? t.pointDataCache[L] = re : (t.cacheIdIndex.set(C, t.pointDataCache.length), t.pointDataCache.push(re)), At(t, re);
|
|
1209
1209
|
}
|
|
1210
1210
|
E + S < v && performance.now() - T >= P && (await ui(), T = performance.now());
|
|
1211
1211
|
}
|
|
1212
1212
|
k > 0 && m.warn(`[useMapPoint] 本次加载跳过 ${k} 个缺失 icon 的点位`), console.log(
|
|
1213
|
-
`[useMapPoint] ${f} ${
|
|
1213
|
+
`[useMapPoint] ${f} ${w.length} 个点位 billboard 渲染耗时:${(performance.now() - p).toFixed(0)}ms`
|
|
1214
1214
|
);
|
|
1215
1215
|
} catch (g) {
|
|
1216
1216
|
throw m.error("加载点位失败:", g), g;
|
|
@@ -2637,7 +2637,7 @@ function zo(e, t, n) {
|
|
|
2637
2637
|
let a = null, l = null, s = null, u = null, c = 0, d = 0, f = !1, g = !1, b = !1, y = !1;
|
|
2638
2638
|
const p = () => {
|
|
2639
2639
|
o.value = a ? a.getState() : { ...o.value, enabled: r.value };
|
|
2640
|
-
},
|
|
2640
|
+
}, w = async (C, L) => {
|
|
2641
2641
|
if (g)
|
|
2642
2642
|
return b = !0, null;
|
|
2643
2643
|
g = !0;
|
|
@@ -2645,17 +2645,17 @@ function zo(e, t, n) {
|
|
|
2645
2645
|
try {
|
|
2646
2646
|
const j = L ? Ro : 1;
|
|
2647
2647
|
for (let U = 0; U < j; U++) {
|
|
2648
|
-
if (y || !f || a !==
|
|
2649
|
-
|
|
2650
|
-
const Y = await
|
|
2648
|
+
if (y || !f || a !== C || D !== d) return null;
|
|
2649
|
+
C.clearLabels();
|
|
2650
|
+
const Y = await C.loadCurrentViewLabels();
|
|
2651
2651
|
if (D !== d) return null;
|
|
2652
2652
|
if (p(), Y.status === "terrain-loading") {
|
|
2653
2653
|
await new Promise((le) => setTimeout(le, Bo));
|
|
2654
2654
|
continue;
|
|
2655
2655
|
}
|
|
2656
|
-
return Y.status === "success" ? m.debug(`[useMapContour] 已标注 ${Y.labelCount} 个高程数字`) : Y.status === "no-results" ? m.warn(
|
|
2656
|
+
return Y.status === "success" ? m.debug(`[useMapContour] 已标注 ${Y.labelCount} 个高程数字`) : Y.status === "hidden" || (Y.status === "no-results" ? m.warn(
|
|
2657
2657
|
"[useMapContour] 当前视区未找到可标注的等高线:请确认已开启地形,或调小 contourConfig.contourSpacing / labelEvery 以加密标注间隔"
|
|
2658
|
-
) : m.warn(`[useMapContour] 高程数字未加载(${Y.status})`), Y;
|
|
2658
|
+
) : m.warn(`[useMapContour] 高程数字未加载(${Y.status})`)), Y;
|
|
2659
2659
|
}
|
|
2660
2660
|
return m.warn("[useMapContour] 地形长时间未就绪,已放弃自动标注高程数字"), null;
|
|
2661
2661
|
} finally {
|
|
@@ -2664,18 +2664,18 @@ function zo(e, t, n) {
|
|
|
2664
2664
|
}, v = () => {
|
|
2665
2665
|
y || !i.refreshOnMove || !f || !a || (u && clearTimeout(u), u = setTimeout(() => {
|
|
2666
2666
|
if (u = null, y || !f || !a) return;
|
|
2667
|
-
const
|
|
2668
|
-
if (
|
|
2667
|
+
const C = No - (Date.now() - c);
|
|
2668
|
+
if (C > 0) {
|
|
2669
2669
|
u = setTimeout(() => {
|
|
2670
|
-
u = null, !(y || !f || !a) && (c = Date.now(),
|
|
2671
|
-
},
|
|
2670
|
+
u = null, !(y || !f || !a) && (c = Date.now(), w(a, !0));
|
|
2671
|
+
}, C);
|
|
2672
2672
|
return;
|
|
2673
2673
|
}
|
|
2674
|
-
c = Date.now(),
|
|
2674
|
+
c = Date.now(), w(a, !0);
|
|
2675
2675
|
}, Fo));
|
|
2676
|
-
}, S = (
|
|
2676
|
+
}, S = (C) => {
|
|
2677
2677
|
if (s) return;
|
|
2678
|
-
const L =
|
|
2678
|
+
const L = C.camera, D = C.scene?.globe, j = [];
|
|
2679
2679
|
if (typeof L?.moveEnd?.addEventListener == "function" && (L.moveEnd.addEventListener(v), j.push(() => L.moveEnd.removeEventListener(v))), typeof D?.tileLoadProgressEvent?.addEventListener == "function") {
|
|
2680
2680
|
const U = (Y) => {
|
|
2681
2681
|
Y === 0 && v();
|
|
@@ -2688,22 +2688,22 @@ function zo(e, t, n) {
|
|
|
2688
2688
|
}, P = async () => {
|
|
2689
2689
|
if (a) return a;
|
|
2690
2690
|
if (l) return l;
|
|
2691
|
-
const
|
|
2692
|
-
return
|
|
2691
|
+
const C = e.value;
|
|
2692
|
+
return C?.scene?.globe ? (l = (async () => {
|
|
2693
2693
|
try {
|
|
2694
2694
|
const L = await ko(n);
|
|
2695
2695
|
if (y) return null;
|
|
2696
|
-
const D = new L(
|
|
2697
|
-
return a = D, D.setVisible(r.value), f = r.value, S(
|
|
2696
|
+
const D = new L(C, Oo(i));
|
|
2697
|
+
return a = D, D.setVisible(r.value), f = r.value, S(C), D;
|
|
2698
2698
|
} catch (L) {
|
|
2699
2699
|
return m.error("[useMapContour] 彩色等高线库加载失败:", L), null;
|
|
2700
2700
|
} finally {
|
|
2701
2701
|
l = null;
|
|
2702
2702
|
}
|
|
2703
2703
|
})(), l) : null;
|
|
2704
|
-
}, T = async (
|
|
2705
|
-
if (r.value = !!
|
|
2706
|
-
f = !1, a?.hide(), p();
|
|
2704
|
+
}, T = async (C) => {
|
|
2705
|
+
if (r.value = !!C, !r.value) {
|
|
2706
|
+
f = !1, a?.hide(), a?.clearLabels(), p();
|
|
2707
2707
|
return;
|
|
2708
2708
|
}
|
|
2709
2709
|
const L = await P();
|
|
@@ -2711,39 +2711,39 @@ function zo(e, t, n) {
|
|
|
2711
2711
|
r.value = !1, f = !1, p();
|
|
2712
2712
|
return;
|
|
2713
2713
|
}
|
|
2714
|
-
f = !0, p(),
|
|
2714
|
+
f = !0, L.show(), p(), w(L, !0);
|
|
2715
2715
|
}, k = () => {
|
|
2716
2716
|
if (r.value) {
|
|
2717
2717
|
if (a) {
|
|
2718
|
-
f = !0, a.show(), p(),
|
|
2718
|
+
f = !0, a.show(), p(), w(a, !0);
|
|
2719
2719
|
return;
|
|
2720
2720
|
}
|
|
2721
2721
|
T(!0);
|
|
2722
2722
|
}
|
|
2723
2723
|
}, E = () => {
|
|
2724
|
-
f = !1, a?.hide(), p();
|
|
2724
|
+
f = !1, a?.hide(), a?.clearLabels(), p();
|
|
2725
2725
|
}, I = async () => {
|
|
2726
2726
|
if (!r.value) return { status: "hidden", labelCount: 0 };
|
|
2727
|
-
const
|
|
2728
|
-
if (!
|
|
2727
|
+
const C = await P();
|
|
2728
|
+
if (!C)
|
|
2729
2729
|
return {
|
|
2730
2730
|
status: "error",
|
|
2731
2731
|
labelCount: 0,
|
|
2732
2732
|
error: new Error("彩色等高线库未就绪")
|
|
2733
2733
|
};
|
|
2734
|
-
const L = await C
|
|
2735
|
-
return L || { status: "busy", labelCount:
|
|
2734
|
+
const L = await w(C, !1);
|
|
2735
|
+
return L || { status: "busy", labelCount: C.getState().labelCount };
|
|
2736
2736
|
}, B = () => {
|
|
2737
2737
|
if (!a) return { status: "empty", labelCount: 0 };
|
|
2738
|
-
const
|
|
2739
|
-
return p(),
|
|
2738
|
+
const C = a.clearLabels();
|
|
2739
|
+
return p(), C;
|
|
2740
2740
|
}, x = () => a?.getLegendData() ?? null;
|
|
2741
2741
|
return K(() => {
|
|
2742
2742
|
y = !0, u && (clearTimeout(u), u = null), s?.(), s = null;
|
|
2743
2743
|
try {
|
|
2744
2744
|
a?.destroy();
|
|
2745
|
-
} catch (
|
|
2746
|
-
m.warn("[useMapContour] 释放等高线资源失败:",
|
|
2745
|
+
} catch (C) {
|
|
2746
|
+
m.warn("[useMapContour] 释放等高线资源失败:", C);
|
|
2747
2747
|
}
|
|
2748
2748
|
a = null;
|
|
2749
2749
|
}), {
|
|
@@ -2910,7 +2910,7 @@ function Zo(e, t, n) {
|
|
|
2910
2910
|
return M && M.entities ? M : null;
|
|
2911
2911
|
}, p = () => {
|
|
2912
2912
|
f !== null && (cancelAnimationFrame(f), f = null);
|
|
2913
|
-
},
|
|
2913
|
+
}, w = () => {
|
|
2914
2914
|
const M = y();
|
|
2915
2915
|
M && (s && M.entities.remove(s), u && M.entities.remove(u), c && M.entities.remove(c)), s = null, u = null, c = null, d = null;
|
|
2916
2916
|
}, v = () => {
|
|
@@ -2982,10 +2982,10 @@ function Zo(e, t, n) {
|
|
|
2982
2982
|
m.warn("[useMapTrajectory] 轨迹数据无效:", ce);
|
|
2983
2983
|
return;
|
|
2984
2984
|
}
|
|
2985
|
-
p(),
|
|
2985
|
+
p(), w(), o = se, a = Uo(o, l), I(V, Q), v(), l.autoPlay && x();
|
|
2986
2986
|
}, x = () => {
|
|
2987
2987
|
a && (a.play(), v(), a.state.status === "playing" && E());
|
|
2988
|
-
},
|
|
2988
|
+
}, C = () => {
|
|
2989
2989
|
a && (a.pause(), p(), v());
|
|
2990
2990
|
}, L = () => {
|
|
2991
2991
|
if (p(), !a || !o) return;
|
|
@@ -3000,7 +3000,7 @@ function Zo(e, t, n) {
|
|
|
3000
3000
|
const N = be(o, o.minTime + a.state.currentTime);
|
|
3001
3001
|
S(N), P(N), v();
|
|
3002
3002
|
}, U = () => {
|
|
3003
|
-
p(),
|
|
3003
|
+
p(), w(), o = null, a = null, r.value = {
|
|
3004
3004
|
status: "idle",
|
|
3005
3005
|
currentTime: 0,
|
|
3006
3006
|
duration: 0,
|
|
@@ -3009,11 +3009,11 @@ function Zo(e, t, n) {
|
|
|
3009
3009
|
};
|
|
3010
3010
|
}, Y = () => {
|
|
3011
3011
|
const M = y(), N = A();
|
|
3012
|
-
!M || !N || !o || !a || (
|
|
3012
|
+
!M || !N || !o || !a || (w(), I(M, N));
|
|
3013
3013
|
}, le = () => {
|
|
3014
|
-
p(),
|
|
3014
|
+
p(), w();
|
|
3015
3015
|
}, re = () => {
|
|
3016
|
-
p(),
|
|
3016
|
+
p(), w(), o = null, a = null, r.value = {
|
|
3017
3017
|
status: "idle",
|
|
3018
3018
|
currentTime: 0,
|
|
3019
3019
|
duration: 0,
|
|
@@ -3027,7 +3027,7 @@ function Zo(e, t, n) {
|
|
|
3027
3027
|
state: r,
|
|
3028
3028
|
load: B,
|
|
3029
3029
|
play: x,
|
|
3030
|
-
pause:
|
|
3030
|
+
pause: C,
|
|
3031
3031
|
stop: L,
|
|
3032
3032
|
setSpeed: D,
|
|
3033
3033
|
jumpTo: j,
|
|
@@ -3126,12 +3126,12 @@ function na(e, t) {
|
|
|
3126
3126
|
u();
|
|
3127
3127
|
}, p = () => {
|
|
3128
3128
|
l && (l(), l = null), u(), i = null, r = tt(t), n.value = { visible: !1, hasMask: !1, boundaryCount: 0 };
|
|
3129
|
-
},
|
|
3129
|
+
}, w = () => {
|
|
3130
3130
|
p();
|
|
3131
3131
|
};
|
|
3132
3132
|
return K(() => {
|
|
3133
|
-
|
|
3134
|
-
}), { state: n, setMask: g, setVisible: b, clear: p, reapply: d, remove: y, destroy:
|
|
3133
|
+
w();
|
|
3134
|
+
}), { state: n, setMask: g, setVisible: b, clear: p, reapply: d, remove: y, destroy: w };
|
|
3135
3135
|
}
|
|
3136
3136
|
var G = /* @__PURE__ */ ((e) => (e.INVALID_URL = "INVALID_URL", e.INVALID_TEXT = "INVALID_TEXT", e.PARSE_FAILED = "PARSE_FAILED", e.NO_FEATURES = "NO_FEATURES", e.NETWORK_FAILED = "NETWORK_FAILED", e.HTTP_ERROR = "HTTP_ERROR", e.TIMEOUT = "TIMEOUT", e.MAP_NOT_READY = "MAP_NOT_READY", e.LOAD_FAILED = "LOAD_FAILED", e))(G || {});
|
|
3137
3137
|
class $ extends Error {
|
|
@@ -3652,9 +3652,9 @@ function xa(e, t) {
|
|
|
3652
3652
|
a = [];
|
|
3653
3653
|
}, d = (E, I) => {
|
|
3654
3654
|
const B = !va(E), x = [];
|
|
3655
|
-
o.forEach((
|
|
3656
|
-
for (const D of Ma(I,
|
|
3657
|
-
D.show = l &&
|
|
3655
|
+
o.forEach((C, L) => {
|
|
3656
|
+
for (const D of Ma(I, C, i, B, L))
|
|
3657
|
+
D.show = l && C.visible, E.entities.add(D), x.push({ entity: D, featureVisible: C.visible });
|
|
3658
3658
|
}), a = x;
|
|
3659
3659
|
}, f = () => {
|
|
3660
3660
|
const E = e.value?.scene;
|
|
@@ -3671,8 +3671,8 @@ function xa(e, t) {
|
|
|
3671
3671
|
m.warn("[useMapKml] 视角定位失败:", B);
|
|
3672
3672
|
}
|
|
3673
3673
|
}, b = async (E, I, B) => {
|
|
3674
|
-
const x = u(),
|
|
3675
|
-
if (!x || !
|
|
3674
|
+
const x = u(), C = A();
|
|
3675
|
+
if (!x || !C) {
|
|
3676
3676
|
const L = new $(
|
|
3677
3677
|
"地图尚未就绪:请在地图初始化完成后再加载 KML",
|
|
3678
3678
|
G.MAP_NOT_READY
|
|
@@ -3681,7 +3681,7 @@ function xa(e, t) {
|
|
|
3681
3681
|
}
|
|
3682
3682
|
r.value = { ...Ee(), status: "loading", source: E, url: I };
|
|
3683
3683
|
try {
|
|
3684
|
-
o = await B(), l = !0, c(), d(x,
|
|
3684
|
+
o = await B(), l = !0, c(), d(x, C), f();
|
|
3685
3685
|
const D = La(o);
|
|
3686
3686
|
return r.value = {
|
|
3687
3687
|
status: "success",
|
|
@@ -3716,7 +3716,7 @@ function xa(e, t) {
|
|
|
3716
3716
|
"text",
|
|
3717
3717
|
"",
|
|
3718
3718
|
async () => Vt(E, { extractProperties: i.extractProperties }).features
|
|
3719
|
-
)),
|
|
3719
|
+
)), w = () => o, v = (E) => {
|
|
3720
3720
|
l = !!E;
|
|
3721
3721
|
for (const I of a)
|
|
3722
3722
|
I.entity.show = l && I.featureVisible;
|
|
@@ -3737,7 +3737,7 @@ function xa(e, t) {
|
|
|
3737
3737
|
state: r,
|
|
3738
3738
|
loadFromUrl: y,
|
|
3739
3739
|
loadFromText: p,
|
|
3740
|
-
getFeatures:
|
|
3740
|
+
getFeatures: w,
|
|
3741
3741
|
setVisible: v,
|
|
3742
3742
|
flyTo: g,
|
|
3743
3743
|
remove: S,
|
|
@@ -3884,14 +3884,14 @@ function za(e, t, n) {
|
|
|
3884
3884
|
s = void 0;
|
|
3885
3885
|
return;
|
|
3886
3886
|
}
|
|
3887
|
-
const
|
|
3888
|
-
(s !== void 0 || a !== void 0) && (
|
|
3887
|
+
const w = p.scene;
|
|
3888
|
+
(s !== void 0 || a !== void 0) && (w.light = a, l !== void 0 && (w.globe.enableLighting = l)), s = void 0;
|
|
3889
3889
|
}, d = () => {
|
|
3890
|
-
const p = e.value,
|
|
3891
|
-
if (!p?.scene || !
|
|
3890
|
+
const p = e.value, w = A();
|
|
3891
|
+
if (!p?.scene || !w) return;
|
|
3892
3892
|
const v = p.scene;
|
|
3893
3893
|
l === void 0 && (a = v.light, l = !!v.globe.enableLighting), v.globe.enableLighting = !0;
|
|
3894
|
-
const S = Oa(o.value.period,
|
|
3894
|
+
const S = Oa(o.value.period, w);
|
|
3895
3895
|
v.light = S, s = S;
|
|
3896
3896
|
}, f = () => {
|
|
3897
3897
|
u(), o.value.enabled && r.value ? d() : c();
|
|
@@ -3984,7 +3984,7 @@ function Ga(e) {
|
|
|
3984
3984
|
);
|
|
3985
3985
|
}, p = (T, k) => {
|
|
3986
3986
|
l.value = k, y(T), r.value = !1;
|
|
3987
|
-
},
|
|
3987
|
+
}, w = (T) => {
|
|
3988
3988
|
const k = d.value.length;
|
|
3989
3989
|
k !== 0 && (a.value = (a.value + T + k) % k);
|
|
3990
3990
|
}, v = () => {
|
|
@@ -4008,7 +4008,7 @@ function Ga(e) {
|
|
|
4008
4008
|
filteredList: d,
|
|
4009
4009
|
handleInputSearch: g,
|
|
4010
4010
|
handleResultClick: p,
|
|
4011
|
-
moveHighlight:
|
|
4011
|
+
moveHighlight: w,
|
|
4012
4012
|
selectHighlighted: v,
|
|
4013
4013
|
closeResults: S,
|
|
4014
4014
|
clearSearch: P
|
|
@@ -4169,12 +4169,12 @@ function el(e, t) {
|
|
|
4169
4169
|
libsUrl: e.libsUrl,
|
|
4170
4170
|
mapId: e.mapId,
|
|
4171
4171
|
terrainId: e.terrainId
|
|
4172
|
-
})), { map: c, state: d, initMap: f, setView: g, toggleMapType: b } = Xr(u.value), { loadPoints: y, searchByText: p, updatePoints:
|
|
4172
|
+
})), { map: c, state: d, initMap: f, setView: g, toggleMapType: b } = Xr(u.value), { loadPoints: y, searchByText: p, updatePoints: w, clearPoints: v, searchByShape: S } = fi(c), { drawEntity: P, deleteEntity: T, redrawAllEntities: k } = Pi(c), {
|
|
4173
4173
|
startDrawing: E,
|
|
4174
4174
|
cancelDrawing: I,
|
|
4175
4175
|
clearAllDrawings: B,
|
|
4176
4176
|
removeDrawing: x,
|
|
4177
|
-
setCallback:
|
|
4177
|
+
setCallback: C,
|
|
4178
4178
|
getIsDrawing: L
|
|
4179
4179
|
} = oo(c), { showPointPopup: D, removePopup: j } = Co(c, void 0, { displayConfig: e.popupConfig }), { addWave: U, removeWave: Y } = bo(c), { addWmtsLayer: le, addImageryLayer: re, removeAllLayers: M, setLayerVisible: N } = _o(c), {
|
|
4180
4180
|
contourVisible: V,
|
|
@@ -4248,7 +4248,7 @@ function el(e, t) {
|
|
|
4248
4248
|
}, Kn = () => {
|
|
4249
4249
|
n.currentDrawType.value = null;
|
|
4250
4250
|
}, jn = () => {
|
|
4251
|
-
|
|
4251
|
+
C((R) => {
|
|
4252
4252
|
Kn(), R.operation === "draw" || R.operation === "edit" ? t.emit("draw-end", R) : R.operation === "delete" ? t.emit("draw-delete", R) : R.operation === "clear" && t.emit("draw-clear", R);
|
|
4253
4253
|
});
|
|
4254
4254
|
};
|
|
@@ -4268,7 +4268,7 @@ function el(e, t) {
|
|
|
4268
4268
|
loadPoints: y,
|
|
4269
4269
|
searchByText: p,
|
|
4270
4270
|
searchByShape: S,
|
|
4271
|
-
updatePoints:
|
|
4271
|
+
updatePoints: w,
|
|
4272
4272
|
clearPoints: v,
|
|
4273
4273
|
startDrawing: E,
|
|
4274
4274
|
stopDrawing: I,
|
|
@@ -4802,34 +4802,34 @@ const Ll = /* @__PURE__ */ Z({
|
|
|
4802
4802
|
slots: n
|
|
4803
4803
|
}) {
|
|
4804
4804
|
const r = _(e.input), i = Ie(null), o = Ie(null), a = _({}), l = z(() => e.showSearch);
|
|
4805
|
-
st(() => e.input, (
|
|
4806
|
-
r.value =
|
|
4805
|
+
st(() => e.input, (w) => {
|
|
4806
|
+
r.value = w;
|
|
4807
4807
|
});
|
|
4808
4808
|
const s = () => {
|
|
4809
4809
|
i.value && (a.value = Il(i.value.getBoundingClientRect()));
|
|
4810
|
-
}, u = (
|
|
4811
|
-
r.value =
|
|
4810
|
+
}, u = (w) => {
|
|
4811
|
+
r.value = w, t("search-input", w);
|
|
4812
4812
|
}, c = () => {
|
|
4813
4813
|
r.value = "", t("search-clear", "");
|
|
4814
4814
|
}, d = () => {
|
|
4815
4815
|
t("search-focus", r.value);
|
|
4816
|
-
}, f = (
|
|
4817
|
-
if (
|
|
4818
|
-
|
|
4816
|
+
}, f = (w) => {
|
|
4817
|
+
if (w.key === "Escape") {
|
|
4818
|
+
w.preventDefault(), t("search-close");
|
|
4819
4819
|
return;
|
|
4820
4820
|
}
|
|
4821
|
-
if (
|
|
4822
|
-
|
|
4821
|
+
if (w.key === "ArrowDown") {
|
|
4822
|
+
w.preventDefault(), t("search-navigate", 1);
|
|
4823
4823
|
return;
|
|
4824
4824
|
}
|
|
4825
|
-
if (
|
|
4826
|
-
|
|
4825
|
+
if (w.key === "ArrowUp") {
|
|
4826
|
+
w.preventDefault(), t("search-navigate", -1);
|
|
4827
4827
|
return;
|
|
4828
4828
|
}
|
|
4829
|
-
|
|
4830
|
-
}, g = (
|
|
4829
|
+
w.key === "Enter" && (w.preventDefault(), t("search-select"));
|
|
4830
|
+
}, g = (w) => {
|
|
4831
4831
|
if (!e.showResults) return;
|
|
4832
|
-
const v =
|
|
4832
|
+
const v = w.target;
|
|
4833
4833
|
o.value?.contains(v) || document.querySelector(".search-results-panel")?.contains(v) || document.querySelector(".no-results")?.contains(v) || t("search-close");
|
|
4834
4834
|
};
|
|
4835
4835
|
st(() => [e.showResults, e.filteredList.length], () => {
|
|
@@ -4875,8 +4875,8 @@ const Ll = /* @__PURE__ */ Z({
|
|
|
4875
4875
|
list: e.filteredList,
|
|
4876
4876
|
highlightIndex: e.highlightIndex,
|
|
4877
4877
|
selectedIndex: e.selectedIndex,
|
|
4878
|
-
"onResult-click": (
|
|
4879
|
-
"onResult-hover": (
|
|
4878
|
+
"onResult-click": (w, v) => t("result-click", w, v),
|
|
4879
|
+
"onResult-hover": (w) => t("result-hover", w),
|
|
4880
4880
|
"onResult-leave": () => t("result-leave")
|
|
4881
4881
|
}, null) : null, y.value ? h(Wt, {
|
|
4882
4882
|
class: "teleported",
|
|
@@ -5084,12 +5084,12 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5084
5084
|
detail: ""
|
|
5085
5085
|
}), o = _("--"), a = _("--"), l = Ie(null), s = Ie(null), u = _(!1);
|
|
5086
5086
|
let c = 0, d = 0, f = 0, g = [], b = null, y = null, p = 0;
|
|
5087
|
-
const
|
|
5087
|
+
const w = () => {
|
|
5088
5088
|
d = 0, f = performance.now();
|
|
5089
5089
|
const x = () => {
|
|
5090
5090
|
d += 1;
|
|
5091
|
-
const
|
|
5092
|
-
|
|
5091
|
+
const C = performance.now();
|
|
5092
|
+
C - f >= Al && (n.value = Math.round(d * 1e3 / (C - f)), d = 0, f = C), c = requestAnimationFrame(x);
|
|
5093
5093
|
};
|
|
5094
5094
|
c = requestAnimationFrame(x);
|
|
5095
5095
|
}, v = () => {
|
|
@@ -5099,17 +5099,17 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5099
5099
|
r.value = "--";
|
|
5100
5100
|
return;
|
|
5101
5101
|
}
|
|
5102
|
-
const
|
|
5103
|
-
r.value = `${Kt(
|
|
5102
|
+
const C = x.usedJSHeapSize, L = x.jsHeapSizeLimit;
|
|
5103
|
+
r.value = `${Kt(C)} / ${Kt(L)}`;
|
|
5104
5104
|
} catch {
|
|
5105
5105
|
r.value = "--";
|
|
5106
5106
|
}
|
|
5107
5107
|
}, S = () => {
|
|
5108
5108
|
const x = Ue(e.map);
|
|
5109
5109
|
if (!x) return;
|
|
5110
|
-
const
|
|
5111
|
-
if (!
|
|
5112
|
-
if (!!(
|
|
5110
|
+
const C = A();
|
|
5111
|
+
if (!C) return;
|
|
5112
|
+
if (!!(C.SceneMode && x.scene.mode === C.SceneMode.SCENE2D)) {
|
|
5113
5113
|
i.value = {
|
|
5114
5114
|
text: "2D 视图",
|
|
5115
5115
|
detail: _l[e.mapBase] || e.mapBase
|
|
@@ -5117,7 +5117,7 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5117
5117
|
return;
|
|
5118
5118
|
}
|
|
5119
5119
|
try {
|
|
5120
|
-
const D =
|
|
5120
|
+
const D = C.Cartographic.fromCartesian(x.camera.position);
|
|
5121
5121
|
i.value = {
|
|
5122
5122
|
text: "3D 视图",
|
|
5123
5123
|
detail: `视距 ${kl(D.height)}`
|
|
@@ -5131,13 +5131,13 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5131
5131
|
}, P = (x) => {
|
|
5132
5132
|
y = x, p === 0 && (p = requestAnimationFrame(() => {
|
|
5133
5133
|
p = 0;
|
|
5134
|
-
const
|
|
5135
|
-
if (y = null, !
|
|
5134
|
+
const C = y;
|
|
5135
|
+
if (y = null, !C) return;
|
|
5136
5136
|
const L = Ue(e.map);
|
|
5137
5137
|
if (!L) return;
|
|
5138
5138
|
const D = A();
|
|
5139
5139
|
if (!D) return;
|
|
5140
|
-
const j = L.camera.pickEllipsoid(new D.Cartesian2(
|
|
5140
|
+
const j = L.camera.pickEllipsoid(new D.Cartesian2(C.offsetX, C.offsetY), L.scene.globe.ellipsoid);
|
|
5141
5141
|
if (!j) return;
|
|
5142
5142
|
const U = D.Cartographic.fromCartesian(j);
|
|
5143
5143
|
o.value = D.Math.toDegrees(U.longitude).toFixed(6), a.value = D.Math.toDegrees(U.latitude).toFixed(6);
|
|
@@ -5150,9 +5150,9 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5150
5150
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), k());
|
|
5151
5151
|
};
|
|
5152
5152
|
tn(() => {
|
|
5153
|
-
|
|
5153
|
+
w(), v(), S(), T(), g.push(window.setInterval(v, Ht)), g.push(window.setInterval(S, Ht)), Ue(e.map)?.scene.canvas.addEventListener("mousemove", P), typeof ResizeObserver < "u" && (b = new ResizeObserver(T), s.value && b.observe(s.value), l.value && b.observe(l.value));
|
|
5154
5154
|
}), K(() => {
|
|
5155
|
-
cancelAnimationFrame(c), p !== 0 && cancelAnimationFrame(p), y = null, b?.disconnect(), g.forEach((
|
|
5155
|
+
cancelAnimationFrame(c), p !== 0 && cancelAnimationFrame(p), y = null, b?.disconnect(), g.forEach((C) => window.clearInterval(C)), Ue(e.map)?.scene.canvas.removeEventListener("mousemove", P);
|
|
5156
5156
|
});
|
|
5157
5157
|
const I = () => [h("span", {
|
|
5158
5158
|
class: "map-status__item"
|
|
@@ -5268,7 +5268,7 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5268
5268
|
showStatus: y,
|
|
5269
5269
|
wmtsEnabled: p
|
|
5270
5270
|
} = o, {
|
|
5271
|
-
state:
|
|
5271
|
+
state: w,
|
|
5272
5272
|
showSearch: v,
|
|
5273
5273
|
search: S,
|
|
5274
5274
|
onDelete: P,
|
|
@@ -5278,16 +5278,16 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5278
5278
|
toggleMapBaseLayer: I,
|
|
5279
5279
|
setMapNameVisible: B,
|
|
5280
5280
|
setContourVisible: x,
|
|
5281
|
-
contourVisible:
|
|
5281
|
+
contourVisible: C,
|
|
5282
5282
|
map: L
|
|
5283
5283
|
} = o;
|
|
5284
5284
|
return () => h(nr, null, [h(_n, {
|
|
5285
|
-
visible:
|
|
5285
|
+
visible: w.value.isLoading && !w.value.error,
|
|
5286
5286
|
title: u.value,
|
|
5287
5287
|
subtitle: c.value
|
|
5288
5288
|
}, null), h(Tl, {
|
|
5289
|
-
visible: !!
|
|
5290
|
-
message:
|
|
5289
|
+
visible: !!w.value.error,
|
|
5290
|
+
message: w.value.error?.message,
|
|
5291
5291
|
onRetry: () => t("error-retry")
|
|
5292
5292
|
}, null), h(Pl, {
|
|
5293
5293
|
map: L,
|
|
@@ -5328,7 +5328,7 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5328
5328
|
mapBase: l.value,
|
|
5329
5329
|
currentDrawType: s.value ?? void 0,
|
|
5330
5330
|
mapNameVisible: f.value,
|
|
5331
|
-
contourVisible:
|
|
5331
|
+
contourVisible: C.value,
|
|
5332
5332
|
tools: i.tools,
|
|
5333
5333
|
showBaseSwitch: p.value,
|
|
5334
5334
|
onDelete: P,
|
|
@@ -5336,7 +5336,7 @@ const Pl = /* @__PURE__ */ Z({
|
|
|
5336
5336
|
"onToggle-map-base": I,
|
|
5337
5337
|
"onToggle-map-view": E,
|
|
5338
5338
|
"onToggle-map-name": (D) => B(D),
|
|
5339
|
-
"onToggle-contour": () => x(!
|
|
5339
|
+
"onToggle-contour": () => x(!C.value),
|
|
5340
5340
|
"onStart-drawing": T
|
|
5341
5341
|
}, null) : null, r.default ? r.default() : null]);
|
|
5342
5342
|
}
|