zywlgis 0.5.38 → 0.5.39
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/ZYWLGIS.es.js +84 -45
- package/dist/ZYWLGIS.umd.js +4 -4
- package/dist/libs/Cesium/Cesium-Extend.js +54 -0
- package/package.json +2 -3
- package/dist/libs/Cesium/Cesium-Version.js +0 -124
package/dist/ZYWLGIS.es.js
CHANGED
|
@@ -10946,21 +10946,42 @@ class Gi {
|
|
|
10946
10946
|
isHighlight: this.isHighlight,
|
|
10947
10947
|
customHTML: this.data_?.customHTML
|
|
10948
10948
|
});
|
|
10949
|
-
this.calculatePosition(
|
|
10949
|
+
this.calculatePosition(
|
|
10950
|
+
t.scene,
|
|
10951
|
+
this.HTMLInstance_,
|
|
10952
|
+
this.presentationMode_,
|
|
10953
|
+
this.destination_,
|
|
10954
|
+
this.data_?.customHTML,
|
|
10955
|
+
this.isHighlight
|
|
10956
|
+
), this.addShowHTML({
|
|
10957
|
+
HTMLInstance: this.HTMLInstance_,
|
|
10958
|
+
destination: this.destination_,
|
|
10959
|
+
presentationMode: this.presentationMode_,
|
|
10960
|
+
isHighlight: this.isHighlight,
|
|
10961
|
+
customHTML: this.data_?.customHTML
|
|
10962
|
+
});
|
|
10950
10963
|
}
|
|
10951
|
-
window.CustomHTMLRender || (window.CustomHTMLRender = t.scene.camera.changed.addEventListener(
|
|
10964
|
+
window.CustomHTMLRender || (window.CustomHTMLRender = t.scene.camera.changed.addEventListener(
|
|
10965
|
+
this.postRenderCustomHTML
|
|
10966
|
+
));
|
|
10952
10967
|
};
|
|
10953
10968
|
// 渲染回调方法(帧更新)
|
|
10954
10969
|
postRenderCustomHTML = () => {
|
|
10955
|
-
if (window.
|
|
10956
|
-
|
|
10957
|
-
for (const
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
if (i === 0 || !t || t && t.style.display !== "block")
|
|
10970
|
+
if (window.ShowHTMLInstances_) {
|
|
10971
|
+
const e = k.getMapEngineInstance(this.containerID_).scene;
|
|
10972
|
+
for (const t of [...window.ShowHTMLInstances_]) {
|
|
10973
|
+
const i = t[1].HTMLInstance, r = t[1].presentationMode;
|
|
10974
|
+
if (r === 0 || !i || i && i.style.display !== "block")
|
|
10961
10975
|
continue;
|
|
10962
|
-
const
|
|
10963
|
-
this.calculatePosition(
|
|
10976
|
+
const s = t[1].destination, o = t[1].isHighlight, a = t[1].customHTML;
|
|
10977
|
+
this.calculatePosition(
|
|
10978
|
+
e,
|
|
10979
|
+
i,
|
|
10980
|
+
r,
|
|
10981
|
+
s,
|
|
10982
|
+
a,
|
|
10983
|
+
o
|
|
10984
|
+
);
|
|
10964
10985
|
}
|
|
10965
10986
|
}
|
|
10966
10987
|
};
|
|
@@ -10988,7 +11009,14 @@ class Gi {
|
|
|
10988
11009
|
let A = k.getMapEngineInstance(this.containerID_), e = this.data_.ID + "-ZYWLCustomHTML";
|
|
10989
11010
|
if (window.CustomHTMLInstances_ && window.CustomHTMLInstances_.has(e)) {
|
|
10990
11011
|
let t = window.CustomHTMLInstances_.get(e);
|
|
10991
|
-
t.presentationMode === 2 && (t.HTMLInstance.style.display = "block"), t.isHighlight = !0, this.calculatePosition(
|
|
11012
|
+
t.presentationMode === 2 && (t.HTMLInstance.style.display = "block"), t.isHighlight = !0, this.calculatePosition(
|
|
11013
|
+
A.scene,
|
|
11014
|
+
t.HTMLInstance,
|
|
11015
|
+
t.presentationMode,
|
|
11016
|
+
t.destination,
|
|
11017
|
+
t.customHTML,
|
|
11018
|
+
t.isHighlight
|
|
11019
|
+
), this.addShowHTML(t);
|
|
10992
11020
|
}
|
|
10993
11021
|
};
|
|
10994
11022
|
// 隐藏方法
|
|
@@ -10996,9 +11024,22 @@ class Gi {
|
|
|
10996
11024
|
let A = k.getMapEngineInstance(this.containerID_), e = this.data_.ID + "-ZYWLCustomHTML";
|
|
10997
11025
|
if (window.CustomHTMLInstances_ && window.CustomHTMLInstances_.has(e)) {
|
|
10998
11026
|
let t = window.CustomHTMLInstances_.get(e);
|
|
10999
|
-
t.presentationMode === 2 && (t.HTMLInstance.style.display = "none"), t.isHighlight = !1, this.calculatePosition(
|
|
11027
|
+
t.presentationMode === 2 && (t.HTMLInstance.style.display = "none"), t.isHighlight = !1, this.calculatePosition(
|
|
11028
|
+
A.scene,
|
|
11029
|
+
t.HTMLInstance,
|
|
11030
|
+
t.presentationMode,
|
|
11031
|
+
t.destination,
|
|
11032
|
+
t.customHTML,
|
|
11033
|
+
t.isHighlight
|
|
11034
|
+
), this.removeShowHTML(t);
|
|
11000
11035
|
}
|
|
11001
11036
|
};
|
|
11037
|
+
addShowHTML = (A) => {
|
|
11038
|
+
window.ShowHTMLInstances_ || (window.ShowHTMLInstances_ = /* @__PURE__ */ new Map()), window.ShowHTMLInstances_.has(A.HTMLInstance.id) && window.ShowHTMLInstances_.delete(A.HTMLInstance.id), (A.presentationMode === 1 || A.presentationMode === 2 && A.isHighlight) && window.ShowHTMLInstances_.set(A.HTMLInstance.id, A);
|
|
11039
|
+
};
|
|
11040
|
+
removeShowHTML = (A) => {
|
|
11041
|
+
window.ShowHTMLInstances_ || (window.ShowHTMLInstances_ = /* @__PURE__ */ new Map()), window.ShowHTMLInstances_ && window.ShowHTMLInstances_.has(A.HTMLInstance.id) && window.ShowHTMLInstances_.delete(A.HTMLInstance.id);
|
|
11042
|
+
};
|
|
11002
11043
|
// 销毁方法
|
|
11003
11044
|
clear = () => {
|
|
11004
11045
|
let e = k.getMapEngineInstance(this.containerID_)?.cesiumWidget?.container;
|
|
@@ -133365,24 +133406,27 @@ class k {
|
|
|
133365
133406
|
let i = this.getMapEngineID(A), r = this.getMapEngineInstance(i.openlayersID), s = this.getMapEngineInstance(i.cesiumID);
|
|
133366
133407
|
if (r && s) {
|
|
133367
133408
|
let o, a = r.getView().getResolutionForZoom(e);
|
|
133409
|
+
const l = this.degreesToRadians(t?.latitude);
|
|
133368
133410
|
return o = this.calcDistanceForResolution(
|
|
133369
133411
|
A,
|
|
133370
133412
|
a,
|
|
133371
|
-
|
|
133413
|
+
l
|
|
133372
133414
|
), o;
|
|
133373
133415
|
}
|
|
133374
133416
|
};
|
|
133375
133417
|
static calcDistanceForResolution = (A, e, t) => {
|
|
133376
133418
|
let i = this.getMapEngineID(A), r = this.getMapEngineInstance(i.openlayersID);
|
|
133377
133419
|
const o = this.getMapEngineInstance(i.cesiumID).scene, a = o.camera.frustum, l = o.canvas.clientHeight, D = r.getView().getProjection().getMetersPerUnit(), P = Math.cos(Math.abs(t));
|
|
133378
|
-
let c
|
|
133379
|
-
|
|
133420
|
+
let c;
|
|
133421
|
+
const h = e * D * P * l;
|
|
133422
|
+
let g = 0.7302107096371538;
|
|
133423
|
+
return a instanceof Cesium.PerspectiveFrustum && (g = a.fovy), c = h / 2 / Math.tan(g / 2), c;
|
|
133380
133424
|
};
|
|
133381
133425
|
static calcResolutionForDistance = (A, e, t) => {
|
|
133382
133426
|
let i = this.getMapEngineID(A), r = this.getMapEngineInstance(i.openlayersID);
|
|
133383
|
-
const o = this.getMapEngineInstance(i.cesiumID).scene, a = o.camera.frustum, l = r.getView().getProjection().getMetersPerUnit(),
|
|
133384
|
-
let
|
|
133385
|
-
return a instanceof Cesium.PerspectiveFrustum && (
|
|
133427
|
+
const o = this.getMapEngineInstance(i.cesiumID).scene, a = o.camera.frustum, l = o.canvas.clientHeight, D = r.getView().getProjection().getMetersPerUnit(), P = Math.cos(Math.abs(t));
|
|
133428
|
+
let c, h = 0.7302107096371538;
|
|
133429
|
+
return a instanceof Cesium.PerspectiveFrustum && (h = a.fovy), c = 2 * e * Math.tan(h / 2), c / D / P / l;
|
|
133386
133430
|
};
|
|
133387
133431
|
static calculateZoom = (A, e) => {
|
|
133388
133432
|
let t = e.getView().getZoomForResolution(A);
|
|
@@ -133397,15 +133441,14 @@ class k {
|
|
|
133397
133441
|
a.clientHeight / 2
|
|
133398
133442
|
), D;
|
|
133399
133443
|
if (D = k.getCartesian(s, l), D) {
|
|
133400
|
-
let P = Cesium.Cartesian3.distance(D, o.position), c = s.globe.ellipsoid.cartesianToCartographic(D)
|
|
133401
|
-
|
|
133402
|
-
|
|
133403
|
-
|
|
133404
|
-
|
|
133405
|
-
|
|
133406
|
-
|
|
133407
|
-
);
|
|
133408
|
-
return h < 0 && (h = 0), parseInt(h);
|
|
133444
|
+
let P = Cesium.Cartesian3.distance(D, o.position), c = s.globe.ellipsoid.cartesianToCartographic(D);
|
|
133445
|
+
const h = c ? c.latitude : 0;
|
|
133446
|
+
let g = this.calcResolutionForDistance(
|
|
133447
|
+
A,
|
|
133448
|
+
P,
|
|
133449
|
+
h
|
|
133450
|
+
), u = this.calculateZoom(g, i);
|
|
133451
|
+
return u < 0 && (u = 0), parseInt(u);
|
|
133409
133452
|
}
|
|
133410
133453
|
} else {
|
|
133411
133454
|
if (i)
|
|
@@ -133455,11 +133498,7 @@ class k {
|
|
|
133455
133498
|
let a = Cesium.Cartesian3.distance(
|
|
133456
133499
|
t.scene.camera.position,
|
|
133457
133500
|
i
|
|
133458
|
-
), l = new Cesium.HeadingPitchRange(
|
|
133459
|
-
0,
|
|
133460
|
-
s,
|
|
133461
|
-
a
|
|
133462
|
-
);
|
|
133501
|
+
), l = new Cesium.HeadingPitchRange(0, s, a);
|
|
133463
133502
|
t.scene.camera.lookAt(i, l), t.scene.camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
|
133464
133503
|
} else
|
|
133465
133504
|
t.scene.camera.setView({
|
|
@@ -135449,14 +135488,18 @@ class k {
|
|
|
135449
135488
|
else if (A.includes("-openlayers"))
|
|
135450
135489
|
t && (e ? e === "TakeOffCursor.png" ? t.getTargetElement().style.cursor = `url(${ra.getIconBase64(e)}) 16 21, auto` : t.getTargetElement().style.cursor = e : t.getTargetElement().style.cursor = "");
|
|
135451
135490
|
else if (A.includes("-maptalks"))
|
|
135452
|
-
t && (e ? e === "TakeOffCursor.png" ? t.setCursor(
|
|
135491
|
+
t && (e ? e === "TakeOffCursor.png" ? t.setCursor(
|
|
135492
|
+
`url(${ra.getIconBase64(e)}) 16 21, auto`
|
|
135493
|
+
) : t.setCursor(e) : t.setCursor(""));
|
|
135453
135494
|
else {
|
|
135454
135495
|
let i = this.getMapEngineID(A), r = this.getMapEngineInstance(i.cesiumID);
|
|
135455
135496
|
r && (e ? e === "TakeOffCursor.png" ? r.container.style.cursor = `url(${ra.getIconBase64(e)}) 16 21, auto` : r.container.style.cursor = e : r.container.style.cursor = "", console.log(r.container));
|
|
135456
135497
|
let s = this.getMapEngineInstance(i.openlayersID);
|
|
135457
135498
|
s && (e ? e === "TakeOffCursor.png" ? s.getTargetElement().style.cursor = `url(${ra.getIconBase64(e)}) 16 21, auto` : s.getTargetElement().style.cursor = e : s.getTargetElement().style.cursor = "");
|
|
135458
135499
|
let o = this.getMapEngineInstance(i.maptalksID);
|
|
135459
|
-
o && (e ? e === "TakeOffCursor.png" ? o.setCursor(
|
|
135500
|
+
o && (e ? e === "TakeOffCursor.png" ? o.setCursor(
|
|
135501
|
+
`url(${ra.getIconBase64(e)}) 16 21, auto`
|
|
135502
|
+
) : o.setCursor(e) : o.setCursor(""));
|
|
135460
135503
|
}
|
|
135461
135504
|
};
|
|
135462
135505
|
/**恢复鼠标样式*/
|
|
@@ -166846,7 +166889,7 @@ class fWA {
|
|
|
166846
166889
|
this.data_?.symbol?.pointColor && this.data_?.symbol?.pointColor.length && (i = this.data_?.symbol?.pointColor), i = Cesium.Color.fromCssColorString(i);
|
|
166847
166890
|
const r = this.data_?.symbol?.pixelSize ?? 10;
|
|
166848
166891
|
new Promise((s) => {
|
|
166849
|
-
const o = this.containerID_.split("-cesium")[0], a = k.transformCoordinate(e), l = k.getMapHeightByZoom(o,
|
|
166892
|
+
const o = this.containerID_.split("-cesium")[0], a = k.transformCoordinate(e), l = k.getMapHeightByZoom(o, 20, a), D = k.getMapHeightByZoom(o, 4, a);
|
|
166850
166893
|
s({
|
|
166851
166894
|
nearHeight: l,
|
|
166852
166895
|
farHeight: D
|
|
@@ -193998,7 +194041,7 @@ const zte = (n, A) => {
|
|
|
193998
194041
|
{ type: "css", url: "/libs/Cesium/Widgets/widgets.css" },
|
|
193999
194042
|
// JavaScript资源 - 按依赖顺序加载
|
|
194000
194043
|
{ type: "js", url: "/libs/Cesium/Cesium.js" },
|
|
194001
|
-
{ type: "js", url: "/libs/Cesium/Cesium-
|
|
194044
|
+
{ type: "js", url: "/libs/Cesium/Cesium-Extend.js" },
|
|
194002
194045
|
{ type: "js", url: "/libs/SuperMap3D/SuperMap3D.js" },
|
|
194003
194046
|
{ type: "js", url: "/libs/cpRPA.js" },
|
|
194004
194047
|
{ type: "js", url: "/libs/egm96_mhl.js" }
|
|
@@ -194248,7 +194291,7 @@ const zte = (n, A) => {
|
|
|
194248
194291
|
createCesium(n) {
|
|
194249
194292
|
let A = this.MapConfiguration_Temp?.isAR ?? !1, e = document.getElementById(this.cesiumID);
|
|
194250
194293
|
e || (e = document.createElement("div"), e.id = this.cesiumID, e.tabIndex = "0", e.style.position = "absolute", e.style.height = "100%", e.style.width = "100%", e.style.zIndex = 2, e.style.backgroundColor = "#232323", n && n.appendChild(e));
|
|
194251
|
-
let t = this.MapEngine_Temp?.zoom?.max ??
|
|
194294
|
+
let t = this.MapEngine_Temp?.zoom?.max ?? 20, i = this.MapEngine_Temp?.zoom?.min ?? 1, r = this.MapEngine_Temp?.camera?.pitch ?? -90, s = k.isSupportWebGL2(), o = k.getMapEngineInstance(this.cesiumID);
|
|
194252
194295
|
return o || (o = new Cesium.Viewer(this.cesiumID, {
|
|
194253
194296
|
geocoder: !1,
|
|
194254
194297
|
animation: !1,
|
|
@@ -194341,7 +194384,7 @@ const zte = (n, A) => {
|
|
|
194341
194384
|
if (A.scene.sun.show = !1, A.scene.moon.show = !1, A.scene.skyBox.show = !1, A.scene.logarithmicDepthBuffer = !1, e)
|
|
194342
194385
|
A.scene.skyAtmosphere.show = !1, A.scene.backgroundColor = Cesium.Color.TRANSPARENT, A.scene.globe.translucency.enabled = !0, A.scene.globe.translucency.backFaceAlpha = 0, A.scene.globe.translucency.frontFaceAlpha = 0;
|
|
194343
194386
|
else {
|
|
194344
|
-
this.addMapSlider(A, n), A.imageryLayers.removeAll(), A.scene.postProcessStages.fxaa.enabled = !0, window.devicePixelRatio = 1, A.resolutionScale = window.devicePixelRatio, A.targetFrameRate = 120, A.trackedEntity = void 0, A.scene.globe.maximumScreenSpaceError = 1, A.scene.globe.preloadAncestors = !
|
|
194387
|
+
this.addMapSlider(A, n), A.imageryLayers.removeAll(), A.scene.postProcessStages.fxaa.enabled = !0, window.devicePixelRatio = 1, A.resolutionScale = window.devicePixelRatio, A.targetFrameRate = 120, A.trackedEntity = void 0, A.scene.globe.maximumScreenSpaceError = 1, A.scene.globe.preloadAncestors = !1, A.scene.globe.preloadSiblings = !1, t > 20 && (t = 20);
|
|
194345
194388
|
let r = k.getMapHeightByZoom(
|
|
194346
194389
|
this.containerID,
|
|
194347
194390
|
t,
|
|
@@ -194704,8 +194747,8 @@ const zte = (n, A) => {
|
|
|
194704
194747
|
if (Q) {
|
|
194705
194748
|
w || (w = document.createElement("img"), w.id = `${this.containerID}-MapEngineZoomIn`, n.appendChild(w), w.addEventListener("click", () => {
|
|
194706
194749
|
this.setMapEngineRangingTool(!1);
|
|
194707
|
-
let m = this.loadZoom(), T = this.MapEngine_Temp?.zoom?.max ??
|
|
194708
|
-
T >
|
|
194750
|
+
let m = this.loadZoom(), T = this.MapEngine_Temp?.zoom?.max ?? 20;
|
|
194751
|
+
T > 20 && (T = 20), m < T && (m++, this.syncZoom(m), window.isStartMapModeChange = !0, k.setMapEnginePosition(
|
|
194709
194752
|
this.MapEngine_Temp,
|
|
194710
194753
|
this.loadZoom(),
|
|
194711
194754
|
!0,
|
|
@@ -195728,11 +195771,7 @@ const zte = (n, A) => {
|
|
|
195728
195771
|
if (L && (m = new Cesium.ImageryLayer(L, {
|
|
195729
195772
|
show: u,
|
|
195730
195773
|
splitDirection: E
|
|
195731
|
-
}),
|
|
195732
|
-
console.log("readyEvent", b);
|
|
195733
|
-
}), m.errorEvent.addEventListener((b) => {
|
|
195734
|
-
console.log("errorEvent", b);
|
|
195735
|
-
}), i.imageryLayers.add(m), console.log(m), c)) {
|
|
195774
|
+
}), i.imageryLayers.add(m), c)) {
|
|
195736
195775
|
let b = Cesium.Color.fromCssColorString(
|
|
195737
195776
|
k.setMapColor(c)
|
|
195738
195777
|
);
|