@kenlify/cesium 1.128.25 → 1.128.26
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/Build/Cesium/Cesium.js +12 -12
- package/Build/Cesium/Workers/{chunk-AGGWOPOE.js → chunk-2J5ERDHI.js} +2 -2
- package/Build/Cesium/Workers/{chunk-Y7CU744N.js → chunk-2LYQJKQP.js} +2 -2
- package/Build/Cesium/Workers/{chunk-LL3ISGOT.js → chunk-52QGWEEE.js} +1 -1
- package/Build/Cesium/Workers/{chunk-5VGLE4GN.js → chunk-5L74NDQU.js} +2 -2
- package/Build/Cesium/Workers/{chunk-AM5XL6WI.js → chunk-6BPXJY4T.js} +2 -2
- package/Build/Cesium/Workers/{chunk-5OB72XXB.js → chunk-6CX3HDWX.js} +2 -2
- package/Build/Cesium/Workers/{chunk-MDJWVZDL.js → chunk-6D7EATWI.js} +2 -2
- package/Build/Cesium/Workers/{chunk-KMWS7NMX.js → chunk-6ET3JK7U.js} +2 -2
- package/Build/Cesium/Workers/{chunk-WHZC25DU.js → chunk-6JFWIA2S.js} +2 -2
- package/Build/Cesium/Workers/{chunk-I47DPGZ5.js → chunk-7ZFFNR7K.js} +2 -2
- package/Build/Cesium/Workers/{chunk-6RPF3BFL.js → chunk-BVPVUPIJ.js} +2 -2
- package/Build/Cesium/Workers/{chunk-M3CTXLRO.js → chunk-DXUKDEDM.js} +2 -2
- package/Build/Cesium/Workers/{chunk-3G3X7JDX.js → chunk-EUILNBOS.js} +2 -2
- package/Build/Cesium/Workers/{chunk-XUJ2ELVF.js → chunk-FTC76BZY.js} +2 -2
- package/Build/Cesium/Workers/{chunk-K6GXNVYQ.js → chunk-GHSKJVLY.js} +2 -2
- package/Build/Cesium/Workers/{chunk-FZ7B4QHP.js → chunk-GPCMPV44.js} +1 -1
- package/Build/Cesium/Workers/{chunk-UBHS5Z2W.js → chunk-GRIPLZIM.js} +2 -2
- package/Build/Cesium/Workers/{chunk-YKVE6KMA.js → chunk-GTUSMBQH.js} +2 -2
- package/Build/Cesium/Workers/{chunk-GLSEYMYO.js → chunk-IUB4KRZG.js} +2 -2
- package/Build/Cesium/Workers/{chunk-7D4TZURK.js → chunk-IUQ7DUW2.js} +2 -2
- package/Build/Cesium/Workers/{chunk-KJZ5WB3D.js → chunk-IYXY44PZ.js} +2 -2
- package/Build/Cesium/Workers/{chunk-LGD7Y624.js → chunk-J72L6YLA.js} +2 -2
- package/Build/Cesium/Workers/{chunk-ZA3ZZVAJ.js → chunk-JBW2PYJZ.js} +2 -2
- package/Build/Cesium/Workers/{chunk-IX7QS73W.js → chunk-JJ6HKYJM.js} +2 -2
- package/Build/Cesium/Workers/{chunk-GEBZRAQ6.js → chunk-JMOZLJZI.js} +2 -2
- package/Build/Cesium/Workers/{chunk-IQL776LN.js → chunk-K2KPI7PB.js} +1 -1
- package/Build/Cesium/Workers/{chunk-ON76GPB5.js → chunk-KFTBSPQT.js} +2 -2
- package/Build/Cesium/Workers/{chunk-QKFIGZYW.js → chunk-KTCUOVE3.js} +2 -2
- package/Build/Cesium/Workers/{chunk-UCO5QBZB.js → chunk-KZZQ5SQ4.js} +2 -2
- package/Build/Cesium/Workers/{chunk-AAH3FUIP.js → chunk-L5A4YJO2.js} +2 -2
- package/Build/Cesium/Workers/{chunk-N2TIFVHB.js → chunk-L5H6CDWA.js} +2 -2
- package/Build/Cesium/Workers/{chunk-ZXPMOMHE.js → chunk-LYFUDHA4.js} +2 -2
- package/Build/Cesium/Workers/{chunk-REITUZEF.js → chunk-MFKTFEOS.js} +2 -2
- package/Build/Cesium/Workers/{chunk-LUKDNNLL.js → chunk-NU7ORKBX.js} +1 -1
- package/Build/Cesium/Workers/{chunk-OFTVJOZT.js → chunk-NYR3E6PP.js} +2 -2
- package/Build/Cesium/Workers/{chunk-KWNMBZGF.js → chunk-OP3I3XZO.js} +2 -2
- package/Build/Cesium/Workers/{chunk-ICYFP4HV.js → chunk-P5VSNGMV.js} +2 -2
- package/Build/Cesium/Workers/{chunk-UGIH5SQD.js → chunk-PMWORKYX.js} +2 -2
- package/Build/Cesium/Workers/{chunk-NBQ64UY7.js → chunk-QLPF7IZC.js} +2 -2
- package/Build/Cesium/Workers/{chunk-GO5CEPGN.js → chunk-QQU7HJFC.js} +2 -2
- package/Build/Cesium/Workers/{chunk-D2IU7A6B.js → chunk-QR2NFVAC.js} +2 -2
- package/Build/Cesium/Workers/{chunk-AXFOG5GS.js → chunk-R5FNRB6C.js} +2 -2
- package/Build/Cesium/Workers/{chunk-GOHMOQMK.js → chunk-RDFFKYPD.js} +2 -2
- package/Build/Cesium/Workers/{chunk-YN7B7PBC.js → chunk-S37HRAKR.js} +2 -2
- package/Build/Cesium/Workers/{chunk-Q7B26RKQ.js → chunk-TQNQ2LKP.js} +2 -2
- package/Build/Cesium/Workers/{chunk-2H64EMZE.js → chunk-V22B75EA.js} +2 -2
- package/Build/Cesium/Workers/{chunk-BLAHTZ6R.js → chunk-VORK4UPT.js} +2 -2
- package/Build/Cesium/Workers/{chunk-N2EMCBQ4.js → chunk-XTNTW34V.js} +2 -2
- package/Build/Cesium/Workers/{chunk-BNEAME56.js → chunk-Y4BJC2IM.js} +2 -2
- package/Build/Cesium/Workers/{chunk-356VDAUY.js → chunk-YACQZSMI.js} +2 -2
- package/Build/Cesium/Workers/{chunk-X4SLY5JK.js → chunk-ZAYM6TQA.js} +2 -2
- package/Build/Cesium/Workers/combineGeometry.js +2 -2
- package/Build/Cesium/Workers/createBoxGeometry.js +2 -2
- package/Build/Cesium/Workers/createBoxOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createCircleGeometry.js +2 -2
- package/Build/Cesium/Workers/createCircleOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createCoplanarPolygonGeometry.js +2 -2
- package/Build/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createCorridorGeometry.js +2 -2
- package/Build/Cesium/Workers/createCorridorOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createCylinderGeometry.js +2 -2
- package/Build/Cesium/Workers/createCylinderOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createEllipseGeometry.js +2 -2
- package/Build/Cesium/Workers/createEllipseOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createEllipsoidGeometry.js +2 -2
- package/Build/Cesium/Workers/createEllipsoidOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createFrustumGeometry.js +2 -2
- package/Build/Cesium/Workers/createFrustumOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createGeometry.js +2 -2
- package/Build/Cesium/Workers/createGroundPolylineGeometry.js +2 -2
- package/Build/Cesium/Workers/createPlaneGeometry.js +2 -2
- package/Build/Cesium/Workers/createPlaneOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createPolygonGeometry.js +2 -2
- package/Build/Cesium/Workers/createPolygonOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createPolylineGeometry.js +2 -2
- package/Build/Cesium/Workers/createPolylineVolumeGeometry.js +2 -2
- package/Build/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createRectangleGeometry.js +2 -2
- package/Build/Cesium/Workers/createRectangleOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createSimplePolylineGeometry.js +2 -2
- package/Build/Cesium/Workers/createSphereGeometry.js +2 -2
- package/Build/Cesium/Workers/createSphereOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/createTaskProcessorWorker.js +2 -2
- package/Build/Cesium/Workers/createVectorTileClampedPolylines.js +2 -2
- package/Build/Cesium/Workers/createVectorTileGeometries.js +2 -2
- package/Build/Cesium/Workers/createVectorTilePoints.js +2 -2
- package/Build/Cesium/Workers/createVectorTilePolygons.js +2 -2
- package/Build/Cesium/Workers/createVectorTilePolylines.js +2 -2
- package/Build/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +2 -2
- package/Build/Cesium/Workers/createVerticesFromHeightmap.js +2 -2
- package/Build/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +2 -2
- package/Build/Cesium/Workers/createWallGeometry.js +2 -2
- package/Build/Cesium/Workers/createWallOutlineGeometry.js +2 -2
- package/Build/Cesium/Workers/decodeDraco.js +2 -2
- package/Build/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2 -2
- package/Build/Cesium/Workers/decodeI3S.js +2 -2
- package/Build/Cesium/Workers/transcodeKTX2.js +2 -2
- package/Build/Cesium/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Cesium/Workers/upsampleQuantizedTerrainMesh.js +2 -2
- package/Build/Cesium/index.cjs +12 -12
- package/Build/Cesium/index.js +11 -11
- package/Build/CesiumUnminified/Cesium.js +2241 -2241
- package/Build/CesiumUnminified/Workers/{chunk-OXDQFUTW.js → chunk-2ODKGIOB.js} +13 -13
- package/Build/CesiumUnminified/Workers/{chunk-GI7P7RAI.js → chunk-35T3NFI6.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-RDE3MCQR.js → chunk-372AR3OW.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-IZXMMMLE.js → chunk-4ESFX7SB.js} +1 -1
- package/Build/CesiumUnminified/Workers/{chunk-MLHBYWLB.js → chunk-5G6TCZLM.js} +12 -12
- package/Build/CesiumUnminified/Workers/{chunk-KZN5W2VR.js → chunk-6KKB5BY3.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-L6I5T3EH.js → chunk-7BITXBIH.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-3PDUNW55.js → chunk-A7ZYVNOK.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-ZLFYMFZU.js → chunk-ANGA44LS.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-XV37232G.js → chunk-AYUAVWXO.js} +10 -10
- package/Build/CesiumUnminified/Workers/{chunk-LP2IV6SE.js → chunk-BI3PCCII.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-HMQE5N5A.js → chunk-CUKCSD5O.js} +1 -1
- package/Build/CesiumUnminified/Workers/{chunk-RJYMFWQU.js → chunk-D2SH42HF.js} +8 -8
- package/Build/CesiumUnminified/Workers/{chunk-2LMZYTHF.js → chunk-D5YM2IMF.js} +1 -1
- package/Build/CesiumUnminified/Workers/{chunk-FFR2H54E.js → chunk-D7KV2W7K.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-BE2HBCV4.js → chunk-DWISTTNK.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-ZVMXUUAN.js → chunk-DYCGH2YL.js} +9 -9
- package/Build/CesiumUnminified/Workers/{chunk-YQHTDFTW.js → chunk-E57B2YC2.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-LNPEMF6I.js → chunk-EYR5QNZZ.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-22CWSVHC.js → chunk-F67VLFHB.js} +12 -12
- package/Build/CesiumUnminified/Workers/{chunk-AYI4FBEF.js → chunk-FK562WO2.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-TCQHQYA2.js → chunk-GTXR74RZ.js} +7 -7
- package/Build/CesiumUnminified/Workers/{chunk-5SQAOMDL.js → chunk-GV5REGDI.js} +7 -7
- package/Build/CesiumUnminified/Workers/{chunk-ZADYPEP2.js → chunk-HCS6AB2A.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-6G7I6SMP.js → chunk-HJL6QUXO.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-QBSZA5E6.js → chunk-HYCGN743.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-YNRR2YC6.js → chunk-I6JHIK6C.js} +14 -14
- package/Build/CesiumUnminified/Workers/{chunk-VQSMIBYZ.js → chunk-JVBLPHHU.js} +9 -9
- package/Build/CesiumUnminified/Workers/{chunk-L52UQFUN.js → chunk-JVWR26GG.js} +1 -1
- package/Build/CesiumUnminified/Workers/{chunk-B6D4UUM2.js → chunk-LPJVZZTL.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-2NSH3CSO.js → chunk-LWDPWMUE.js} +5 -5
- package/Build/CesiumUnminified/Workers/{chunk-RV3VM6TU.js → chunk-NIYT5GD2.js} +10 -10
- package/Build/CesiumUnminified/Workers/{chunk-AECLDB5Y.js → chunk-OLRU5MMP.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-ZZ572JJ5.js → chunk-RY6LJY2G.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-OBMT6AYF.js → chunk-RYKL6UCM.js} +8 -8
- package/Build/CesiumUnminified/Workers/{chunk-KJ2XCRWL.js → chunk-S4IQQ2V6.js} +12 -12
- package/Build/CesiumUnminified/Workers/{chunk-AHZFS45R.js → chunk-S5X23VZC.js} +16 -16
- package/Build/CesiumUnminified/Workers/{chunk-KEJICC73.js → chunk-SB5BT26D.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-GV2FKQPB.js → chunk-T6G4I342.js} +12 -12
- package/Build/CesiumUnminified/Workers/{chunk-W6RYUQWA.js → chunk-TSE7QV3R.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-GFJJUNRT.js → chunk-TXQCJMN4.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-HE24W7Y4.js → chunk-UUMNHKS7.js} +9 -9
- package/Build/CesiumUnminified/Workers/{chunk-X7VNU473.js → chunk-VRWD4BAV.js} +11 -11
- package/Build/CesiumUnminified/Workers/{chunk-BWTA6YTS.js → chunk-VVB4KFA2.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-YBHJ6J7Y.js → chunk-WDF75NPX.js} +6 -6
- package/Build/CesiumUnminified/Workers/{chunk-LHHCXZNC.js → chunk-XAWO6CUN.js} +16 -16
- package/Build/CesiumUnminified/Workers/{chunk-OWLXLO6R.js → chunk-Y3JM4NZF.js} +7 -7
- package/Build/CesiumUnminified/Workers/{chunk-5VNVGW2Q.js → chunk-YVFINNJQ.js} +3 -3
- package/Build/CesiumUnminified/Workers/{chunk-F5ALEMWT.js → chunk-ZLFLV7X5.js} +2 -2
- package/Build/CesiumUnminified/Workers/{chunk-XAIR7ZUH.js → chunk-ZSS22J7V.js} +4 -4
- package/Build/CesiumUnminified/Workers/{chunk-RVM7YQ46.js → chunk-ZY7JWTLG.js} +4 -4
- package/Build/CesiumUnminified/Workers/combineGeometry.js +21 -21
- package/Build/CesiumUnminified/Workers/createBoxGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createBoxOutlineGeometry.js +13 -13
- package/Build/CesiumUnminified/Workers/createCircleGeometry.js +23 -23
- package/Build/CesiumUnminified/Workers/createCircleOutlineGeometry.js +16 -16
- package/Build/CesiumUnminified/Workers/createCoplanarPolygonGeometry.js +30 -30
- package/Build/CesiumUnminified/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
- package/Build/CesiumUnminified/Workers/createCorridorGeometry.js +26 -26
- package/Build/CesiumUnminified/Workers/createCorridorOutlineGeometry.js +25 -25
- package/Build/CesiumUnminified/Workers/createCylinderGeometry.js +17 -17
- package/Build/CesiumUnminified/Workers/createCylinderOutlineGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createEllipseGeometry.js +23 -23
- package/Build/CesiumUnminified/Workers/createEllipseOutlineGeometry.js +16 -16
- package/Build/CesiumUnminified/Workers/createEllipsoidGeometry.js +16 -16
- package/Build/CesiumUnminified/Workers/createEllipsoidOutlineGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createFrustumGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createFrustumOutlineGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createGeometry.js +21 -21
- package/Build/CesiumUnminified/Workers/createGroundPolylineGeometry.js +19 -19
- package/Build/CesiumUnminified/Workers/createPlaneGeometry.js +13 -13
- package/Build/CesiumUnminified/Workers/createPlaneOutlineGeometry.js +12 -12
- package/Build/CesiumUnminified/Workers/createPolygonGeometry.js +29 -29
- package/Build/CesiumUnminified/Workers/createPolygonOutlineGeometry.js +27 -27
- package/Build/CesiumUnminified/Workers/createPolylineGeometry.js +22 -22
- package/Build/CesiumUnminified/Workers/createPolylineVolumeGeometry.js +28 -28
- package/Build/CesiumUnminified/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
- package/Build/CesiumUnminified/Workers/createRectangleGeometry.js +24 -24
- package/Build/CesiumUnminified/Workers/createRectangleOutlineGeometry.js +17 -17
- package/Build/CesiumUnminified/Workers/createSimplePolylineGeometry.js +20 -20
- package/Build/CesiumUnminified/Workers/createSphereGeometry.js +16 -16
- package/Build/CesiumUnminified/Workers/createSphereOutlineGeometry.js +15 -15
- package/Build/CesiumUnminified/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/CesiumUnminified/Workers/createVectorTileClampedPolylines.js +12 -12
- package/Build/CesiumUnminified/Workers/createVectorTileGeometries.js +21 -21
- package/Build/CesiumUnminified/Workers/createVectorTilePoints.js +11 -11
- package/Build/CesiumUnminified/Workers/createVectorTilePolygons.js +19 -19
- package/Build/CesiumUnminified/Workers/createVectorTilePolylines.js +12 -12
- package/Build/CesiumUnminified/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
- package/Build/CesiumUnminified/Workers/createVerticesFromHeightmap.js +19 -19
- package/Build/CesiumUnminified/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
- package/Build/CesiumUnminified/Workers/createWallGeometry.js +21 -21
- package/Build/CesiumUnminified/Workers/createWallOutlineGeometry.js +20 -20
- package/Build/CesiumUnminified/Workers/decodeDraco.js +10 -10
- package/Build/CesiumUnminified/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/CesiumUnminified/Workers/decodeI3S.js +9 -9
- package/Build/CesiumUnminified/Workers/transcodeKTX2.js +6 -6
- package/Build/CesiumUnminified/Workers/transferTypedArrayTest.js +1 -1
- package/Build/CesiumUnminified/Workers/upsampleQuantizedTerrainMesh.js +19 -19
- package/Build/CesiumUnminified/index.cjs +2214 -2214
- package/Build/CesiumUnminified/index.js +2214 -2214
- package/Source/Cesium.js +91 -91
- package/package.json +1 -1
- package/patches/engine/Source/Core/taskProcessor.patch.js +14 -14
- package/patches/engine/Source/Core/tileAvailability.patch.js +8 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
4
|
-
* Version 1.128.
|
|
4
|
+
* Version 1.128.26
|
|
5
5
|
*
|
|
6
6
|
* Copyright 2011-2022 Cesium Contributors
|
|
7
7
|
*
|
|
@@ -27798,9 +27798,9 @@ ${translation3}`
|
|
|
27798
27798
|
function defaultValue(value, defaultValue3) {
|
|
27799
27799
|
return value !== void 0 ? value : defaultValue3;
|
|
27800
27800
|
}
|
|
27801
|
-
function
|
|
27801
|
+
function canTransferArrayBufferPatched() {
|
|
27802
27802
|
if (!defined_default(TaskProcessor_default._canTransferArrayBuffer)) {
|
|
27803
|
-
const worker =
|
|
27803
|
+
const worker = createWorkerPatched("transferTypedArrayTest");
|
|
27804
27804
|
worker.postMessage = defaultValue(worker.webkitPostMessage, worker.postMessage);
|
|
27805
27805
|
const value = 99;
|
|
27806
27806
|
const array = new Int8Array([value]);
|
|
@@ -27828,7 +27828,7 @@ ${translation3}`
|
|
|
27828
27828
|
return TaskProcessor_default._canTransferArrayBuffer;
|
|
27829
27829
|
}
|
|
27830
27830
|
var taskCompletedEvent = new Event_default();
|
|
27831
|
-
function
|
|
27831
|
+
function urlFromScriptPatched(script) {
|
|
27832
27832
|
let blob;
|
|
27833
27833
|
try {
|
|
27834
27834
|
blob = new Blob([script], {
|
|
@@ -27843,7 +27843,7 @@ ${translation3}`
|
|
|
27843
27843
|
const URL2 = window.URL || window.webkitURL;
|
|
27844
27844
|
return URL2.createObjectURL(blob);
|
|
27845
27845
|
}
|
|
27846
|
-
function
|
|
27846
|
+
function createWorkerPatched(url2) {
|
|
27847
27847
|
const uri = new import_urijs7.default(url2);
|
|
27848
27848
|
const isUri = uri.scheme().length !== 0 && uri.fragment().length === 0;
|
|
27849
27849
|
const moduleID = url2.replace(/\.js$/, "");
|
|
@@ -27860,16 +27860,16 @@ ${translation3}`
|
|
|
27860
27860
|
}
|
|
27861
27861
|
if (crossOriginUrl) {
|
|
27862
27862
|
const script = `import "${crossOriginUrl}";`;
|
|
27863
|
-
workerPath =
|
|
27863
|
+
workerPath = urlFromScriptPatched(script);
|
|
27864
27864
|
options.type = "module";
|
|
27865
27865
|
return new Worker(workerPath, options);
|
|
27866
27866
|
}
|
|
27867
27867
|
if (!isUri && typeof CESIUM_WORKERS !== "undefined") {
|
|
27868
27868
|
const script = `
|
|
27869
|
-
importScripts("${
|
|
27869
|
+
importScripts("${urlFromScriptPatched(CESIUM_WORKERS)}");
|
|
27870
27870
|
CesiumWorkers["${moduleID}"]();
|
|
27871
27871
|
`;
|
|
27872
|
-
workerPath =
|
|
27872
|
+
workerPath = urlFromScriptPatched(script);
|
|
27873
27873
|
return new Worker(workerPath, options);
|
|
27874
27874
|
}
|
|
27875
27875
|
workerPath = url2;
|
|
@@ -27910,8 +27910,8 @@ ${translation3}`
|
|
|
27910
27910
|
return listener;
|
|
27911
27911
|
};
|
|
27912
27912
|
var emptyTransferableObjectArray = [];
|
|
27913
|
-
async function
|
|
27914
|
-
const canTransfer = await Promise.resolve(
|
|
27913
|
+
async function runTaskPatched(processor, parameters, transferableObjects) {
|
|
27914
|
+
const canTransfer = await Promise.resolve(canTransferArrayBufferPatched());
|
|
27915
27915
|
if (!defined_default(transferableObjects)) {
|
|
27916
27916
|
transferableObjects = emptyTransferableObjectArray;
|
|
27917
27917
|
} else if (!canTransfer) {
|
|
@@ -27946,10 +27946,10 @@ ${translation3}`
|
|
|
27946
27946
|
}
|
|
27947
27947
|
return promise;
|
|
27948
27948
|
}
|
|
27949
|
-
async function
|
|
27949
|
+
async function scheduleTaskPatched(processor, parameters, transferableObjects) {
|
|
27950
27950
|
++processor._activeTasks;
|
|
27951
27951
|
try {
|
|
27952
|
-
const result = await
|
|
27952
|
+
const result = await runTaskPatched(processor, parameters, transferableObjects);
|
|
27953
27953
|
--processor._activeTasks;
|
|
27954
27954
|
return result;
|
|
27955
27955
|
} catch (error) {
|
|
@@ -27959,12 +27959,12 @@ ${translation3}`
|
|
|
27959
27959
|
}
|
|
27960
27960
|
TaskProcessor_default.prototype.scheduleTask = function(parameters, transferableObjects) {
|
|
27961
27961
|
if (!defined_default(this._worker)) {
|
|
27962
|
-
this._worker =
|
|
27962
|
+
this._worker = createWorkerPatched(this._workerPath);
|
|
27963
27963
|
}
|
|
27964
27964
|
if (this._activeTasks >= this._maximumActiveTasks) {
|
|
27965
27965
|
return void 0;
|
|
27966
27966
|
}
|
|
27967
|
-
return
|
|
27967
|
+
return scheduleTaskPatched(this, parameters, transferableObjects);
|
|
27968
27968
|
};
|
|
27969
27969
|
TaskProcessor_default.taskCompletedEvent = taskCompletedEvent;
|
|
27970
27970
|
TaskProcessor_default._defaultWorkerModulePrefix = "Workers/";
|
|
@@ -27972,9 +27972,9 @@ ${translation3}`
|
|
|
27972
27972
|
TaskProcessor_default._canTransferArrayBuffer = void 0;
|
|
27973
27973
|
|
|
27974
27974
|
// packages/engine/Source/Core/TaskProcessor.js
|
|
27975
|
-
function
|
|
27975
|
+
function canTransferArrayBuffer() {
|
|
27976
27976
|
if (!defined_default(TaskProcessor._canTransferArrayBuffer)) {
|
|
27977
|
-
const worker =
|
|
27977
|
+
const worker = createWorker("transferTypedArrayTest");
|
|
27978
27978
|
worker.postMessage = worker.webkitPostMessage ?? worker.postMessage;
|
|
27979
27979
|
const value = 99;
|
|
27980
27980
|
const array = new Int8Array([value]);
|
|
@@ -28002,7 +28002,7 @@ ${translation3}`
|
|
|
28002
28002
|
return TaskProcessor._canTransferArrayBuffer;
|
|
28003
28003
|
}
|
|
28004
28004
|
var taskCompletedEvent2 = new Event_default();
|
|
28005
|
-
function
|
|
28005
|
+
function urlFromScript(script) {
|
|
28006
28006
|
let blob;
|
|
28007
28007
|
try {
|
|
28008
28008
|
blob = new Blob([script], {
|
|
@@ -28017,7 +28017,7 @@ ${translation3}`
|
|
|
28017
28017
|
const URL2 = window.URL || window.webkitURL;
|
|
28018
28018
|
return URL2.createObjectURL(blob);
|
|
28019
28019
|
}
|
|
28020
|
-
function
|
|
28020
|
+
function createWorker(url2) {
|
|
28021
28021
|
const uri = new import_urijs8.default(url2);
|
|
28022
28022
|
const isUri = uri.scheme().length !== 0 && uri.fragment().length === 0;
|
|
28023
28023
|
const moduleID = url2.replace(/\.js$/, "");
|
|
@@ -28036,16 +28036,16 @@ ${translation3}`
|
|
|
28036
28036
|
}
|
|
28037
28037
|
if (crossOriginUrl) {
|
|
28038
28038
|
const script = `import "${crossOriginUrl}";`;
|
|
28039
|
-
workerPath =
|
|
28039
|
+
workerPath = urlFromScript(script);
|
|
28040
28040
|
options.type = "module";
|
|
28041
28041
|
return new Worker(workerPath, options);
|
|
28042
28042
|
}
|
|
28043
28043
|
if (!isUri && typeof CESIUM_WORKERS !== "undefined") {
|
|
28044
28044
|
const script = `
|
|
28045
|
-
importScripts("${
|
|
28045
|
+
importScripts("${urlFromScript(CESIUM_WORKERS)}");
|
|
28046
28046
|
CesiumWorkers["${moduleID}"]();
|
|
28047
28047
|
`;
|
|
28048
|
-
workerPath =
|
|
28048
|
+
workerPath = urlFromScript(script);
|
|
28049
28049
|
return new Worker(workerPath, options);
|
|
28050
28050
|
}
|
|
28051
28051
|
workerPath = url2;
|
|
@@ -28119,8 +28119,8 @@ ${translation3}`
|
|
|
28119
28119
|
return listener;
|
|
28120
28120
|
};
|
|
28121
28121
|
var emptyTransferableObjectArray2 = [];
|
|
28122
|
-
async function
|
|
28123
|
-
const canTransfer = await Promise.resolve(
|
|
28122
|
+
async function runTask(processor, parameters, transferableObjects) {
|
|
28123
|
+
const canTransfer = await Promise.resolve(canTransferArrayBuffer());
|
|
28124
28124
|
if (!defined_default(transferableObjects)) {
|
|
28125
28125
|
transferableObjects = emptyTransferableObjectArray2;
|
|
28126
28126
|
} else if (!canTransfer) {
|
|
@@ -28144,10 +28144,10 @@ ${translation3}`
|
|
|
28144
28144
|
);
|
|
28145
28145
|
return promise;
|
|
28146
28146
|
}
|
|
28147
|
-
async function
|
|
28147
|
+
async function scheduleTask(processor, parameters, transferableObjects) {
|
|
28148
28148
|
++processor._activeTasks;
|
|
28149
28149
|
try {
|
|
28150
|
-
const result = await
|
|
28150
|
+
const result = await runTask(processor, parameters, transferableObjects);
|
|
28151
28151
|
--processor._activeTasks;
|
|
28152
28152
|
return result;
|
|
28153
28153
|
} catch (error) {
|
|
@@ -28157,24 +28157,24 @@ ${translation3}`
|
|
|
28157
28157
|
}
|
|
28158
28158
|
TaskProcessor.prototype.scheduleTask = function(parameters, transferableObjects) {
|
|
28159
28159
|
if (!defined_default(this._worker)) {
|
|
28160
|
-
this._worker =
|
|
28160
|
+
this._worker = createWorker(this._workerPath);
|
|
28161
28161
|
}
|
|
28162
28162
|
if (this._activeTasks >= this._maximumActiveTasks) {
|
|
28163
28163
|
return void 0;
|
|
28164
28164
|
}
|
|
28165
|
-
return
|
|
28165
|
+
return scheduleTask(this, parameters, transferableObjects);
|
|
28166
28166
|
};
|
|
28167
28167
|
TaskProcessor.prototype.initWebAssemblyModule = async function(webAssemblyOptions) {
|
|
28168
28168
|
if (defined_default(this._webAssemblyPromise)) {
|
|
28169
28169
|
return this._webAssemblyPromise;
|
|
28170
28170
|
}
|
|
28171
28171
|
const init = async () => {
|
|
28172
|
-
const worker = this._worker =
|
|
28172
|
+
const worker = this._worker = createWorker(this._workerPath);
|
|
28173
28173
|
const wasmConfig = await getWebAssemblyLoaderConfig(
|
|
28174
28174
|
this,
|
|
28175
28175
|
webAssemblyOptions
|
|
28176
28176
|
);
|
|
28177
|
-
const canTransfer = await Promise.resolve(
|
|
28177
|
+
const canTransfer = await Promise.resolve(canTransferArrayBuffer());
|
|
28178
28178
|
let transferableObjects;
|
|
28179
28179
|
const binary = wasmConfig.wasmBinary;
|
|
28180
28180
|
if (defined_default(binary) && canTransfer) {
|
|
@@ -74880,7 +74880,7 @@ ${runtimeError.stack}`;
|
|
|
74880
74880
|
};
|
|
74881
74881
|
var workers2 = [];
|
|
74882
74882
|
var requestId = 0;
|
|
74883
|
-
function
|
|
74883
|
+
function createWorker2(url2) {
|
|
74884
74884
|
var worker = {
|
|
74885
74885
|
object: new Worker(url2),
|
|
74886
74886
|
pending: 0,
|
|
@@ -74899,7 +74899,7 @@ ${runtimeError.stack}`;
|
|
|
74899
74899
|
var blob = new Blob([source], { type: "text/javascript" });
|
|
74900
74900
|
var url2 = URL.createObjectURL(blob);
|
|
74901
74901
|
for (var i = workers2.length; i < count; ++i) {
|
|
74902
|
-
workers2[i] =
|
|
74902
|
+
workers2[i] = createWorker2(url2);
|
|
74903
74903
|
}
|
|
74904
74904
|
for (var i = count; i < workers2.length; ++i) {
|
|
74905
74905
|
workers2[i].object.postMessage({});
|
|
@@ -227342,7 +227342,7 @@ void main() {
|
|
|
227342
227342
|
function rectangleContainsPosition(potentialContainer, positionToTest) {
|
|
227343
227343
|
return positionToTest.longitude >= potentialContainer.west && positionToTest.longitude <= potentialContainer.east && positionToTest.latitude >= potentialContainer.south && positionToTest.latitude <= potentialContainer.north;
|
|
227344
227344
|
}
|
|
227345
|
-
function
|
|
227345
|
+
function findMaxLevelFromNodePatched(stopNode, node, position) {
|
|
227346
227346
|
let maxLevel = 0;
|
|
227347
227347
|
let found = false;
|
|
227348
227348
|
while (!found) {
|
|
@@ -227352,16 +227352,16 @@ void main() {
|
|
|
227352
227352
|
const se = node._se && rectangleContainsPosition(node._se.extent, position);
|
|
227353
227353
|
if (Number(nw) + Number(ne) + Number(sw) + Number(se) > 1) {
|
|
227354
227354
|
if (nw) {
|
|
227355
|
-
maxLevel = Math.max(maxLevel,
|
|
227355
|
+
maxLevel = Math.max(maxLevel, findMaxLevelFromNodePatched(node, node._nw, position));
|
|
227356
227356
|
}
|
|
227357
227357
|
if (ne) {
|
|
227358
|
-
maxLevel = Math.max(maxLevel,
|
|
227358
|
+
maxLevel = Math.max(maxLevel, findMaxLevelFromNodePatched(node, node._ne, position));
|
|
227359
227359
|
}
|
|
227360
227360
|
if (sw) {
|
|
227361
|
-
maxLevel = Math.max(maxLevel,
|
|
227361
|
+
maxLevel = Math.max(maxLevel, findMaxLevelFromNodePatched(node, node._sw, position));
|
|
227362
227362
|
}
|
|
227363
227363
|
if (se) {
|
|
227364
|
-
maxLevel = Math.max(maxLevel,
|
|
227364
|
+
maxLevel = Math.max(maxLevel, findMaxLevelFromNodePatched(node, node._se, position));
|
|
227365
227365
|
}
|
|
227366
227366
|
break;
|
|
227367
227367
|
} else if (nw) {
|
|
@@ -227399,7 +227399,7 @@ void main() {
|
|
|
227399
227399
|
if (!defined_default(node)) {
|
|
227400
227400
|
return -1;
|
|
227401
227401
|
}
|
|
227402
|
-
return
|
|
227402
|
+
return findMaxLevelFromNodePatched(void 0, node, position);
|
|
227403
227403
|
};
|
|
227404
227404
|
|
|
227405
227405
|
// packages/engine/Source/Core/TileAvailability.js
|
|
@@ -227463,7 +227463,7 @@ void main() {
|
|
|
227463
227463
|
if (!defined_default(node)) {
|
|
227464
227464
|
return -1;
|
|
227465
227465
|
}
|
|
227466
|
-
return
|
|
227466
|
+
return findMaxLevelFromNode(void 0, node, position);
|
|
227467
227467
|
};
|
|
227468
227468
|
var rectanglesScratch = [];
|
|
227469
227469
|
var remainingToCoverByLevelScratch = [];
|
|
@@ -227656,7 +227656,7 @@ void main() {
|
|
|
227656
227656
|
function rectangleContainsPosition2(potentialContainer, positionToTest) {
|
|
227657
227657
|
return positionToTest.longitude >= potentialContainer.west && positionToTest.longitude <= potentialContainer.east && positionToTest.latitude >= potentialContainer.south && positionToTest.latitude <= potentialContainer.north;
|
|
227658
227658
|
}
|
|
227659
|
-
function
|
|
227659
|
+
function findMaxLevelFromNode(stopNode, node, position) {
|
|
227660
227660
|
let maxLevel = 0;
|
|
227661
227661
|
let found = false;
|
|
227662
227662
|
while (!found) {
|
|
@@ -227668,25 +227668,25 @@ void main() {
|
|
|
227668
227668
|
if (nw) {
|
|
227669
227669
|
maxLevel = Math.max(
|
|
227670
227670
|
maxLevel,
|
|
227671
|
-
|
|
227671
|
+
findMaxLevelFromNode(node, node._nw, position)
|
|
227672
227672
|
);
|
|
227673
227673
|
}
|
|
227674
227674
|
if (ne) {
|
|
227675
227675
|
maxLevel = Math.max(
|
|
227676
227676
|
maxLevel,
|
|
227677
|
-
|
|
227677
|
+
findMaxLevelFromNode(node, node._ne, position)
|
|
227678
227678
|
);
|
|
227679
227679
|
}
|
|
227680
227680
|
if (sw) {
|
|
227681
227681
|
maxLevel = Math.max(
|
|
227682
227682
|
maxLevel,
|
|
227683
|
-
|
|
227683
|
+
findMaxLevelFromNode(node, node._sw, position)
|
|
227684
227684
|
);
|
|
227685
227685
|
}
|
|
227686
227686
|
if (se) {
|
|
227687
227687
|
maxLevel = Math.max(
|
|
227688
227688
|
maxLevel,
|
|
227689
|
-
|
|
227689
|
+
findMaxLevelFromNode(node, node._se, position)
|
|
227690
227690
|
);
|
|
227691
227691
|
}
|
|
227692
227692
|
break;
|
|
@@ -243812,7 +243812,7 @@ out_FragColor = getColor();
|
|
|
243812
243812
|
var createTaskProcessorWorker_default = createTaskProcessorWorker;
|
|
243813
243813
|
|
|
243814
243814
|
// packages/engine/index.js
|
|
243815
|
-
globalThis.CESIUM_VERSION = "1.128.
|
|
243815
|
+
globalThis.CESIUM_VERSION = "1.128.26";
|
|
243816
243816
|
|
|
243817
243817
|
// packages/widgets/index.js
|
|
243818
243818
|
var import_InlineWorkers1330 = __toESM(require_InlineWorkers(), 1);
|
|
@@ -249485,948 +249485,11 @@ ${terrainTip}`;
|
|
|
249485
249485
|
}
|
|
249486
249486
|
var createDefaultTerrainProviderViewModels_default = createDefaultTerrainProviderViewModels;
|
|
249487
249487
|
|
|
249488
|
-
// packages/widgets/Source/CesiumInspector/CesiumInspector.js
|
|
249489
|
-
var import_InlineWorkers1294 = __toESM(require_InlineWorkers(), 1);
|
|
249490
|
-
|
|
249491
|
-
// packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js
|
|
249492
|
-
var import_InlineWorkers1293 = __toESM(require_InlineWorkers(), 1);
|
|
249493
|
-
function frustumStatisticsToString(statistics2) {
|
|
249494
|
-
let str;
|
|
249495
|
-
if (defined_default(statistics2)) {
|
|
249496
|
-
str = "Command Statistics";
|
|
249497
|
-
const com = statistics2.commandsInFrustums;
|
|
249498
|
-
for (const n in com) {
|
|
249499
|
-
if (com.hasOwnProperty(n)) {
|
|
249500
|
-
let num = parseInt(n, 10);
|
|
249501
|
-
let s;
|
|
249502
|
-
if (num === 7) {
|
|
249503
|
-
s = "1, 2 and 3";
|
|
249504
|
-
} else {
|
|
249505
|
-
const f = [];
|
|
249506
|
-
for (let i = 2; i >= 0; i--) {
|
|
249507
|
-
const p = Math.pow(2, i);
|
|
249508
|
-
if (num >= p) {
|
|
249509
|
-
f.push(i + 1);
|
|
249510
|
-
num -= p;
|
|
249511
|
-
}
|
|
249512
|
-
}
|
|
249513
|
-
s = f.reverse().join(" and ");
|
|
249514
|
-
}
|
|
249515
|
-
str += `<br> ${com[n]} in frustum ${s}`;
|
|
249516
|
-
}
|
|
249517
|
-
}
|
|
249518
|
-
str += `<br>Total: ${statistics2.totalCommands}`;
|
|
249519
|
-
}
|
|
249520
|
-
return str;
|
|
249521
|
-
}
|
|
249522
|
-
function boundDepthFrustum(lower, upper, proposed) {
|
|
249523
|
-
let bounded = Math.min(proposed, upper);
|
|
249524
|
-
bounded = Math.max(bounded, lower);
|
|
249525
|
-
return bounded;
|
|
249526
|
-
}
|
|
249527
|
-
var scratchPickRay2 = new Ray_default();
|
|
249528
|
-
var scratchPickCartesian3 = new Cartesian3_default();
|
|
249529
|
-
function CesiumInspectorViewModel(scene, performanceContainer) {
|
|
249530
|
-
if (!defined_default(scene)) {
|
|
249531
|
-
throw new DeveloperError_default("scene is required");
|
|
249532
|
-
}
|
|
249533
|
-
if (!defined_default(performanceContainer)) {
|
|
249534
|
-
throw new DeveloperError_default("performanceContainer is required");
|
|
249535
|
-
}
|
|
249536
|
-
const that = this;
|
|
249537
|
-
const canvas = scene.canvas;
|
|
249538
|
-
const eventHandler = new ScreenSpaceEventHandler_default(canvas);
|
|
249539
|
-
this._eventHandler = eventHandler;
|
|
249540
|
-
this._scene = scene;
|
|
249541
|
-
this._canvas = canvas;
|
|
249542
|
-
this._primitive = void 0;
|
|
249543
|
-
this._tile = void 0;
|
|
249544
|
-
this._modelMatrixPrimitive = void 0;
|
|
249545
|
-
this._performanceDisplay = void 0;
|
|
249546
|
-
this._performanceContainer = performanceContainer;
|
|
249547
|
-
const globe = this._scene.globe;
|
|
249548
|
-
globe.depthTestAgainstTerrain = true;
|
|
249549
|
-
this.frustums = false;
|
|
249550
|
-
this.frustumPlanes = false;
|
|
249551
|
-
this.performance = false;
|
|
249552
|
-
this.shaderCacheText = "";
|
|
249553
|
-
this.primitiveBoundingSphere = false;
|
|
249554
|
-
this.primitiveReferenceFrame = false;
|
|
249555
|
-
this.filterPrimitive = false;
|
|
249556
|
-
this.tileBoundingSphere = false;
|
|
249557
|
-
this.filterTile = false;
|
|
249558
|
-
this.wireframe = false;
|
|
249559
|
-
this.depthFrustum = 1;
|
|
249560
|
-
this._numberOfFrustums = 1;
|
|
249561
|
-
this.suspendUpdates = false;
|
|
249562
|
-
this.tileCoordinates = false;
|
|
249563
|
-
this.frustumStatisticText = false;
|
|
249564
|
-
this.tileText = "";
|
|
249565
|
-
this.hasPickedPrimitive = false;
|
|
249566
|
-
this.hasPickedTile = false;
|
|
249567
|
-
this.pickPrimitiveActive = false;
|
|
249568
|
-
this.pickTileActive = false;
|
|
249569
|
-
this.dropDownVisible = true;
|
|
249570
|
-
this.generalVisible = true;
|
|
249571
|
-
this.primitivesVisible = false;
|
|
249572
|
-
this.terrainVisible = false;
|
|
249573
|
-
this.depthFrustumText = "";
|
|
249574
|
-
knockout_default.track(this, [
|
|
249575
|
-
"frustums",
|
|
249576
|
-
"frustumPlanes",
|
|
249577
|
-
"performance",
|
|
249578
|
-
"shaderCacheText",
|
|
249579
|
-
"primitiveBoundingSphere",
|
|
249580
|
-
"primitiveReferenceFrame",
|
|
249581
|
-
"filterPrimitive",
|
|
249582
|
-
"tileBoundingSphere",
|
|
249583
|
-
"filterTile",
|
|
249584
|
-
"wireframe",
|
|
249585
|
-
"depthFrustum",
|
|
249586
|
-
"suspendUpdates",
|
|
249587
|
-
"tileCoordinates",
|
|
249588
|
-
"frustumStatisticText",
|
|
249589
|
-
"tileText",
|
|
249590
|
-
"hasPickedPrimitive",
|
|
249591
|
-
"hasPickedTile",
|
|
249592
|
-
"pickPrimitiveActive",
|
|
249593
|
-
"pickTileActive",
|
|
249594
|
-
"dropDownVisible",
|
|
249595
|
-
"generalVisible",
|
|
249596
|
-
"primitivesVisible",
|
|
249597
|
-
"terrainVisible",
|
|
249598
|
-
"depthFrustumText"
|
|
249599
|
-
]);
|
|
249600
|
-
this._toggleDropDown = createCommand_default(function() {
|
|
249601
|
-
that.dropDownVisible = !that.dropDownVisible;
|
|
249602
|
-
});
|
|
249603
|
-
this._toggleGeneral = createCommand_default(function() {
|
|
249604
|
-
that.generalVisible = !that.generalVisible;
|
|
249605
|
-
});
|
|
249606
|
-
this._togglePrimitives = createCommand_default(function() {
|
|
249607
|
-
that.primitivesVisible = !that.primitivesVisible;
|
|
249608
|
-
});
|
|
249609
|
-
this._toggleTerrain = createCommand_default(function() {
|
|
249610
|
-
that.terrainVisible = !that.terrainVisible;
|
|
249611
|
-
});
|
|
249612
|
-
this._frustumsSubscription = knockout_default.getObservable(this, "frustums").subscribe(function(val) {
|
|
249613
|
-
that._scene.debugShowFrustums = val;
|
|
249614
|
-
that._scene.requestRender();
|
|
249615
|
-
});
|
|
249616
|
-
this._frustumPlanesSubscription = knockout_default.getObservable(this, "frustumPlanes").subscribe(function(val) {
|
|
249617
|
-
that._scene.debugShowFrustumPlanes = val;
|
|
249618
|
-
that._scene.requestRender();
|
|
249619
|
-
});
|
|
249620
|
-
this._performanceSubscription = knockout_default.getObservable(this, "performance").subscribe(function(val) {
|
|
249621
|
-
if (val) {
|
|
249622
|
-
that._performanceDisplay = new PerformanceDisplay_default({
|
|
249623
|
-
container: that._performanceContainer
|
|
249624
|
-
});
|
|
249625
|
-
} else {
|
|
249626
|
-
that._performanceContainer.innerHTML = "";
|
|
249627
|
-
}
|
|
249628
|
-
});
|
|
249629
|
-
this._showPrimitiveBoundingSphere = createCommand_default(function() {
|
|
249630
|
-
that._primitive.debugShowBoundingVolume = that.primitiveBoundingSphere;
|
|
249631
|
-
that._scene.requestRender();
|
|
249632
|
-
return true;
|
|
249633
|
-
});
|
|
249634
|
-
this._primitiveBoundingSphereSubscription = knockout_default.getObservable(this, "primitiveBoundingSphere").subscribe(function() {
|
|
249635
|
-
that._showPrimitiveBoundingSphere();
|
|
249636
|
-
});
|
|
249637
|
-
this._showPrimitiveReferenceFrame = createCommand_default(function() {
|
|
249638
|
-
if (that.primitiveReferenceFrame) {
|
|
249639
|
-
const modelMatrix = that._primitive.modelMatrix;
|
|
249640
|
-
that._modelMatrixPrimitive = new DebugModelMatrixPrimitive_default({
|
|
249641
|
-
modelMatrix
|
|
249642
|
-
});
|
|
249643
|
-
that._scene.primitives.add(that._modelMatrixPrimitive);
|
|
249644
|
-
} else if (defined_default(that._modelMatrixPrimitive)) {
|
|
249645
|
-
that._scene.primitives.remove(that._modelMatrixPrimitive);
|
|
249646
|
-
that._modelMatrixPrimitive = void 0;
|
|
249647
|
-
}
|
|
249648
|
-
that._scene.requestRender();
|
|
249649
|
-
return true;
|
|
249650
|
-
});
|
|
249651
|
-
this._primitiveReferenceFrameSubscription = knockout_default.getObservable(this, "primitiveReferenceFrame").subscribe(function() {
|
|
249652
|
-
that._showPrimitiveReferenceFrame();
|
|
249653
|
-
});
|
|
249654
|
-
this._doFilterPrimitive = createCommand_default(function() {
|
|
249655
|
-
if (that.filterPrimitive) {
|
|
249656
|
-
that._scene.debugCommandFilter = function(command) {
|
|
249657
|
-
if (defined_default(that._modelMatrixPrimitive) && command.owner === that._modelMatrixPrimitive._primitive) {
|
|
249658
|
-
return true;
|
|
249659
|
-
} else if (defined_default(that._primitive)) {
|
|
249660
|
-
return command.owner === that._primitive || command.owner === that._primitive._billboardCollection || command.owner.primitive === that._primitive;
|
|
249661
|
-
}
|
|
249662
|
-
return false;
|
|
249663
|
-
};
|
|
249664
|
-
} else {
|
|
249665
|
-
that._scene.debugCommandFilter = void 0;
|
|
249666
|
-
}
|
|
249667
|
-
return true;
|
|
249668
|
-
});
|
|
249669
|
-
this._filterPrimitiveSubscription = knockout_default.getObservable(this, "filterPrimitive").subscribe(function() {
|
|
249670
|
-
that._doFilterPrimitive();
|
|
249671
|
-
that._scene.requestRender();
|
|
249672
|
-
});
|
|
249673
|
-
this._wireframeSubscription = knockout_default.getObservable(this, "wireframe").subscribe(function(val) {
|
|
249674
|
-
globe._surface.tileProvider._debug.wireframe = val;
|
|
249675
|
-
that._scene.requestRender();
|
|
249676
|
-
});
|
|
249677
|
-
this._depthFrustumSubscription = knockout_default.getObservable(this, "depthFrustum").subscribe(function(val) {
|
|
249678
|
-
that._scene.debugShowDepthFrustum = val;
|
|
249679
|
-
that._scene.requestRender();
|
|
249680
|
-
});
|
|
249681
|
-
this._incrementDepthFrustum = createCommand_default(function() {
|
|
249682
|
-
const next = that.depthFrustum + 1;
|
|
249683
|
-
that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);
|
|
249684
|
-
that._scene.requestRender();
|
|
249685
|
-
return true;
|
|
249686
|
-
});
|
|
249687
|
-
this._decrementDepthFrustum = createCommand_default(function() {
|
|
249688
|
-
const next = that.depthFrustum - 1;
|
|
249689
|
-
that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);
|
|
249690
|
-
that._scene.requestRender();
|
|
249691
|
-
return true;
|
|
249692
|
-
});
|
|
249693
|
-
this._suspendUpdatesSubscription = knockout_default.getObservable(this, "suspendUpdates").subscribe(function(val) {
|
|
249694
|
-
globe._surface._debug.suspendLodUpdate = val;
|
|
249695
|
-
if (!val) {
|
|
249696
|
-
that.filterTile = false;
|
|
249697
|
-
}
|
|
249698
|
-
});
|
|
249699
|
-
let tileBoundariesLayer;
|
|
249700
|
-
this._showTileCoordinates = createCommand_default(function() {
|
|
249701
|
-
if (that.tileCoordinates && !defined_default(tileBoundariesLayer)) {
|
|
249702
|
-
tileBoundariesLayer = scene.imageryLayers.addImageryProvider(
|
|
249703
|
-
new TileCoordinatesImageryProvider_default({
|
|
249704
|
-
tilingScheme: scene.terrainProvider.tilingScheme
|
|
249705
|
-
})
|
|
249706
|
-
);
|
|
249707
|
-
} else if (!that.tileCoordinates && defined_default(tileBoundariesLayer)) {
|
|
249708
|
-
scene.imageryLayers.remove(tileBoundariesLayer);
|
|
249709
|
-
tileBoundariesLayer = void 0;
|
|
249710
|
-
}
|
|
249711
|
-
return true;
|
|
249712
|
-
});
|
|
249713
|
-
this._tileCoordinatesSubscription = knockout_default.getObservable(this, "tileCoordinates").subscribe(function() {
|
|
249714
|
-
that._showTileCoordinates();
|
|
249715
|
-
that._scene.requestRender();
|
|
249716
|
-
});
|
|
249717
|
-
this._tileBoundingSphereSubscription = knockout_default.getObservable(this, "tileBoundingSphere").subscribe(function() {
|
|
249718
|
-
that._showTileBoundingSphere();
|
|
249719
|
-
that._scene.requestRender();
|
|
249720
|
-
});
|
|
249721
|
-
this._showTileBoundingSphere = createCommand_default(function() {
|
|
249722
|
-
if (that.tileBoundingSphere) {
|
|
249723
|
-
globe._surface.tileProvider._debug.boundingSphereTile = that._tile;
|
|
249724
|
-
} else {
|
|
249725
|
-
globe._surface.tileProvider._debug.boundingSphereTile = void 0;
|
|
249726
|
-
}
|
|
249727
|
-
that._scene.requestRender();
|
|
249728
|
-
return true;
|
|
249729
|
-
});
|
|
249730
|
-
this._doFilterTile = createCommand_default(function() {
|
|
249731
|
-
if (!that.filterTile) {
|
|
249732
|
-
that.suspendUpdates = false;
|
|
249733
|
-
} else {
|
|
249734
|
-
that.suspendUpdates = true;
|
|
249735
|
-
globe._surface._tilesToRender = [];
|
|
249736
|
-
if (defined_default(that._tile) && that._tile.renderable) {
|
|
249737
|
-
globe._surface._tilesToRender.push(that._tile);
|
|
249738
|
-
}
|
|
249739
|
-
}
|
|
249740
|
-
return true;
|
|
249741
|
-
});
|
|
249742
|
-
this._filterTileSubscription = knockout_default.getObservable(this, "filterTile").subscribe(function() {
|
|
249743
|
-
that.doFilterTile();
|
|
249744
|
-
that._scene.requestRender();
|
|
249745
|
-
});
|
|
249746
|
-
function pickPrimitive(e) {
|
|
249747
|
-
const newPick = that._scene.pick({
|
|
249748
|
-
x: e.position.x,
|
|
249749
|
-
y: e.position.y
|
|
249750
|
-
});
|
|
249751
|
-
if (defined_default(newPick)) {
|
|
249752
|
-
that.primitive = defined_default(newPick.collection) ? newPick.collection : newPick.primitive;
|
|
249753
|
-
}
|
|
249754
|
-
that._scene.requestRender();
|
|
249755
|
-
that.pickPrimitiveActive = false;
|
|
249756
|
-
}
|
|
249757
|
-
this._pickPrimitive = createCommand_default(function() {
|
|
249758
|
-
that.pickPrimitiveActive = !that.pickPrimitiveActive;
|
|
249759
|
-
});
|
|
249760
|
-
this._pickPrimitiveActiveSubscription = knockout_default.getObservable(this, "pickPrimitiveActive").subscribe(function(val) {
|
|
249761
|
-
if (val) {
|
|
249762
|
-
eventHandler.setInputAction(
|
|
249763
|
-
pickPrimitive,
|
|
249764
|
-
ScreenSpaceEventType_default.LEFT_CLICK
|
|
249765
|
-
);
|
|
249766
|
-
} else {
|
|
249767
|
-
eventHandler.removeInputAction(ScreenSpaceEventType_default.LEFT_CLICK);
|
|
249768
|
-
}
|
|
249769
|
-
});
|
|
249770
|
-
function selectTile(e) {
|
|
249771
|
-
let selectedTile;
|
|
249772
|
-
const ellipsoid = globe.ellipsoid;
|
|
249773
|
-
const ray = that._scene.camera.getPickRay(e.position, scratchPickRay2);
|
|
249774
|
-
const cartesian11 = globe.pick(ray, that._scene, scratchPickCartesian3);
|
|
249775
|
-
if (defined_default(cartesian11)) {
|
|
249776
|
-
const cartographic2 = ellipsoid.cartesianToCartographic(cartesian11);
|
|
249777
|
-
const tilesRendered = globe._surface.tileProvider._tilesToRenderByTextureCount;
|
|
249778
|
-
for (let textureCount = 0; !selectedTile && textureCount < tilesRendered.length; ++textureCount) {
|
|
249779
|
-
const tilesRenderedByTextureCount = tilesRendered[textureCount];
|
|
249780
|
-
if (!defined_default(tilesRenderedByTextureCount)) {
|
|
249781
|
-
continue;
|
|
249782
|
-
}
|
|
249783
|
-
for (let tileIndex = 0; !selectedTile && tileIndex < tilesRenderedByTextureCount.length; ++tileIndex) {
|
|
249784
|
-
const tile = tilesRenderedByTextureCount[tileIndex];
|
|
249785
|
-
if (Rectangle_default.contains(tile.rectangle, cartographic2)) {
|
|
249786
|
-
selectedTile = tile;
|
|
249787
|
-
}
|
|
249788
|
-
}
|
|
249789
|
-
}
|
|
249790
|
-
}
|
|
249791
|
-
that.tile = selectedTile;
|
|
249792
|
-
that.pickTileActive = false;
|
|
249793
|
-
}
|
|
249794
|
-
this._pickTile = createCommand_default(function() {
|
|
249795
|
-
that.pickTileActive = !that.pickTileActive;
|
|
249796
|
-
});
|
|
249797
|
-
this._pickTileActiveSubscription = knockout_default.getObservable(this, "pickTileActive").subscribe(function(val) {
|
|
249798
|
-
if (val) {
|
|
249799
|
-
eventHandler.setInputAction(
|
|
249800
|
-
selectTile,
|
|
249801
|
-
ScreenSpaceEventType_default.LEFT_CLICK
|
|
249802
|
-
);
|
|
249803
|
-
} else {
|
|
249804
|
-
eventHandler.removeInputAction(ScreenSpaceEventType_default.LEFT_CLICK);
|
|
249805
|
-
}
|
|
249806
|
-
});
|
|
249807
|
-
this._removePostRenderEvent = scene.postRender.addEventListener(function() {
|
|
249808
|
-
that._update();
|
|
249809
|
-
});
|
|
249810
|
-
}
|
|
249811
|
-
Object.defineProperties(CesiumInspectorViewModel.prototype, {
|
|
249812
|
-
/**
|
|
249813
|
-
* Gets the scene to control.
|
|
249814
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249815
|
-
*
|
|
249816
|
-
* @type {Scene}
|
|
249817
|
-
*/
|
|
249818
|
-
scene: {
|
|
249819
|
-
get: function() {
|
|
249820
|
-
return this._scene;
|
|
249821
|
-
}
|
|
249822
|
-
},
|
|
249823
|
-
/**
|
|
249824
|
-
* Gets the container of the PerformanceDisplay
|
|
249825
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249826
|
-
*
|
|
249827
|
-
* @type {Element}
|
|
249828
|
-
*/
|
|
249829
|
-
performanceContainer: {
|
|
249830
|
-
get: function() {
|
|
249831
|
-
return this._performanceContainer;
|
|
249832
|
-
}
|
|
249833
|
-
},
|
|
249834
|
-
/**
|
|
249835
|
-
* Gets the command to toggle the visibility of the drop down.
|
|
249836
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249837
|
-
*
|
|
249838
|
-
* @type {Command}
|
|
249839
|
-
*/
|
|
249840
|
-
toggleDropDown: {
|
|
249841
|
-
get: function() {
|
|
249842
|
-
return this._toggleDropDown;
|
|
249843
|
-
}
|
|
249844
|
-
},
|
|
249845
|
-
/**
|
|
249846
|
-
* Gets the command to toggle the visibility of a BoundingSphere for a primitive
|
|
249847
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249848
|
-
*
|
|
249849
|
-
* @type {Command}
|
|
249850
|
-
*/
|
|
249851
|
-
showPrimitiveBoundingSphere: {
|
|
249852
|
-
get: function() {
|
|
249853
|
-
return this._showPrimitiveBoundingSphere;
|
|
249854
|
-
}
|
|
249855
|
-
},
|
|
249856
|
-
/**
|
|
249857
|
-
* Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
|
|
249858
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249859
|
-
*
|
|
249860
|
-
* @type {Command}
|
|
249861
|
-
*/
|
|
249862
|
-
showPrimitiveReferenceFrame: {
|
|
249863
|
-
get: function() {
|
|
249864
|
-
return this._showPrimitiveReferenceFrame;
|
|
249865
|
-
}
|
|
249866
|
-
},
|
|
249867
|
-
/**
|
|
249868
|
-
* Gets the command to toggle a filter that renders only a selected primitive
|
|
249869
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249870
|
-
*
|
|
249871
|
-
* @type {Command}
|
|
249872
|
-
*/
|
|
249873
|
-
doFilterPrimitive: {
|
|
249874
|
-
get: function() {
|
|
249875
|
-
return this._doFilterPrimitive;
|
|
249876
|
-
}
|
|
249877
|
-
},
|
|
249878
|
-
/**
|
|
249879
|
-
* Gets the command to increment the depth frustum index to be shown
|
|
249880
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249881
|
-
*
|
|
249882
|
-
* @type {Command}
|
|
249883
|
-
*/
|
|
249884
|
-
incrementDepthFrustum: {
|
|
249885
|
-
get: function() {
|
|
249886
|
-
return this._incrementDepthFrustum;
|
|
249887
|
-
}
|
|
249888
|
-
},
|
|
249889
|
-
/**
|
|
249890
|
-
* Gets the command to decrement the depth frustum index to be shown
|
|
249891
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249892
|
-
*
|
|
249893
|
-
* @type {Command}
|
|
249894
|
-
*/
|
|
249895
|
-
decrementDepthFrustum: {
|
|
249896
|
-
get: function() {
|
|
249897
|
-
return this._decrementDepthFrustum;
|
|
249898
|
-
}
|
|
249899
|
-
},
|
|
249900
|
-
/**
|
|
249901
|
-
* Gets the command to toggle the visibility of tile coordinates
|
|
249902
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249903
|
-
*
|
|
249904
|
-
* @type {Command}
|
|
249905
|
-
*/
|
|
249906
|
-
showTileCoordinates: {
|
|
249907
|
-
get: function() {
|
|
249908
|
-
return this._showTileCoordinates;
|
|
249909
|
-
}
|
|
249910
|
-
},
|
|
249911
|
-
/**
|
|
249912
|
-
* Gets the command to toggle the visibility of a BoundingSphere for a selected tile
|
|
249913
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249914
|
-
*
|
|
249915
|
-
* @type {Command}
|
|
249916
|
-
*/
|
|
249917
|
-
showTileBoundingSphere: {
|
|
249918
|
-
get: function() {
|
|
249919
|
-
return this._showTileBoundingSphere;
|
|
249920
|
-
}
|
|
249921
|
-
},
|
|
249922
|
-
/**
|
|
249923
|
-
* Gets the command to toggle a filter that renders only a selected tile
|
|
249924
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249925
|
-
*
|
|
249926
|
-
* @type {Command}
|
|
249927
|
-
*/
|
|
249928
|
-
doFilterTile: {
|
|
249929
|
-
get: function() {
|
|
249930
|
-
return this._doFilterTile;
|
|
249931
|
-
}
|
|
249932
|
-
},
|
|
249933
|
-
/**
|
|
249934
|
-
* Gets the command to expand and collapse the general section
|
|
249935
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249936
|
-
*
|
|
249937
|
-
* @type {Command}
|
|
249938
|
-
*/
|
|
249939
|
-
toggleGeneral: {
|
|
249940
|
-
get: function() {
|
|
249941
|
-
return this._toggleGeneral;
|
|
249942
|
-
}
|
|
249943
|
-
},
|
|
249944
|
-
/**
|
|
249945
|
-
* Gets the command to expand and collapse the primitives section
|
|
249946
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249947
|
-
*
|
|
249948
|
-
* @type {Command}
|
|
249949
|
-
*/
|
|
249950
|
-
togglePrimitives: {
|
|
249951
|
-
get: function() {
|
|
249952
|
-
return this._togglePrimitives;
|
|
249953
|
-
}
|
|
249954
|
-
},
|
|
249955
|
-
/**
|
|
249956
|
-
* Gets the command to expand and collapse the terrain section
|
|
249957
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249958
|
-
*
|
|
249959
|
-
* @type {Command}
|
|
249960
|
-
*/
|
|
249961
|
-
toggleTerrain: {
|
|
249962
|
-
get: function() {
|
|
249963
|
-
return this._toggleTerrain;
|
|
249964
|
-
}
|
|
249965
|
-
},
|
|
249966
|
-
/**
|
|
249967
|
-
* Gets the command to pick a primitive
|
|
249968
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249969
|
-
*
|
|
249970
|
-
* @type {Command}
|
|
249971
|
-
*/
|
|
249972
|
-
pickPrimitive: {
|
|
249973
|
-
get: function() {
|
|
249974
|
-
return this._pickPrimitive;
|
|
249975
|
-
}
|
|
249976
|
-
},
|
|
249977
|
-
/**
|
|
249978
|
-
* Gets the command to pick a tile
|
|
249979
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249980
|
-
*
|
|
249981
|
-
* @type {Command}
|
|
249982
|
-
*/
|
|
249983
|
-
pickTile: {
|
|
249984
|
-
get: function() {
|
|
249985
|
-
return this._pickTile;
|
|
249986
|
-
}
|
|
249987
|
-
},
|
|
249988
|
-
/**
|
|
249989
|
-
* Gets the command to pick a tile
|
|
249990
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
249991
|
-
*
|
|
249992
|
-
* @type {Command}
|
|
249993
|
-
*/
|
|
249994
|
-
selectParent: {
|
|
249995
|
-
get: function() {
|
|
249996
|
-
const that = this;
|
|
249997
|
-
return createCommand_default(function() {
|
|
249998
|
-
that.tile = that.tile.parent;
|
|
249999
|
-
});
|
|
250000
|
-
}
|
|
250001
|
-
},
|
|
250002
|
-
/**
|
|
250003
|
-
* Gets the command to pick a tile
|
|
250004
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250005
|
-
*
|
|
250006
|
-
* @type {Command}
|
|
250007
|
-
*/
|
|
250008
|
-
selectNW: {
|
|
250009
|
-
get: function() {
|
|
250010
|
-
const that = this;
|
|
250011
|
-
return createCommand_default(function() {
|
|
250012
|
-
that.tile = that.tile.northwestChild;
|
|
250013
|
-
});
|
|
250014
|
-
}
|
|
250015
|
-
},
|
|
250016
|
-
/**
|
|
250017
|
-
* Gets the command to pick a tile
|
|
250018
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250019
|
-
*
|
|
250020
|
-
* @type {Command}
|
|
250021
|
-
*/
|
|
250022
|
-
selectNE: {
|
|
250023
|
-
get: function() {
|
|
250024
|
-
const that = this;
|
|
250025
|
-
return createCommand_default(function() {
|
|
250026
|
-
that.tile = that.tile.northeastChild;
|
|
250027
|
-
});
|
|
250028
|
-
}
|
|
250029
|
-
},
|
|
250030
|
-
/**
|
|
250031
|
-
* Gets the command to pick a tile
|
|
250032
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250033
|
-
*
|
|
250034
|
-
* @type {Command}
|
|
250035
|
-
*/
|
|
250036
|
-
selectSW: {
|
|
250037
|
-
get: function() {
|
|
250038
|
-
const that = this;
|
|
250039
|
-
return createCommand_default(function() {
|
|
250040
|
-
that.tile = that.tile.southwestChild;
|
|
250041
|
-
});
|
|
250042
|
-
}
|
|
250043
|
-
},
|
|
250044
|
-
/**
|
|
250045
|
-
* Gets the command to pick a tile
|
|
250046
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250047
|
-
*
|
|
250048
|
-
* @type {Command}
|
|
250049
|
-
*/
|
|
250050
|
-
selectSE: {
|
|
250051
|
-
get: function() {
|
|
250052
|
-
const that = this;
|
|
250053
|
-
return createCommand_default(function() {
|
|
250054
|
-
that.tile = that.tile.southeastChild;
|
|
250055
|
-
});
|
|
250056
|
-
}
|
|
250057
|
-
},
|
|
250058
|
-
/**
|
|
250059
|
-
* Gets or sets the current selected primitive
|
|
250060
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250061
|
-
*
|
|
250062
|
-
* @type {Command}
|
|
250063
|
-
*/
|
|
250064
|
-
primitive: {
|
|
250065
|
-
get: function() {
|
|
250066
|
-
return this._primitive;
|
|
250067
|
-
},
|
|
250068
|
-
set: function(newPrimitive) {
|
|
250069
|
-
const oldPrimitive = this._primitive;
|
|
250070
|
-
if (newPrimitive !== oldPrimitive) {
|
|
250071
|
-
this.hasPickedPrimitive = true;
|
|
250072
|
-
if (defined_default(oldPrimitive)) {
|
|
250073
|
-
oldPrimitive.debugShowBoundingVolume = false;
|
|
250074
|
-
}
|
|
250075
|
-
this._scene.debugCommandFilter = void 0;
|
|
250076
|
-
if (defined_default(this._modelMatrixPrimitive)) {
|
|
250077
|
-
this._scene.primitives.remove(this._modelMatrixPrimitive);
|
|
250078
|
-
this._modelMatrixPrimitive = void 0;
|
|
250079
|
-
}
|
|
250080
|
-
this._primitive = newPrimitive;
|
|
250081
|
-
newPrimitive.show = false;
|
|
250082
|
-
setTimeout(function() {
|
|
250083
|
-
newPrimitive.show = true;
|
|
250084
|
-
}, 50);
|
|
250085
|
-
this.showPrimitiveBoundingSphere();
|
|
250086
|
-
this.showPrimitiveReferenceFrame();
|
|
250087
|
-
this.doFilterPrimitive();
|
|
250088
|
-
}
|
|
250089
|
-
}
|
|
250090
|
-
},
|
|
250091
|
-
/**
|
|
250092
|
-
* Gets or sets the current selected tile
|
|
250093
|
-
* @memberof CesiumInspectorViewModel.prototype
|
|
250094
|
-
*
|
|
250095
|
-
* @type {Command}
|
|
250096
|
-
*/
|
|
250097
|
-
tile: {
|
|
250098
|
-
get: function() {
|
|
250099
|
-
return this._tile;
|
|
250100
|
-
},
|
|
250101
|
-
set: function(newTile) {
|
|
250102
|
-
if (defined_default(newTile)) {
|
|
250103
|
-
this.hasPickedTile = true;
|
|
250104
|
-
const oldTile = this._tile;
|
|
250105
|
-
if (newTile !== oldTile) {
|
|
250106
|
-
this.tileText = `L: ${newTile.level} X: ${newTile.x} Y: ${newTile.y}`;
|
|
250107
|
-
this.tileText += `<br>SW corner: ${newTile.rectangle.west}, ${newTile.rectangle.south}`;
|
|
250108
|
-
this.tileText += `<br>NE corner: ${newTile.rectangle.east}, ${newTile.rectangle.north}`;
|
|
250109
|
-
const data = newTile.data;
|
|
250110
|
-
if (defined_default(data) && defined_default(data.tileBoundingRegion)) {
|
|
250111
|
-
this.tileText += `<br>Min: ${data.tileBoundingRegion.minimumHeight} Max: ${data.tileBoundingRegion.maximumHeight}`;
|
|
250112
|
-
} else {
|
|
250113
|
-
this.tileText += "<br>(Tile is not loaded)";
|
|
250114
|
-
}
|
|
250115
|
-
}
|
|
250116
|
-
this._tile = newTile;
|
|
250117
|
-
this.showTileBoundingSphere();
|
|
250118
|
-
this.doFilterTile();
|
|
250119
|
-
} else {
|
|
250120
|
-
this.hasPickedTile = false;
|
|
250121
|
-
this._tile = void 0;
|
|
250122
|
-
}
|
|
250123
|
-
}
|
|
250124
|
-
}
|
|
250125
|
-
});
|
|
250126
|
-
CesiumInspectorViewModel.prototype._update = function() {
|
|
250127
|
-
if (this.frustums) {
|
|
250128
|
-
this.frustumStatisticText = frustumStatisticsToString(
|
|
250129
|
-
this._scene.debugFrustumStatistics
|
|
250130
|
-
);
|
|
250131
|
-
}
|
|
250132
|
-
const numberOfFrustums = this._scene.numberOfFrustums;
|
|
250133
|
-
this._numberOfFrustums = numberOfFrustums;
|
|
250134
|
-
this.depthFrustum = boundDepthFrustum(1, numberOfFrustums, this.depthFrustum);
|
|
250135
|
-
this.depthFrustumText = `${this.depthFrustum} of ${numberOfFrustums}`;
|
|
250136
|
-
if (this.performance) {
|
|
250137
|
-
this._performanceDisplay.update();
|
|
250138
|
-
}
|
|
250139
|
-
if (this.primitiveReferenceFrame) {
|
|
250140
|
-
this._modelMatrixPrimitive.modelMatrix = this._primitive.modelMatrix;
|
|
250141
|
-
}
|
|
250142
|
-
this.shaderCacheText = `Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`;
|
|
250143
|
-
};
|
|
250144
|
-
CesiumInspectorViewModel.prototype.isDestroyed = function() {
|
|
250145
|
-
return false;
|
|
250146
|
-
};
|
|
250147
|
-
CesiumInspectorViewModel.prototype.destroy = function() {
|
|
250148
|
-
this._eventHandler.destroy();
|
|
250149
|
-
this._removePostRenderEvent();
|
|
250150
|
-
this._frustumsSubscription.dispose();
|
|
250151
|
-
this._frustumPlanesSubscription.dispose();
|
|
250152
|
-
this._performanceSubscription.dispose();
|
|
250153
|
-
this._primitiveBoundingSphereSubscription.dispose();
|
|
250154
|
-
this._primitiveReferenceFrameSubscription.dispose();
|
|
250155
|
-
this._filterPrimitiveSubscription.dispose();
|
|
250156
|
-
this._wireframeSubscription.dispose();
|
|
250157
|
-
this._depthFrustumSubscription.dispose();
|
|
250158
|
-
this._suspendUpdatesSubscription.dispose();
|
|
250159
|
-
this._tileCoordinatesSubscription.dispose();
|
|
250160
|
-
this._tileBoundingSphereSubscription.dispose();
|
|
250161
|
-
this._filterTileSubscription.dispose();
|
|
250162
|
-
this._pickPrimitiveActiveSubscription.dispose();
|
|
250163
|
-
this._pickTileActiveSubscription.dispose();
|
|
250164
|
-
return destroyObject_default(this);
|
|
250165
|
-
};
|
|
250166
|
-
var CesiumInspectorViewModel_default = CesiumInspectorViewModel;
|
|
250167
|
-
|
|
250168
|
-
// packages/widgets/Source/CesiumInspector/CesiumInspector.js
|
|
250169
|
-
function CesiumInspector(container, scene) {
|
|
250170
|
-
if (!defined_default(container)) {
|
|
250171
|
-
throw new DeveloperError_default("container is required.");
|
|
250172
|
-
}
|
|
250173
|
-
if (!defined_default(scene)) {
|
|
250174
|
-
throw new DeveloperError_default("scene is required.");
|
|
250175
|
-
}
|
|
250176
|
-
container = getElement_default(container);
|
|
250177
|
-
const performanceContainer = document.createElement("div");
|
|
250178
|
-
const viewModel = new CesiumInspectorViewModel_default(scene, performanceContainer);
|
|
250179
|
-
this._viewModel = viewModel;
|
|
250180
|
-
this._container = container;
|
|
250181
|
-
const element = document.createElement("div");
|
|
250182
|
-
this._element = element;
|
|
250183
|
-
const text2 = document.createElement("div");
|
|
250184
|
-
text2.textContent = "Cesium Inspector";
|
|
250185
|
-
text2.className = "cesium-cesiumInspector-button";
|
|
250186
|
-
text2.setAttribute("data-bind", "click: toggleDropDown");
|
|
250187
|
-
element.appendChild(text2);
|
|
250188
|
-
element.className = "cesium-cesiumInspector";
|
|
250189
|
-
element.setAttribute(
|
|
250190
|
-
"data-bind",
|
|
250191
|
-
'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'
|
|
250192
|
-
);
|
|
250193
|
-
container.appendChild(this._element);
|
|
250194
|
-
const panel = document.createElement("div");
|
|
250195
|
-
panel.className = "cesium-cesiumInspector-dropDown";
|
|
250196
|
-
element.appendChild(panel);
|
|
250197
|
-
const createSection = InspectorShared_default.createSection;
|
|
250198
|
-
const createCheckbox = InspectorShared_default.createCheckbox;
|
|
250199
|
-
const generalSection = createSection(
|
|
250200
|
-
panel,
|
|
250201
|
-
"General",
|
|
250202
|
-
"generalVisible",
|
|
250203
|
-
"toggleGeneral"
|
|
250204
|
-
);
|
|
250205
|
-
const debugShowFrustums = createCheckbox("Show Frustums", "frustums");
|
|
250206
|
-
const frustumStatistics = document.createElement("div");
|
|
250207
|
-
frustumStatistics.className = "cesium-cesiumInspector-frustumStatistics";
|
|
250208
|
-
frustumStatistics.setAttribute(
|
|
250209
|
-
"data-bind",
|
|
250210
|
-
"visible: frustums, html: frustumStatisticText"
|
|
250211
|
-
);
|
|
250212
|
-
debugShowFrustums.appendChild(frustumStatistics);
|
|
250213
|
-
generalSection.appendChild(debugShowFrustums);
|
|
250214
|
-
generalSection.appendChild(
|
|
250215
|
-
createCheckbox("Show Frustum Planes", "frustumPlanes")
|
|
250216
|
-
);
|
|
250217
|
-
generalSection.appendChild(
|
|
250218
|
-
createCheckbox("Performance Display", "performance")
|
|
250219
|
-
);
|
|
250220
|
-
performanceContainer.className = "cesium-cesiumInspector-performanceDisplay";
|
|
250221
|
-
generalSection.appendChild(performanceContainer);
|
|
250222
|
-
const shaderCacheDisplay = document.createElement("div");
|
|
250223
|
-
shaderCacheDisplay.className = "cesium-cesiumInspector-shaderCache";
|
|
250224
|
-
shaderCacheDisplay.setAttribute("data-bind", "html: shaderCacheText");
|
|
250225
|
-
generalSection.appendChild(shaderCacheDisplay);
|
|
250226
|
-
const depthFrustum = document.createElement("div");
|
|
250227
|
-
generalSection.appendChild(depthFrustum);
|
|
250228
|
-
const gLabel = document.createElement("span");
|
|
250229
|
-
gLabel.setAttribute(
|
|
250230
|
-
"data-bind",
|
|
250231
|
-
'html: " Frustum:"'
|
|
250232
|
-
);
|
|
250233
|
-
depthFrustum.appendChild(gLabel);
|
|
250234
|
-
const gText = document.createElement("span");
|
|
250235
|
-
gText.setAttribute("data-bind", "text: depthFrustumText");
|
|
250236
|
-
depthFrustum.appendChild(gText);
|
|
250237
|
-
const gMinusButton = document.createElement("input");
|
|
250238
|
-
gMinusButton.type = "button";
|
|
250239
|
-
gMinusButton.value = "-";
|
|
250240
|
-
gMinusButton.className = "cesium-cesiumInspector-pickButton";
|
|
250241
|
-
gMinusButton.setAttribute("data-bind", "click: decrementDepthFrustum");
|
|
250242
|
-
depthFrustum.appendChild(gMinusButton);
|
|
250243
|
-
const gPlusButton = document.createElement("input");
|
|
250244
|
-
gPlusButton.type = "button";
|
|
250245
|
-
gPlusButton.value = "+";
|
|
250246
|
-
gPlusButton.className = "cesium-cesiumInspector-pickButton";
|
|
250247
|
-
gPlusButton.setAttribute("data-bind", "click: incrementDepthFrustum");
|
|
250248
|
-
depthFrustum.appendChild(gPlusButton);
|
|
250249
|
-
const primSection = createSection(
|
|
250250
|
-
panel,
|
|
250251
|
-
"Primitives",
|
|
250252
|
-
"primitivesVisible",
|
|
250253
|
-
"togglePrimitives"
|
|
250254
|
-
);
|
|
250255
|
-
const pickPrimRequired = document.createElement("div");
|
|
250256
|
-
pickPrimRequired.className = "cesium-cesiumInspector-pickSection";
|
|
250257
|
-
primSection.appendChild(pickPrimRequired);
|
|
250258
|
-
const pickPrimitiveButton = document.createElement("input");
|
|
250259
|
-
pickPrimitiveButton.type = "button";
|
|
250260
|
-
pickPrimitiveButton.value = "Pick a primitive";
|
|
250261
|
-
pickPrimitiveButton.className = "cesium-cesiumInspector-pickButton";
|
|
250262
|
-
pickPrimitiveButton.setAttribute(
|
|
250263
|
-
"data-bind",
|
|
250264
|
-
'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive'
|
|
250265
|
-
);
|
|
250266
|
-
let buttonWrap = document.createElement("div");
|
|
250267
|
-
buttonWrap.className = "cesium-cesiumInspector-center";
|
|
250268
|
-
buttonWrap.appendChild(pickPrimitiveButton);
|
|
250269
|
-
pickPrimRequired.appendChild(buttonWrap);
|
|
250270
|
-
pickPrimRequired.appendChild(
|
|
250271
|
-
createCheckbox(
|
|
250272
|
-
"Show bounding sphere",
|
|
250273
|
-
"primitiveBoundingSphere",
|
|
250274
|
-
"hasPickedPrimitive"
|
|
250275
|
-
)
|
|
250276
|
-
);
|
|
250277
|
-
pickPrimRequired.appendChild(
|
|
250278
|
-
createCheckbox(
|
|
250279
|
-
"Show reference frame",
|
|
250280
|
-
"primitiveReferenceFrame",
|
|
250281
|
-
"hasPickedPrimitive"
|
|
250282
|
-
)
|
|
250283
|
-
);
|
|
250284
|
-
this._primitiveOnly = createCheckbox(
|
|
250285
|
-
"Show only selected",
|
|
250286
|
-
"filterPrimitive",
|
|
250287
|
-
"hasPickedPrimitive"
|
|
250288
|
-
);
|
|
250289
|
-
pickPrimRequired.appendChild(this._primitiveOnly);
|
|
250290
|
-
const terrainSection = createSection(
|
|
250291
|
-
panel,
|
|
250292
|
-
"Terrain",
|
|
250293
|
-
"terrainVisible",
|
|
250294
|
-
"toggleTerrain"
|
|
250295
|
-
);
|
|
250296
|
-
const pickTileRequired = document.createElement("div");
|
|
250297
|
-
pickTileRequired.className = "cesium-cesiumInspector-pickSection";
|
|
250298
|
-
terrainSection.appendChild(pickTileRequired);
|
|
250299
|
-
const pickTileButton = document.createElement("input");
|
|
250300
|
-
pickTileButton.type = "button";
|
|
250301
|
-
pickTileButton.value = "Pick a tile";
|
|
250302
|
-
pickTileButton.className = "cesium-cesiumInspector-pickButton";
|
|
250303
|
-
pickTileButton.setAttribute(
|
|
250304
|
-
"data-bind",
|
|
250305
|
-
'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'
|
|
250306
|
-
);
|
|
250307
|
-
buttonWrap = document.createElement("div");
|
|
250308
|
-
buttonWrap.appendChild(pickTileButton);
|
|
250309
|
-
buttonWrap.className = "cesium-cesiumInspector-center";
|
|
250310
|
-
pickTileRequired.appendChild(buttonWrap);
|
|
250311
|
-
const tileInfo = document.createElement("div");
|
|
250312
|
-
pickTileRequired.appendChild(tileInfo);
|
|
250313
|
-
const parentTile = document.createElement("input");
|
|
250314
|
-
parentTile.type = "button";
|
|
250315
|
-
parentTile.value = "Parent";
|
|
250316
|
-
parentTile.className = "cesium-cesiumInspector-pickButton";
|
|
250317
|
-
parentTile.setAttribute("data-bind", "click: selectParent");
|
|
250318
|
-
const nwTile = document.createElement("input");
|
|
250319
|
-
nwTile.type = "button";
|
|
250320
|
-
nwTile.value = "NW";
|
|
250321
|
-
nwTile.className = "cesium-cesiumInspector-pickButton";
|
|
250322
|
-
nwTile.setAttribute("data-bind", "click: selectNW");
|
|
250323
|
-
const neTile = document.createElement("input");
|
|
250324
|
-
neTile.type = "button";
|
|
250325
|
-
neTile.value = "NE";
|
|
250326
|
-
neTile.className = "cesium-cesiumInspector-pickButton";
|
|
250327
|
-
neTile.setAttribute("data-bind", "click: selectNE");
|
|
250328
|
-
const swTile = document.createElement("input");
|
|
250329
|
-
swTile.type = "button";
|
|
250330
|
-
swTile.value = "SW";
|
|
250331
|
-
swTile.className = "cesium-cesiumInspector-pickButton";
|
|
250332
|
-
swTile.setAttribute("data-bind", "click: selectSW");
|
|
250333
|
-
const seTile = document.createElement("input");
|
|
250334
|
-
seTile.type = "button";
|
|
250335
|
-
seTile.value = "SE";
|
|
250336
|
-
seTile.className = "cesium-cesiumInspector-pickButton";
|
|
250337
|
-
seTile.setAttribute("data-bind", "click: selectSE");
|
|
250338
|
-
const tileText = document.createElement("div");
|
|
250339
|
-
tileText.className = "cesium-cesiumInspector-tileText";
|
|
250340
|
-
tileInfo.className = "cesium-cesiumInspector-frustumStatistics";
|
|
250341
|
-
tileInfo.appendChild(tileText);
|
|
250342
|
-
tileInfo.setAttribute("data-bind", "visible: hasPickedTile");
|
|
250343
|
-
tileText.setAttribute("data-bind", "html: tileText");
|
|
250344
|
-
const relativeText = document.createElement("div");
|
|
250345
|
-
relativeText.className = "cesium-cesiumInspector-relativeText";
|
|
250346
|
-
relativeText.textContent = "Select relative:";
|
|
250347
|
-
tileInfo.appendChild(relativeText);
|
|
250348
|
-
const table3 = document.createElement("table");
|
|
250349
|
-
const tr1 = document.createElement("tr");
|
|
250350
|
-
const tr2 = document.createElement("tr");
|
|
250351
|
-
const td1 = document.createElement("td");
|
|
250352
|
-
td1.appendChild(parentTile);
|
|
250353
|
-
const td2 = document.createElement("td");
|
|
250354
|
-
td2.appendChild(nwTile);
|
|
250355
|
-
const td3 = document.createElement("td");
|
|
250356
|
-
td3.appendChild(neTile);
|
|
250357
|
-
tr1.appendChild(td1);
|
|
250358
|
-
tr1.appendChild(td2);
|
|
250359
|
-
tr1.appendChild(td3);
|
|
250360
|
-
const td4 = document.createElement("td");
|
|
250361
|
-
const td5 = document.createElement("td");
|
|
250362
|
-
td5.appendChild(swTile);
|
|
250363
|
-
const td6 = document.createElement("td");
|
|
250364
|
-
td6.appendChild(seTile);
|
|
250365
|
-
tr2.appendChild(td4);
|
|
250366
|
-
tr2.appendChild(td5);
|
|
250367
|
-
tr2.appendChild(td6);
|
|
250368
|
-
table3.appendChild(tr1);
|
|
250369
|
-
table3.appendChild(tr2);
|
|
250370
|
-
tileInfo.appendChild(table3);
|
|
250371
|
-
pickTileRequired.appendChild(
|
|
250372
|
-
createCheckbox(
|
|
250373
|
-
"Show bounding volume",
|
|
250374
|
-
"tileBoundingSphere",
|
|
250375
|
-
"hasPickedTile"
|
|
250376
|
-
)
|
|
250377
|
-
);
|
|
250378
|
-
pickTileRequired.appendChild(
|
|
250379
|
-
createCheckbox("Show only selected", "filterTile", "hasPickedTile")
|
|
250380
|
-
);
|
|
250381
|
-
terrainSection.appendChild(createCheckbox("Wireframe", "wireframe"));
|
|
250382
|
-
terrainSection.appendChild(
|
|
250383
|
-
createCheckbox("Suspend LOD update", "suspendUpdates")
|
|
250384
|
-
);
|
|
250385
|
-
terrainSection.appendChild(
|
|
250386
|
-
createCheckbox("Show tile coordinates", "tileCoordinates")
|
|
250387
|
-
);
|
|
250388
|
-
knockout_default.applyBindings(viewModel, this._element);
|
|
250389
|
-
}
|
|
250390
|
-
Object.defineProperties(CesiumInspector.prototype, {
|
|
250391
|
-
/**
|
|
250392
|
-
* Gets the parent container.
|
|
250393
|
-
* @memberof CesiumInspector.prototype
|
|
250394
|
-
*
|
|
250395
|
-
* @type {Element}
|
|
250396
|
-
*/
|
|
250397
|
-
container: {
|
|
250398
|
-
get: function() {
|
|
250399
|
-
return this._container;
|
|
250400
|
-
}
|
|
250401
|
-
},
|
|
250402
|
-
/**
|
|
250403
|
-
* Gets the view model.
|
|
250404
|
-
* @memberof CesiumInspector.prototype
|
|
250405
|
-
*
|
|
250406
|
-
* @type {CesiumInspectorViewModel}
|
|
250407
|
-
*/
|
|
250408
|
-
viewModel: {
|
|
250409
|
-
get: function() {
|
|
250410
|
-
return this._viewModel;
|
|
250411
|
-
}
|
|
250412
|
-
}
|
|
250413
|
-
});
|
|
250414
|
-
CesiumInspector.prototype.isDestroyed = function() {
|
|
250415
|
-
return false;
|
|
250416
|
-
};
|
|
250417
|
-
CesiumInspector.prototype.destroy = function() {
|
|
250418
|
-
knockout_default.cleanNode(this._element);
|
|
250419
|
-
this._container.removeChild(this._element);
|
|
250420
|
-
this.viewModel.destroy();
|
|
250421
|
-
return destroyObject_default(this);
|
|
250422
|
-
};
|
|
250423
|
-
var CesiumInspector_default = CesiumInspector;
|
|
250424
|
-
|
|
250425
249488
|
// packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspector.js
|
|
250426
|
-
var
|
|
249489
|
+
var import_InlineWorkers1294 = __toESM(require_InlineWorkers(), 1);
|
|
250427
249490
|
|
|
250428
249491
|
// packages/widgets/Source/Cesium3DTilesInspector/Cesium3DTilesInspectorViewModel.js
|
|
250429
|
-
var
|
|
249492
|
+
var import_InlineWorkers1293 = __toESM(require_InlineWorkers(), 1);
|
|
250430
249493
|
function getPickTileset(viewModel) {
|
|
250431
249494
|
return function(e) {
|
|
250432
249495
|
const pick = viewModel._scene.pick(e.position);
|
|
@@ -251829,11 +250892,1066 @@ ${terrainTip}`;
|
|
|
251829
250892
|
};
|
|
251830
250893
|
var Cesium3DTilesInspector_default = Cesium3DTilesInspector;
|
|
251831
250894
|
|
|
251832
|
-
// packages/widgets/Source/
|
|
250895
|
+
// packages/widgets/Source/CesiumInspector/CesiumInspector.js
|
|
250896
|
+
var import_InlineWorkers1296 = __toESM(require_InlineWorkers(), 1);
|
|
250897
|
+
|
|
250898
|
+
// packages/widgets/Source/CesiumInspector/CesiumInspectorViewModel.js
|
|
250899
|
+
var import_InlineWorkers1295 = __toESM(require_InlineWorkers(), 1);
|
|
250900
|
+
function frustumStatisticsToString(statistics2) {
|
|
250901
|
+
let str;
|
|
250902
|
+
if (defined_default(statistics2)) {
|
|
250903
|
+
str = "Command Statistics";
|
|
250904
|
+
const com = statistics2.commandsInFrustums;
|
|
250905
|
+
for (const n in com) {
|
|
250906
|
+
if (com.hasOwnProperty(n)) {
|
|
250907
|
+
let num = parseInt(n, 10);
|
|
250908
|
+
let s;
|
|
250909
|
+
if (num === 7) {
|
|
250910
|
+
s = "1, 2 and 3";
|
|
250911
|
+
} else {
|
|
250912
|
+
const f = [];
|
|
250913
|
+
for (let i = 2; i >= 0; i--) {
|
|
250914
|
+
const p = Math.pow(2, i);
|
|
250915
|
+
if (num >= p) {
|
|
250916
|
+
f.push(i + 1);
|
|
250917
|
+
num -= p;
|
|
250918
|
+
}
|
|
250919
|
+
}
|
|
250920
|
+
s = f.reverse().join(" and ");
|
|
250921
|
+
}
|
|
250922
|
+
str += `<br> ${com[n]} in frustum ${s}`;
|
|
250923
|
+
}
|
|
250924
|
+
}
|
|
250925
|
+
str += `<br>Total: ${statistics2.totalCommands}`;
|
|
250926
|
+
}
|
|
250927
|
+
return str;
|
|
250928
|
+
}
|
|
250929
|
+
function boundDepthFrustum(lower, upper, proposed) {
|
|
250930
|
+
let bounded = Math.min(proposed, upper);
|
|
250931
|
+
bounded = Math.max(bounded, lower);
|
|
250932
|
+
return bounded;
|
|
250933
|
+
}
|
|
250934
|
+
var scratchPickRay2 = new Ray_default();
|
|
250935
|
+
var scratchPickCartesian3 = new Cartesian3_default();
|
|
250936
|
+
function CesiumInspectorViewModel(scene, performanceContainer) {
|
|
250937
|
+
if (!defined_default(scene)) {
|
|
250938
|
+
throw new DeveloperError_default("scene is required");
|
|
250939
|
+
}
|
|
250940
|
+
if (!defined_default(performanceContainer)) {
|
|
250941
|
+
throw new DeveloperError_default("performanceContainer is required");
|
|
250942
|
+
}
|
|
250943
|
+
const that = this;
|
|
250944
|
+
const canvas = scene.canvas;
|
|
250945
|
+
const eventHandler = new ScreenSpaceEventHandler_default(canvas);
|
|
250946
|
+
this._eventHandler = eventHandler;
|
|
250947
|
+
this._scene = scene;
|
|
250948
|
+
this._canvas = canvas;
|
|
250949
|
+
this._primitive = void 0;
|
|
250950
|
+
this._tile = void 0;
|
|
250951
|
+
this._modelMatrixPrimitive = void 0;
|
|
250952
|
+
this._performanceDisplay = void 0;
|
|
250953
|
+
this._performanceContainer = performanceContainer;
|
|
250954
|
+
const globe = this._scene.globe;
|
|
250955
|
+
globe.depthTestAgainstTerrain = true;
|
|
250956
|
+
this.frustums = false;
|
|
250957
|
+
this.frustumPlanes = false;
|
|
250958
|
+
this.performance = false;
|
|
250959
|
+
this.shaderCacheText = "";
|
|
250960
|
+
this.primitiveBoundingSphere = false;
|
|
250961
|
+
this.primitiveReferenceFrame = false;
|
|
250962
|
+
this.filterPrimitive = false;
|
|
250963
|
+
this.tileBoundingSphere = false;
|
|
250964
|
+
this.filterTile = false;
|
|
250965
|
+
this.wireframe = false;
|
|
250966
|
+
this.depthFrustum = 1;
|
|
250967
|
+
this._numberOfFrustums = 1;
|
|
250968
|
+
this.suspendUpdates = false;
|
|
250969
|
+
this.tileCoordinates = false;
|
|
250970
|
+
this.frustumStatisticText = false;
|
|
250971
|
+
this.tileText = "";
|
|
250972
|
+
this.hasPickedPrimitive = false;
|
|
250973
|
+
this.hasPickedTile = false;
|
|
250974
|
+
this.pickPrimitiveActive = false;
|
|
250975
|
+
this.pickTileActive = false;
|
|
250976
|
+
this.dropDownVisible = true;
|
|
250977
|
+
this.generalVisible = true;
|
|
250978
|
+
this.primitivesVisible = false;
|
|
250979
|
+
this.terrainVisible = false;
|
|
250980
|
+
this.depthFrustumText = "";
|
|
250981
|
+
knockout_default.track(this, [
|
|
250982
|
+
"frustums",
|
|
250983
|
+
"frustumPlanes",
|
|
250984
|
+
"performance",
|
|
250985
|
+
"shaderCacheText",
|
|
250986
|
+
"primitiveBoundingSphere",
|
|
250987
|
+
"primitiveReferenceFrame",
|
|
250988
|
+
"filterPrimitive",
|
|
250989
|
+
"tileBoundingSphere",
|
|
250990
|
+
"filterTile",
|
|
250991
|
+
"wireframe",
|
|
250992
|
+
"depthFrustum",
|
|
250993
|
+
"suspendUpdates",
|
|
250994
|
+
"tileCoordinates",
|
|
250995
|
+
"frustumStatisticText",
|
|
250996
|
+
"tileText",
|
|
250997
|
+
"hasPickedPrimitive",
|
|
250998
|
+
"hasPickedTile",
|
|
250999
|
+
"pickPrimitiveActive",
|
|
251000
|
+
"pickTileActive",
|
|
251001
|
+
"dropDownVisible",
|
|
251002
|
+
"generalVisible",
|
|
251003
|
+
"primitivesVisible",
|
|
251004
|
+
"terrainVisible",
|
|
251005
|
+
"depthFrustumText"
|
|
251006
|
+
]);
|
|
251007
|
+
this._toggleDropDown = createCommand_default(function() {
|
|
251008
|
+
that.dropDownVisible = !that.dropDownVisible;
|
|
251009
|
+
});
|
|
251010
|
+
this._toggleGeneral = createCommand_default(function() {
|
|
251011
|
+
that.generalVisible = !that.generalVisible;
|
|
251012
|
+
});
|
|
251013
|
+
this._togglePrimitives = createCommand_default(function() {
|
|
251014
|
+
that.primitivesVisible = !that.primitivesVisible;
|
|
251015
|
+
});
|
|
251016
|
+
this._toggleTerrain = createCommand_default(function() {
|
|
251017
|
+
that.terrainVisible = !that.terrainVisible;
|
|
251018
|
+
});
|
|
251019
|
+
this._frustumsSubscription = knockout_default.getObservable(this, "frustums").subscribe(function(val) {
|
|
251020
|
+
that._scene.debugShowFrustums = val;
|
|
251021
|
+
that._scene.requestRender();
|
|
251022
|
+
});
|
|
251023
|
+
this._frustumPlanesSubscription = knockout_default.getObservable(this, "frustumPlanes").subscribe(function(val) {
|
|
251024
|
+
that._scene.debugShowFrustumPlanes = val;
|
|
251025
|
+
that._scene.requestRender();
|
|
251026
|
+
});
|
|
251027
|
+
this._performanceSubscription = knockout_default.getObservable(this, "performance").subscribe(function(val) {
|
|
251028
|
+
if (val) {
|
|
251029
|
+
that._performanceDisplay = new PerformanceDisplay_default({
|
|
251030
|
+
container: that._performanceContainer
|
|
251031
|
+
});
|
|
251032
|
+
} else {
|
|
251033
|
+
that._performanceContainer.innerHTML = "";
|
|
251034
|
+
}
|
|
251035
|
+
});
|
|
251036
|
+
this._showPrimitiveBoundingSphere = createCommand_default(function() {
|
|
251037
|
+
that._primitive.debugShowBoundingVolume = that.primitiveBoundingSphere;
|
|
251038
|
+
that._scene.requestRender();
|
|
251039
|
+
return true;
|
|
251040
|
+
});
|
|
251041
|
+
this._primitiveBoundingSphereSubscription = knockout_default.getObservable(this, "primitiveBoundingSphere").subscribe(function() {
|
|
251042
|
+
that._showPrimitiveBoundingSphere();
|
|
251043
|
+
});
|
|
251044
|
+
this._showPrimitiveReferenceFrame = createCommand_default(function() {
|
|
251045
|
+
if (that.primitiveReferenceFrame) {
|
|
251046
|
+
const modelMatrix = that._primitive.modelMatrix;
|
|
251047
|
+
that._modelMatrixPrimitive = new DebugModelMatrixPrimitive_default({
|
|
251048
|
+
modelMatrix
|
|
251049
|
+
});
|
|
251050
|
+
that._scene.primitives.add(that._modelMatrixPrimitive);
|
|
251051
|
+
} else if (defined_default(that._modelMatrixPrimitive)) {
|
|
251052
|
+
that._scene.primitives.remove(that._modelMatrixPrimitive);
|
|
251053
|
+
that._modelMatrixPrimitive = void 0;
|
|
251054
|
+
}
|
|
251055
|
+
that._scene.requestRender();
|
|
251056
|
+
return true;
|
|
251057
|
+
});
|
|
251058
|
+
this._primitiveReferenceFrameSubscription = knockout_default.getObservable(this, "primitiveReferenceFrame").subscribe(function() {
|
|
251059
|
+
that._showPrimitiveReferenceFrame();
|
|
251060
|
+
});
|
|
251061
|
+
this._doFilterPrimitive = createCommand_default(function() {
|
|
251062
|
+
if (that.filterPrimitive) {
|
|
251063
|
+
that._scene.debugCommandFilter = function(command) {
|
|
251064
|
+
if (defined_default(that._modelMatrixPrimitive) && command.owner === that._modelMatrixPrimitive._primitive) {
|
|
251065
|
+
return true;
|
|
251066
|
+
} else if (defined_default(that._primitive)) {
|
|
251067
|
+
return command.owner === that._primitive || command.owner === that._primitive._billboardCollection || command.owner.primitive === that._primitive;
|
|
251068
|
+
}
|
|
251069
|
+
return false;
|
|
251070
|
+
};
|
|
251071
|
+
} else {
|
|
251072
|
+
that._scene.debugCommandFilter = void 0;
|
|
251073
|
+
}
|
|
251074
|
+
return true;
|
|
251075
|
+
});
|
|
251076
|
+
this._filterPrimitiveSubscription = knockout_default.getObservable(this, "filterPrimitive").subscribe(function() {
|
|
251077
|
+
that._doFilterPrimitive();
|
|
251078
|
+
that._scene.requestRender();
|
|
251079
|
+
});
|
|
251080
|
+
this._wireframeSubscription = knockout_default.getObservable(this, "wireframe").subscribe(function(val) {
|
|
251081
|
+
globe._surface.tileProvider._debug.wireframe = val;
|
|
251082
|
+
that._scene.requestRender();
|
|
251083
|
+
});
|
|
251084
|
+
this._depthFrustumSubscription = knockout_default.getObservable(this, "depthFrustum").subscribe(function(val) {
|
|
251085
|
+
that._scene.debugShowDepthFrustum = val;
|
|
251086
|
+
that._scene.requestRender();
|
|
251087
|
+
});
|
|
251088
|
+
this._incrementDepthFrustum = createCommand_default(function() {
|
|
251089
|
+
const next = that.depthFrustum + 1;
|
|
251090
|
+
that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);
|
|
251091
|
+
that._scene.requestRender();
|
|
251092
|
+
return true;
|
|
251093
|
+
});
|
|
251094
|
+
this._decrementDepthFrustum = createCommand_default(function() {
|
|
251095
|
+
const next = that.depthFrustum - 1;
|
|
251096
|
+
that.depthFrustum = boundDepthFrustum(1, that._numberOfFrustums, next);
|
|
251097
|
+
that._scene.requestRender();
|
|
251098
|
+
return true;
|
|
251099
|
+
});
|
|
251100
|
+
this._suspendUpdatesSubscription = knockout_default.getObservable(this, "suspendUpdates").subscribe(function(val) {
|
|
251101
|
+
globe._surface._debug.suspendLodUpdate = val;
|
|
251102
|
+
if (!val) {
|
|
251103
|
+
that.filterTile = false;
|
|
251104
|
+
}
|
|
251105
|
+
});
|
|
251106
|
+
let tileBoundariesLayer;
|
|
251107
|
+
this._showTileCoordinates = createCommand_default(function() {
|
|
251108
|
+
if (that.tileCoordinates && !defined_default(tileBoundariesLayer)) {
|
|
251109
|
+
tileBoundariesLayer = scene.imageryLayers.addImageryProvider(
|
|
251110
|
+
new TileCoordinatesImageryProvider_default({
|
|
251111
|
+
tilingScheme: scene.terrainProvider.tilingScheme
|
|
251112
|
+
})
|
|
251113
|
+
);
|
|
251114
|
+
} else if (!that.tileCoordinates && defined_default(tileBoundariesLayer)) {
|
|
251115
|
+
scene.imageryLayers.remove(tileBoundariesLayer);
|
|
251116
|
+
tileBoundariesLayer = void 0;
|
|
251117
|
+
}
|
|
251118
|
+
return true;
|
|
251119
|
+
});
|
|
251120
|
+
this._tileCoordinatesSubscription = knockout_default.getObservable(this, "tileCoordinates").subscribe(function() {
|
|
251121
|
+
that._showTileCoordinates();
|
|
251122
|
+
that._scene.requestRender();
|
|
251123
|
+
});
|
|
251124
|
+
this._tileBoundingSphereSubscription = knockout_default.getObservable(this, "tileBoundingSphere").subscribe(function() {
|
|
251125
|
+
that._showTileBoundingSphere();
|
|
251126
|
+
that._scene.requestRender();
|
|
251127
|
+
});
|
|
251128
|
+
this._showTileBoundingSphere = createCommand_default(function() {
|
|
251129
|
+
if (that.tileBoundingSphere) {
|
|
251130
|
+
globe._surface.tileProvider._debug.boundingSphereTile = that._tile;
|
|
251131
|
+
} else {
|
|
251132
|
+
globe._surface.tileProvider._debug.boundingSphereTile = void 0;
|
|
251133
|
+
}
|
|
251134
|
+
that._scene.requestRender();
|
|
251135
|
+
return true;
|
|
251136
|
+
});
|
|
251137
|
+
this._doFilterTile = createCommand_default(function() {
|
|
251138
|
+
if (!that.filterTile) {
|
|
251139
|
+
that.suspendUpdates = false;
|
|
251140
|
+
} else {
|
|
251141
|
+
that.suspendUpdates = true;
|
|
251142
|
+
globe._surface._tilesToRender = [];
|
|
251143
|
+
if (defined_default(that._tile) && that._tile.renderable) {
|
|
251144
|
+
globe._surface._tilesToRender.push(that._tile);
|
|
251145
|
+
}
|
|
251146
|
+
}
|
|
251147
|
+
return true;
|
|
251148
|
+
});
|
|
251149
|
+
this._filterTileSubscription = knockout_default.getObservable(this, "filterTile").subscribe(function() {
|
|
251150
|
+
that.doFilterTile();
|
|
251151
|
+
that._scene.requestRender();
|
|
251152
|
+
});
|
|
251153
|
+
function pickPrimitive(e) {
|
|
251154
|
+
const newPick = that._scene.pick({
|
|
251155
|
+
x: e.position.x,
|
|
251156
|
+
y: e.position.y
|
|
251157
|
+
});
|
|
251158
|
+
if (defined_default(newPick)) {
|
|
251159
|
+
that.primitive = defined_default(newPick.collection) ? newPick.collection : newPick.primitive;
|
|
251160
|
+
}
|
|
251161
|
+
that._scene.requestRender();
|
|
251162
|
+
that.pickPrimitiveActive = false;
|
|
251163
|
+
}
|
|
251164
|
+
this._pickPrimitive = createCommand_default(function() {
|
|
251165
|
+
that.pickPrimitiveActive = !that.pickPrimitiveActive;
|
|
251166
|
+
});
|
|
251167
|
+
this._pickPrimitiveActiveSubscription = knockout_default.getObservable(this, "pickPrimitiveActive").subscribe(function(val) {
|
|
251168
|
+
if (val) {
|
|
251169
|
+
eventHandler.setInputAction(
|
|
251170
|
+
pickPrimitive,
|
|
251171
|
+
ScreenSpaceEventType_default.LEFT_CLICK
|
|
251172
|
+
);
|
|
251173
|
+
} else {
|
|
251174
|
+
eventHandler.removeInputAction(ScreenSpaceEventType_default.LEFT_CLICK);
|
|
251175
|
+
}
|
|
251176
|
+
});
|
|
251177
|
+
function selectTile(e) {
|
|
251178
|
+
let selectedTile;
|
|
251179
|
+
const ellipsoid = globe.ellipsoid;
|
|
251180
|
+
const ray = that._scene.camera.getPickRay(e.position, scratchPickRay2);
|
|
251181
|
+
const cartesian11 = globe.pick(ray, that._scene, scratchPickCartesian3);
|
|
251182
|
+
if (defined_default(cartesian11)) {
|
|
251183
|
+
const cartographic2 = ellipsoid.cartesianToCartographic(cartesian11);
|
|
251184
|
+
const tilesRendered = globe._surface.tileProvider._tilesToRenderByTextureCount;
|
|
251185
|
+
for (let textureCount = 0; !selectedTile && textureCount < tilesRendered.length; ++textureCount) {
|
|
251186
|
+
const tilesRenderedByTextureCount = tilesRendered[textureCount];
|
|
251187
|
+
if (!defined_default(tilesRenderedByTextureCount)) {
|
|
251188
|
+
continue;
|
|
251189
|
+
}
|
|
251190
|
+
for (let tileIndex = 0; !selectedTile && tileIndex < tilesRenderedByTextureCount.length; ++tileIndex) {
|
|
251191
|
+
const tile = tilesRenderedByTextureCount[tileIndex];
|
|
251192
|
+
if (Rectangle_default.contains(tile.rectangle, cartographic2)) {
|
|
251193
|
+
selectedTile = tile;
|
|
251194
|
+
}
|
|
251195
|
+
}
|
|
251196
|
+
}
|
|
251197
|
+
}
|
|
251198
|
+
that.tile = selectedTile;
|
|
251199
|
+
that.pickTileActive = false;
|
|
251200
|
+
}
|
|
251201
|
+
this._pickTile = createCommand_default(function() {
|
|
251202
|
+
that.pickTileActive = !that.pickTileActive;
|
|
251203
|
+
});
|
|
251204
|
+
this._pickTileActiveSubscription = knockout_default.getObservable(this, "pickTileActive").subscribe(function(val) {
|
|
251205
|
+
if (val) {
|
|
251206
|
+
eventHandler.setInputAction(
|
|
251207
|
+
selectTile,
|
|
251208
|
+
ScreenSpaceEventType_default.LEFT_CLICK
|
|
251209
|
+
);
|
|
251210
|
+
} else {
|
|
251211
|
+
eventHandler.removeInputAction(ScreenSpaceEventType_default.LEFT_CLICK);
|
|
251212
|
+
}
|
|
251213
|
+
});
|
|
251214
|
+
this._removePostRenderEvent = scene.postRender.addEventListener(function() {
|
|
251215
|
+
that._update();
|
|
251216
|
+
});
|
|
251217
|
+
}
|
|
251218
|
+
Object.defineProperties(CesiumInspectorViewModel.prototype, {
|
|
251219
|
+
/**
|
|
251220
|
+
* Gets the scene to control.
|
|
251221
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251222
|
+
*
|
|
251223
|
+
* @type {Scene}
|
|
251224
|
+
*/
|
|
251225
|
+
scene: {
|
|
251226
|
+
get: function() {
|
|
251227
|
+
return this._scene;
|
|
251228
|
+
}
|
|
251229
|
+
},
|
|
251230
|
+
/**
|
|
251231
|
+
* Gets the container of the PerformanceDisplay
|
|
251232
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251233
|
+
*
|
|
251234
|
+
* @type {Element}
|
|
251235
|
+
*/
|
|
251236
|
+
performanceContainer: {
|
|
251237
|
+
get: function() {
|
|
251238
|
+
return this._performanceContainer;
|
|
251239
|
+
}
|
|
251240
|
+
},
|
|
251241
|
+
/**
|
|
251242
|
+
* Gets the command to toggle the visibility of the drop down.
|
|
251243
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251244
|
+
*
|
|
251245
|
+
* @type {Command}
|
|
251246
|
+
*/
|
|
251247
|
+
toggleDropDown: {
|
|
251248
|
+
get: function() {
|
|
251249
|
+
return this._toggleDropDown;
|
|
251250
|
+
}
|
|
251251
|
+
},
|
|
251252
|
+
/**
|
|
251253
|
+
* Gets the command to toggle the visibility of a BoundingSphere for a primitive
|
|
251254
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251255
|
+
*
|
|
251256
|
+
* @type {Command}
|
|
251257
|
+
*/
|
|
251258
|
+
showPrimitiveBoundingSphere: {
|
|
251259
|
+
get: function() {
|
|
251260
|
+
return this._showPrimitiveBoundingSphere;
|
|
251261
|
+
}
|
|
251262
|
+
},
|
|
251263
|
+
/**
|
|
251264
|
+
* Gets the command to toggle the visibility of a {@link DebugModelMatrixPrimitive} for the model matrix of a primitive
|
|
251265
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251266
|
+
*
|
|
251267
|
+
* @type {Command}
|
|
251268
|
+
*/
|
|
251269
|
+
showPrimitiveReferenceFrame: {
|
|
251270
|
+
get: function() {
|
|
251271
|
+
return this._showPrimitiveReferenceFrame;
|
|
251272
|
+
}
|
|
251273
|
+
},
|
|
251274
|
+
/**
|
|
251275
|
+
* Gets the command to toggle a filter that renders only a selected primitive
|
|
251276
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251277
|
+
*
|
|
251278
|
+
* @type {Command}
|
|
251279
|
+
*/
|
|
251280
|
+
doFilterPrimitive: {
|
|
251281
|
+
get: function() {
|
|
251282
|
+
return this._doFilterPrimitive;
|
|
251283
|
+
}
|
|
251284
|
+
},
|
|
251285
|
+
/**
|
|
251286
|
+
* Gets the command to increment the depth frustum index to be shown
|
|
251287
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251288
|
+
*
|
|
251289
|
+
* @type {Command}
|
|
251290
|
+
*/
|
|
251291
|
+
incrementDepthFrustum: {
|
|
251292
|
+
get: function() {
|
|
251293
|
+
return this._incrementDepthFrustum;
|
|
251294
|
+
}
|
|
251295
|
+
},
|
|
251296
|
+
/**
|
|
251297
|
+
* Gets the command to decrement the depth frustum index to be shown
|
|
251298
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251299
|
+
*
|
|
251300
|
+
* @type {Command}
|
|
251301
|
+
*/
|
|
251302
|
+
decrementDepthFrustum: {
|
|
251303
|
+
get: function() {
|
|
251304
|
+
return this._decrementDepthFrustum;
|
|
251305
|
+
}
|
|
251306
|
+
},
|
|
251307
|
+
/**
|
|
251308
|
+
* Gets the command to toggle the visibility of tile coordinates
|
|
251309
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251310
|
+
*
|
|
251311
|
+
* @type {Command}
|
|
251312
|
+
*/
|
|
251313
|
+
showTileCoordinates: {
|
|
251314
|
+
get: function() {
|
|
251315
|
+
return this._showTileCoordinates;
|
|
251316
|
+
}
|
|
251317
|
+
},
|
|
251318
|
+
/**
|
|
251319
|
+
* Gets the command to toggle the visibility of a BoundingSphere for a selected tile
|
|
251320
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251321
|
+
*
|
|
251322
|
+
* @type {Command}
|
|
251323
|
+
*/
|
|
251324
|
+
showTileBoundingSphere: {
|
|
251325
|
+
get: function() {
|
|
251326
|
+
return this._showTileBoundingSphere;
|
|
251327
|
+
}
|
|
251328
|
+
},
|
|
251329
|
+
/**
|
|
251330
|
+
* Gets the command to toggle a filter that renders only a selected tile
|
|
251331
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251332
|
+
*
|
|
251333
|
+
* @type {Command}
|
|
251334
|
+
*/
|
|
251335
|
+
doFilterTile: {
|
|
251336
|
+
get: function() {
|
|
251337
|
+
return this._doFilterTile;
|
|
251338
|
+
}
|
|
251339
|
+
},
|
|
251340
|
+
/**
|
|
251341
|
+
* Gets the command to expand and collapse the general section
|
|
251342
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251343
|
+
*
|
|
251344
|
+
* @type {Command}
|
|
251345
|
+
*/
|
|
251346
|
+
toggleGeneral: {
|
|
251347
|
+
get: function() {
|
|
251348
|
+
return this._toggleGeneral;
|
|
251349
|
+
}
|
|
251350
|
+
},
|
|
251351
|
+
/**
|
|
251352
|
+
* Gets the command to expand and collapse the primitives section
|
|
251353
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251354
|
+
*
|
|
251355
|
+
* @type {Command}
|
|
251356
|
+
*/
|
|
251357
|
+
togglePrimitives: {
|
|
251358
|
+
get: function() {
|
|
251359
|
+
return this._togglePrimitives;
|
|
251360
|
+
}
|
|
251361
|
+
},
|
|
251362
|
+
/**
|
|
251363
|
+
* Gets the command to expand and collapse the terrain section
|
|
251364
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251365
|
+
*
|
|
251366
|
+
* @type {Command}
|
|
251367
|
+
*/
|
|
251368
|
+
toggleTerrain: {
|
|
251369
|
+
get: function() {
|
|
251370
|
+
return this._toggleTerrain;
|
|
251371
|
+
}
|
|
251372
|
+
},
|
|
251373
|
+
/**
|
|
251374
|
+
* Gets the command to pick a primitive
|
|
251375
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251376
|
+
*
|
|
251377
|
+
* @type {Command}
|
|
251378
|
+
*/
|
|
251379
|
+
pickPrimitive: {
|
|
251380
|
+
get: function() {
|
|
251381
|
+
return this._pickPrimitive;
|
|
251382
|
+
}
|
|
251383
|
+
},
|
|
251384
|
+
/**
|
|
251385
|
+
* Gets the command to pick a tile
|
|
251386
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251387
|
+
*
|
|
251388
|
+
* @type {Command}
|
|
251389
|
+
*/
|
|
251390
|
+
pickTile: {
|
|
251391
|
+
get: function() {
|
|
251392
|
+
return this._pickTile;
|
|
251393
|
+
}
|
|
251394
|
+
},
|
|
251395
|
+
/**
|
|
251396
|
+
* Gets the command to pick a tile
|
|
251397
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251398
|
+
*
|
|
251399
|
+
* @type {Command}
|
|
251400
|
+
*/
|
|
251401
|
+
selectParent: {
|
|
251402
|
+
get: function() {
|
|
251403
|
+
const that = this;
|
|
251404
|
+
return createCommand_default(function() {
|
|
251405
|
+
that.tile = that.tile.parent;
|
|
251406
|
+
});
|
|
251407
|
+
}
|
|
251408
|
+
},
|
|
251409
|
+
/**
|
|
251410
|
+
* Gets the command to pick a tile
|
|
251411
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251412
|
+
*
|
|
251413
|
+
* @type {Command}
|
|
251414
|
+
*/
|
|
251415
|
+
selectNW: {
|
|
251416
|
+
get: function() {
|
|
251417
|
+
const that = this;
|
|
251418
|
+
return createCommand_default(function() {
|
|
251419
|
+
that.tile = that.tile.northwestChild;
|
|
251420
|
+
});
|
|
251421
|
+
}
|
|
251422
|
+
},
|
|
251423
|
+
/**
|
|
251424
|
+
* Gets the command to pick a tile
|
|
251425
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251426
|
+
*
|
|
251427
|
+
* @type {Command}
|
|
251428
|
+
*/
|
|
251429
|
+
selectNE: {
|
|
251430
|
+
get: function() {
|
|
251431
|
+
const that = this;
|
|
251432
|
+
return createCommand_default(function() {
|
|
251433
|
+
that.tile = that.tile.northeastChild;
|
|
251434
|
+
});
|
|
251435
|
+
}
|
|
251436
|
+
},
|
|
251437
|
+
/**
|
|
251438
|
+
* Gets the command to pick a tile
|
|
251439
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251440
|
+
*
|
|
251441
|
+
* @type {Command}
|
|
251442
|
+
*/
|
|
251443
|
+
selectSW: {
|
|
251444
|
+
get: function() {
|
|
251445
|
+
const that = this;
|
|
251446
|
+
return createCommand_default(function() {
|
|
251447
|
+
that.tile = that.tile.southwestChild;
|
|
251448
|
+
});
|
|
251449
|
+
}
|
|
251450
|
+
},
|
|
251451
|
+
/**
|
|
251452
|
+
* Gets the command to pick a tile
|
|
251453
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251454
|
+
*
|
|
251455
|
+
* @type {Command}
|
|
251456
|
+
*/
|
|
251457
|
+
selectSE: {
|
|
251458
|
+
get: function() {
|
|
251459
|
+
const that = this;
|
|
251460
|
+
return createCommand_default(function() {
|
|
251461
|
+
that.tile = that.tile.southeastChild;
|
|
251462
|
+
});
|
|
251463
|
+
}
|
|
251464
|
+
},
|
|
251465
|
+
/**
|
|
251466
|
+
* Gets or sets the current selected primitive
|
|
251467
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251468
|
+
*
|
|
251469
|
+
* @type {Command}
|
|
251470
|
+
*/
|
|
251471
|
+
primitive: {
|
|
251472
|
+
get: function() {
|
|
251473
|
+
return this._primitive;
|
|
251474
|
+
},
|
|
251475
|
+
set: function(newPrimitive) {
|
|
251476
|
+
const oldPrimitive = this._primitive;
|
|
251477
|
+
if (newPrimitive !== oldPrimitive) {
|
|
251478
|
+
this.hasPickedPrimitive = true;
|
|
251479
|
+
if (defined_default(oldPrimitive)) {
|
|
251480
|
+
oldPrimitive.debugShowBoundingVolume = false;
|
|
251481
|
+
}
|
|
251482
|
+
this._scene.debugCommandFilter = void 0;
|
|
251483
|
+
if (defined_default(this._modelMatrixPrimitive)) {
|
|
251484
|
+
this._scene.primitives.remove(this._modelMatrixPrimitive);
|
|
251485
|
+
this._modelMatrixPrimitive = void 0;
|
|
251486
|
+
}
|
|
251487
|
+
this._primitive = newPrimitive;
|
|
251488
|
+
newPrimitive.show = false;
|
|
251489
|
+
setTimeout(function() {
|
|
251490
|
+
newPrimitive.show = true;
|
|
251491
|
+
}, 50);
|
|
251492
|
+
this.showPrimitiveBoundingSphere();
|
|
251493
|
+
this.showPrimitiveReferenceFrame();
|
|
251494
|
+
this.doFilterPrimitive();
|
|
251495
|
+
}
|
|
251496
|
+
}
|
|
251497
|
+
},
|
|
251498
|
+
/**
|
|
251499
|
+
* Gets or sets the current selected tile
|
|
251500
|
+
* @memberof CesiumInspectorViewModel.prototype
|
|
251501
|
+
*
|
|
251502
|
+
* @type {Command}
|
|
251503
|
+
*/
|
|
251504
|
+
tile: {
|
|
251505
|
+
get: function() {
|
|
251506
|
+
return this._tile;
|
|
251507
|
+
},
|
|
251508
|
+
set: function(newTile) {
|
|
251509
|
+
if (defined_default(newTile)) {
|
|
251510
|
+
this.hasPickedTile = true;
|
|
251511
|
+
const oldTile = this._tile;
|
|
251512
|
+
if (newTile !== oldTile) {
|
|
251513
|
+
this.tileText = `L: ${newTile.level} X: ${newTile.x} Y: ${newTile.y}`;
|
|
251514
|
+
this.tileText += `<br>SW corner: ${newTile.rectangle.west}, ${newTile.rectangle.south}`;
|
|
251515
|
+
this.tileText += `<br>NE corner: ${newTile.rectangle.east}, ${newTile.rectangle.north}`;
|
|
251516
|
+
const data = newTile.data;
|
|
251517
|
+
if (defined_default(data) && defined_default(data.tileBoundingRegion)) {
|
|
251518
|
+
this.tileText += `<br>Min: ${data.tileBoundingRegion.minimumHeight} Max: ${data.tileBoundingRegion.maximumHeight}`;
|
|
251519
|
+
} else {
|
|
251520
|
+
this.tileText += "<br>(Tile is not loaded)";
|
|
251521
|
+
}
|
|
251522
|
+
}
|
|
251523
|
+
this._tile = newTile;
|
|
251524
|
+
this.showTileBoundingSphere();
|
|
251525
|
+
this.doFilterTile();
|
|
251526
|
+
} else {
|
|
251527
|
+
this.hasPickedTile = false;
|
|
251528
|
+
this._tile = void 0;
|
|
251529
|
+
}
|
|
251530
|
+
}
|
|
251531
|
+
}
|
|
251532
|
+
});
|
|
251533
|
+
CesiumInspectorViewModel.prototype._update = function() {
|
|
251534
|
+
if (this.frustums) {
|
|
251535
|
+
this.frustumStatisticText = frustumStatisticsToString(
|
|
251536
|
+
this._scene.debugFrustumStatistics
|
|
251537
|
+
);
|
|
251538
|
+
}
|
|
251539
|
+
const numberOfFrustums = this._scene.numberOfFrustums;
|
|
251540
|
+
this._numberOfFrustums = numberOfFrustums;
|
|
251541
|
+
this.depthFrustum = boundDepthFrustum(1, numberOfFrustums, this.depthFrustum);
|
|
251542
|
+
this.depthFrustumText = `${this.depthFrustum} of ${numberOfFrustums}`;
|
|
251543
|
+
if (this.performance) {
|
|
251544
|
+
this._performanceDisplay.update();
|
|
251545
|
+
}
|
|
251546
|
+
if (this.primitiveReferenceFrame) {
|
|
251547
|
+
this._modelMatrixPrimitive.modelMatrix = this._primitive.modelMatrix;
|
|
251548
|
+
}
|
|
251549
|
+
this.shaderCacheText = `Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`;
|
|
251550
|
+
};
|
|
251551
|
+
CesiumInspectorViewModel.prototype.isDestroyed = function() {
|
|
251552
|
+
return false;
|
|
251553
|
+
};
|
|
251554
|
+
CesiumInspectorViewModel.prototype.destroy = function() {
|
|
251555
|
+
this._eventHandler.destroy();
|
|
251556
|
+
this._removePostRenderEvent();
|
|
251557
|
+
this._frustumsSubscription.dispose();
|
|
251558
|
+
this._frustumPlanesSubscription.dispose();
|
|
251559
|
+
this._performanceSubscription.dispose();
|
|
251560
|
+
this._primitiveBoundingSphereSubscription.dispose();
|
|
251561
|
+
this._primitiveReferenceFrameSubscription.dispose();
|
|
251562
|
+
this._filterPrimitiveSubscription.dispose();
|
|
251563
|
+
this._wireframeSubscription.dispose();
|
|
251564
|
+
this._depthFrustumSubscription.dispose();
|
|
251565
|
+
this._suspendUpdatesSubscription.dispose();
|
|
251566
|
+
this._tileCoordinatesSubscription.dispose();
|
|
251567
|
+
this._tileBoundingSphereSubscription.dispose();
|
|
251568
|
+
this._filterTileSubscription.dispose();
|
|
251569
|
+
this._pickPrimitiveActiveSubscription.dispose();
|
|
251570
|
+
this._pickTileActiveSubscription.dispose();
|
|
251571
|
+
return destroyObject_default(this);
|
|
251572
|
+
};
|
|
251573
|
+
var CesiumInspectorViewModel_default = CesiumInspectorViewModel;
|
|
251574
|
+
|
|
251575
|
+
// packages/widgets/Source/CesiumInspector/CesiumInspector.js
|
|
251576
|
+
function CesiumInspector(container, scene) {
|
|
251577
|
+
if (!defined_default(container)) {
|
|
251578
|
+
throw new DeveloperError_default("container is required.");
|
|
251579
|
+
}
|
|
251580
|
+
if (!defined_default(scene)) {
|
|
251581
|
+
throw new DeveloperError_default("scene is required.");
|
|
251582
|
+
}
|
|
251583
|
+
container = getElement_default(container);
|
|
251584
|
+
const performanceContainer = document.createElement("div");
|
|
251585
|
+
const viewModel = new CesiumInspectorViewModel_default(scene, performanceContainer);
|
|
251586
|
+
this._viewModel = viewModel;
|
|
251587
|
+
this._container = container;
|
|
251588
|
+
const element = document.createElement("div");
|
|
251589
|
+
this._element = element;
|
|
251590
|
+
const text2 = document.createElement("div");
|
|
251591
|
+
text2.textContent = "Cesium Inspector";
|
|
251592
|
+
text2.className = "cesium-cesiumInspector-button";
|
|
251593
|
+
text2.setAttribute("data-bind", "click: toggleDropDown");
|
|
251594
|
+
element.appendChild(text2);
|
|
251595
|
+
element.className = "cesium-cesiumInspector";
|
|
251596
|
+
element.setAttribute(
|
|
251597
|
+
"data-bind",
|
|
251598
|
+
'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'
|
|
251599
|
+
);
|
|
251600
|
+
container.appendChild(this._element);
|
|
251601
|
+
const panel = document.createElement("div");
|
|
251602
|
+
panel.className = "cesium-cesiumInspector-dropDown";
|
|
251603
|
+
element.appendChild(panel);
|
|
251604
|
+
const createSection = InspectorShared_default.createSection;
|
|
251605
|
+
const createCheckbox = InspectorShared_default.createCheckbox;
|
|
251606
|
+
const generalSection = createSection(
|
|
251607
|
+
panel,
|
|
251608
|
+
"General",
|
|
251609
|
+
"generalVisible",
|
|
251610
|
+
"toggleGeneral"
|
|
251611
|
+
);
|
|
251612
|
+
const debugShowFrustums = createCheckbox("Show Frustums", "frustums");
|
|
251613
|
+
const frustumStatistics = document.createElement("div");
|
|
251614
|
+
frustumStatistics.className = "cesium-cesiumInspector-frustumStatistics";
|
|
251615
|
+
frustumStatistics.setAttribute(
|
|
251616
|
+
"data-bind",
|
|
251617
|
+
"visible: frustums, html: frustumStatisticText"
|
|
251618
|
+
);
|
|
251619
|
+
debugShowFrustums.appendChild(frustumStatistics);
|
|
251620
|
+
generalSection.appendChild(debugShowFrustums);
|
|
251621
|
+
generalSection.appendChild(
|
|
251622
|
+
createCheckbox("Show Frustum Planes", "frustumPlanes")
|
|
251623
|
+
);
|
|
251624
|
+
generalSection.appendChild(
|
|
251625
|
+
createCheckbox("Performance Display", "performance")
|
|
251626
|
+
);
|
|
251627
|
+
performanceContainer.className = "cesium-cesiumInspector-performanceDisplay";
|
|
251628
|
+
generalSection.appendChild(performanceContainer);
|
|
251629
|
+
const shaderCacheDisplay = document.createElement("div");
|
|
251630
|
+
shaderCacheDisplay.className = "cesium-cesiumInspector-shaderCache";
|
|
251631
|
+
shaderCacheDisplay.setAttribute("data-bind", "html: shaderCacheText");
|
|
251632
|
+
generalSection.appendChild(shaderCacheDisplay);
|
|
251633
|
+
const depthFrustum = document.createElement("div");
|
|
251634
|
+
generalSection.appendChild(depthFrustum);
|
|
251635
|
+
const gLabel = document.createElement("span");
|
|
251636
|
+
gLabel.setAttribute(
|
|
251637
|
+
"data-bind",
|
|
251638
|
+
'html: " Frustum:"'
|
|
251639
|
+
);
|
|
251640
|
+
depthFrustum.appendChild(gLabel);
|
|
251641
|
+
const gText = document.createElement("span");
|
|
251642
|
+
gText.setAttribute("data-bind", "text: depthFrustumText");
|
|
251643
|
+
depthFrustum.appendChild(gText);
|
|
251644
|
+
const gMinusButton = document.createElement("input");
|
|
251645
|
+
gMinusButton.type = "button";
|
|
251646
|
+
gMinusButton.value = "-";
|
|
251647
|
+
gMinusButton.className = "cesium-cesiumInspector-pickButton";
|
|
251648
|
+
gMinusButton.setAttribute("data-bind", "click: decrementDepthFrustum");
|
|
251649
|
+
depthFrustum.appendChild(gMinusButton);
|
|
251650
|
+
const gPlusButton = document.createElement("input");
|
|
251651
|
+
gPlusButton.type = "button";
|
|
251652
|
+
gPlusButton.value = "+";
|
|
251653
|
+
gPlusButton.className = "cesium-cesiumInspector-pickButton";
|
|
251654
|
+
gPlusButton.setAttribute("data-bind", "click: incrementDepthFrustum");
|
|
251655
|
+
depthFrustum.appendChild(gPlusButton);
|
|
251656
|
+
const primSection = createSection(
|
|
251657
|
+
panel,
|
|
251658
|
+
"Primitives",
|
|
251659
|
+
"primitivesVisible",
|
|
251660
|
+
"togglePrimitives"
|
|
251661
|
+
);
|
|
251662
|
+
const pickPrimRequired = document.createElement("div");
|
|
251663
|
+
pickPrimRequired.className = "cesium-cesiumInspector-pickSection";
|
|
251664
|
+
primSection.appendChild(pickPrimRequired);
|
|
251665
|
+
const pickPrimitiveButton = document.createElement("input");
|
|
251666
|
+
pickPrimitiveButton.type = "button";
|
|
251667
|
+
pickPrimitiveButton.value = "Pick a primitive";
|
|
251668
|
+
pickPrimitiveButton.className = "cesium-cesiumInspector-pickButton";
|
|
251669
|
+
pickPrimitiveButton.setAttribute(
|
|
251670
|
+
"data-bind",
|
|
251671
|
+
'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive'
|
|
251672
|
+
);
|
|
251673
|
+
let buttonWrap = document.createElement("div");
|
|
251674
|
+
buttonWrap.className = "cesium-cesiumInspector-center";
|
|
251675
|
+
buttonWrap.appendChild(pickPrimitiveButton);
|
|
251676
|
+
pickPrimRequired.appendChild(buttonWrap);
|
|
251677
|
+
pickPrimRequired.appendChild(
|
|
251678
|
+
createCheckbox(
|
|
251679
|
+
"Show bounding sphere",
|
|
251680
|
+
"primitiveBoundingSphere",
|
|
251681
|
+
"hasPickedPrimitive"
|
|
251682
|
+
)
|
|
251683
|
+
);
|
|
251684
|
+
pickPrimRequired.appendChild(
|
|
251685
|
+
createCheckbox(
|
|
251686
|
+
"Show reference frame",
|
|
251687
|
+
"primitiveReferenceFrame",
|
|
251688
|
+
"hasPickedPrimitive"
|
|
251689
|
+
)
|
|
251690
|
+
);
|
|
251691
|
+
this._primitiveOnly = createCheckbox(
|
|
251692
|
+
"Show only selected",
|
|
251693
|
+
"filterPrimitive",
|
|
251694
|
+
"hasPickedPrimitive"
|
|
251695
|
+
);
|
|
251696
|
+
pickPrimRequired.appendChild(this._primitiveOnly);
|
|
251697
|
+
const terrainSection = createSection(
|
|
251698
|
+
panel,
|
|
251699
|
+
"Terrain",
|
|
251700
|
+
"terrainVisible",
|
|
251701
|
+
"toggleTerrain"
|
|
251702
|
+
);
|
|
251703
|
+
const pickTileRequired = document.createElement("div");
|
|
251704
|
+
pickTileRequired.className = "cesium-cesiumInspector-pickSection";
|
|
251705
|
+
terrainSection.appendChild(pickTileRequired);
|
|
251706
|
+
const pickTileButton = document.createElement("input");
|
|
251707
|
+
pickTileButton.type = "button";
|
|
251708
|
+
pickTileButton.value = "Pick a tile";
|
|
251709
|
+
pickTileButton.className = "cesium-cesiumInspector-pickButton";
|
|
251710
|
+
pickTileButton.setAttribute(
|
|
251711
|
+
"data-bind",
|
|
251712
|
+
'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'
|
|
251713
|
+
);
|
|
251714
|
+
buttonWrap = document.createElement("div");
|
|
251715
|
+
buttonWrap.appendChild(pickTileButton);
|
|
251716
|
+
buttonWrap.className = "cesium-cesiumInspector-center";
|
|
251717
|
+
pickTileRequired.appendChild(buttonWrap);
|
|
251718
|
+
const tileInfo = document.createElement("div");
|
|
251719
|
+
pickTileRequired.appendChild(tileInfo);
|
|
251720
|
+
const parentTile = document.createElement("input");
|
|
251721
|
+
parentTile.type = "button";
|
|
251722
|
+
parentTile.value = "Parent";
|
|
251723
|
+
parentTile.className = "cesium-cesiumInspector-pickButton";
|
|
251724
|
+
parentTile.setAttribute("data-bind", "click: selectParent");
|
|
251725
|
+
const nwTile = document.createElement("input");
|
|
251726
|
+
nwTile.type = "button";
|
|
251727
|
+
nwTile.value = "NW";
|
|
251728
|
+
nwTile.className = "cesium-cesiumInspector-pickButton";
|
|
251729
|
+
nwTile.setAttribute("data-bind", "click: selectNW");
|
|
251730
|
+
const neTile = document.createElement("input");
|
|
251731
|
+
neTile.type = "button";
|
|
251732
|
+
neTile.value = "NE";
|
|
251733
|
+
neTile.className = "cesium-cesiumInspector-pickButton";
|
|
251734
|
+
neTile.setAttribute("data-bind", "click: selectNE");
|
|
251735
|
+
const swTile = document.createElement("input");
|
|
251736
|
+
swTile.type = "button";
|
|
251737
|
+
swTile.value = "SW";
|
|
251738
|
+
swTile.className = "cesium-cesiumInspector-pickButton";
|
|
251739
|
+
swTile.setAttribute("data-bind", "click: selectSW");
|
|
251740
|
+
const seTile = document.createElement("input");
|
|
251741
|
+
seTile.type = "button";
|
|
251742
|
+
seTile.value = "SE";
|
|
251743
|
+
seTile.className = "cesium-cesiumInspector-pickButton";
|
|
251744
|
+
seTile.setAttribute("data-bind", "click: selectSE");
|
|
251745
|
+
const tileText = document.createElement("div");
|
|
251746
|
+
tileText.className = "cesium-cesiumInspector-tileText";
|
|
251747
|
+
tileInfo.className = "cesium-cesiumInspector-frustumStatistics";
|
|
251748
|
+
tileInfo.appendChild(tileText);
|
|
251749
|
+
tileInfo.setAttribute("data-bind", "visible: hasPickedTile");
|
|
251750
|
+
tileText.setAttribute("data-bind", "html: tileText");
|
|
251751
|
+
const relativeText = document.createElement("div");
|
|
251752
|
+
relativeText.className = "cesium-cesiumInspector-relativeText";
|
|
251753
|
+
relativeText.textContent = "Select relative:";
|
|
251754
|
+
tileInfo.appendChild(relativeText);
|
|
251755
|
+
const table3 = document.createElement("table");
|
|
251756
|
+
const tr1 = document.createElement("tr");
|
|
251757
|
+
const tr2 = document.createElement("tr");
|
|
251758
|
+
const td1 = document.createElement("td");
|
|
251759
|
+
td1.appendChild(parentTile);
|
|
251760
|
+
const td2 = document.createElement("td");
|
|
251761
|
+
td2.appendChild(nwTile);
|
|
251762
|
+
const td3 = document.createElement("td");
|
|
251763
|
+
td3.appendChild(neTile);
|
|
251764
|
+
tr1.appendChild(td1);
|
|
251765
|
+
tr1.appendChild(td2);
|
|
251766
|
+
tr1.appendChild(td3);
|
|
251767
|
+
const td4 = document.createElement("td");
|
|
251768
|
+
const td5 = document.createElement("td");
|
|
251769
|
+
td5.appendChild(swTile);
|
|
251770
|
+
const td6 = document.createElement("td");
|
|
251771
|
+
td6.appendChild(seTile);
|
|
251772
|
+
tr2.appendChild(td4);
|
|
251773
|
+
tr2.appendChild(td5);
|
|
251774
|
+
tr2.appendChild(td6);
|
|
251775
|
+
table3.appendChild(tr1);
|
|
251776
|
+
table3.appendChild(tr2);
|
|
251777
|
+
tileInfo.appendChild(table3);
|
|
251778
|
+
pickTileRequired.appendChild(
|
|
251779
|
+
createCheckbox(
|
|
251780
|
+
"Show bounding volume",
|
|
251781
|
+
"tileBoundingSphere",
|
|
251782
|
+
"hasPickedTile"
|
|
251783
|
+
)
|
|
251784
|
+
);
|
|
251785
|
+
pickTileRequired.appendChild(
|
|
251786
|
+
createCheckbox("Show only selected", "filterTile", "hasPickedTile")
|
|
251787
|
+
);
|
|
251788
|
+
terrainSection.appendChild(createCheckbox("Wireframe", "wireframe"));
|
|
251789
|
+
terrainSection.appendChild(
|
|
251790
|
+
createCheckbox("Suspend LOD update", "suspendUpdates")
|
|
251791
|
+
);
|
|
251792
|
+
terrainSection.appendChild(
|
|
251793
|
+
createCheckbox("Show tile coordinates", "tileCoordinates")
|
|
251794
|
+
);
|
|
251795
|
+
knockout_default.applyBindings(viewModel, this._element);
|
|
251796
|
+
}
|
|
251797
|
+
Object.defineProperties(CesiumInspector.prototype, {
|
|
251798
|
+
/**
|
|
251799
|
+
* Gets the parent container.
|
|
251800
|
+
* @memberof CesiumInspector.prototype
|
|
251801
|
+
*
|
|
251802
|
+
* @type {Element}
|
|
251803
|
+
*/
|
|
251804
|
+
container: {
|
|
251805
|
+
get: function() {
|
|
251806
|
+
return this._container;
|
|
251807
|
+
}
|
|
251808
|
+
},
|
|
251809
|
+
/**
|
|
251810
|
+
* Gets the view model.
|
|
251811
|
+
* @memberof CesiumInspector.prototype
|
|
251812
|
+
*
|
|
251813
|
+
* @type {CesiumInspectorViewModel}
|
|
251814
|
+
*/
|
|
251815
|
+
viewModel: {
|
|
251816
|
+
get: function() {
|
|
251817
|
+
return this._viewModel;
|
|
251818
|
+
}
|
|
251819
|
+
}
|
|
251820
|
+
});
|
|
251821
|
+
CesiumInspector.prototype.isDestroyed = function() {
|
|
251822
|
+
return false;
|
|
251823
|
+
};
|
|
251824
|
+
CesiumInspector.prototype.destroy = function() {
|
|
251825
|
+
knockout_default.cleanNode(this._element);
|
|
251826
|
+
this._container.removeChild(this._element);
|
|
251827
|
+
this.viewModel.destroy();
|
|
251828
|
+
return destroyObject_default(this);
|
|
251829
|
+
};
|
|
251830
|
+
var CesiumInspector_default = CesiumInspector;
|
|
251831
|
+
|
|
251832
|
+
// packages/widgets/Source/HomeButton/HomeButton.js
|
|
251833
251833
|
var import_InlineWorkers1298 = __toESM(require_InlineWorkers(), 1);
|
|
251834
251834
|
|
|
251835
|
-
// packages/widgets/Source/
|
|
251835
|
+
// packages/widgets/Source/HomeButton/HomeButtonViewModel.js
|
|
251836
251836
|
var import_InlineWorkers1297 = __toESM(require_InlineWorkers(), 1);
|
|
251837
|
+
function HomeButtonViewModel(scene, duration) {
|
|
251838
|
+
if (!defined_default(scene)) {
|
|
251839
|
+
throw new DeveloperError_default("scene is required.");
|
|
251840
|
+
}
|
|
251841
|
+
this._scene = scene;
|
|
251842
|
+
this._duration = duration;
|
|
251843
|
+
const that = this;
|
|
251844
|
+
this._command = createCommand_default(function() {
|
|
251845
|
+
that._scene.camera.flyHome(that._duration);
|
|
251846
|
+
});
|
|
251847
|
+
this.tooltip = "View Home";
|
|
251848
|
+
knockout_default.track(this, ["tooltip"]);
|
|
251849
|
+
}
|
|
251850
|
+
Object.defineProperties(HomeButtonViewModel.prototype, {
|
|
251851
|
+
/**
|
|
251852
|
+
* Gets the scene to control.
|
|
251853
|
+
* @memberof HomeButtonViewModel.prototype
|
|
251854
|
+
*
|
|
251855
|
+
* @type {Scene}
|
|
251856
|
+
*/
|
|
251857
|
+
scene: {
|
|
251858
|
+
get: function() {
|
|
251859
|
+
return this._scene;
|
|
251860
|
+
}
|
|
251861
|
+
},
|
|
251862
|
+
/**
|
|
251863
|
+
* Gets the Command that is executed when the button is clicked.
|
|
251864
|
+
* @memberof HomeButtonViewModel.prototype
|
|
251865
|
+
*
|
|
251866
|
+
* @type {Command}
|
|
251867
|
+
*/
|
|
251868
|
+
command: {
|
|
251869
|
+
get: function() {
|
|
251870
|
+
return this._command;
|
|
251871
|
+
}
|
|
251872
|
+
},
|
|
251873
|
+
/**
|
|
251874
|
+
* Gets or sets the the duration of the camera flight in seconds.
|
|
251875
|
+
* A value of zero causes the camera to instantly switch to home view.
|
|
251876
|
+
* The duration will be computed based on the distance when undefined.
|
|
251877
|
+
* @memberof HomeButtonViewModel.prototype
|
|
251878
|
+
*
|
|
251879
|
+
* @type {number|undefined}
|
|
251880
|
+
*/
|
|
251881
|
+
duration: {
|
|
251882
|
+
get: function() {
|
|
251883
|
+
return this._duration;
|
|
251884
|
+
},
|
|
251885
|
+
set: function(value) {
|
|
251886
|
+
if (defined_default(value) && value < 0) {
|
|
251887
|
+
throw new DeveloperError_default("value must be positive.");
|
|
251888
|
+
}
|
|
251889
|
+
this._duration = value;
|
|
251890
|
+
}
|
|
251891
|
+
}
|
|
251892
|
+
});
|
|
251893
|
+
var HomeButtonViewModel_default = HomeButtonViewModel;
|
|
251894
|
+
|
|
251895
|
+
// packages/widgets/Source/HomeButton/HomeButton.js
|
|
251896
|
+
function HomeButton(container, scene, duration) {
|
|
251897
|
+
if (!defined_default(container)) {
|
|
251898
|
+
throw new DeveloperError_default("container is required.");
|
|
251899
|
+
}
|
|
251900
|
+
container = getElement_default(container);
|
|
251901
|
+
const viewModel = new HomeButtonViewModel_default(scene, duration);
|
|
251902
|
+
viewModel._svgPath = "M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";
|
|
251903
|
+
const element = document.createElement("button");
|
|
251904
|
+
element.type = "button";
|
|
251905
|
+
element.className = "cesium-button cesium-toolbar-button cesium-home-button";
|
|
251906
|
+
element.setAttribute(
|
|
251907
|
+
"data-bind",
|
|
251908
|
+
"attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"
|
|
251909
|
+
);
|
|
251910
|
+
container.appendChild(element);
|
|
251911
|
+
knockout_default.applyBindings(viewModel, element);
|
|
251912
|
+
this._container = container;
|
|
251913
|
+
this._viewModel = viewModel;
|
|
251914
|
+
this._element = element;
|
|
251915
|
+
}
|
|
251916
|
+
Object.defineProperties(HomeButton.prototype, {
|
|
251917
|
+
/**
|
|
251918
|
+
* Gets the parent container.
|
|
251919
|
+
* @memberof HomeButton.prototype
|
|
251920
|
+
*
|
|
251921
|
+
* @type {Element}
|
|
251922
|
+
*/
|
|
251923
|
+
container: {
|
|
251924
|
+
get: function() {
|
|
251925
|
+
return this._container;
|
|
251926
|
+
}
|
|
251927
|
+
},
|
|
251928
|
+
/**
|
|
251929
|
+
* Gets the view model.
|
|
251930
|
+
* @memberof HomeButton.prototype
|
|
251931
|
+
*
|
|
251932
|
+
* @type {HomeButtonViewModel}
|
|
251933
|
+
*/
|
|
251934
|
+
viewModel: {
|
|
251935
|
+
get: function() {
|
|
251936
|
+
return this._viewModel;
|
|
251937
|
+
}
|
|
251938
|
+
}
|
|
251939
|
+
});
|
|
251940
|
+
HomeButton.prototype.isDestroyed = function() {
|
|
251941
|
+
return false;
|
|
251942
|
+
};
|
|
251943
|
+
HomeButton.prototype.destroy = function() {
|
|
251944
|
+
knockout_default.cleanNode(this._element);
|
|
251945
|
+
this._container.removeChild(this._element);
|
|
251946
|
+
return destroyObject_default(this);
|
|
251947
|
+
};
|
|
251948
|
+
var HomeButton_default = HomeButton;
|
|
251949
|
+
|
|
251950
|
+
// packages/widgets/Source/FullscreenButton/FullscreenButton.js
|
|
251951
|
+
var import_InlineWorkers1300 = __toESM(require_InlineWorkers(), 1);
|
|
251952
|
+
|
|
251953
|
+
// packages/widgets/Source/FullscreenButton/FullscreenButtonViewModel.js
|
|
251954
|
+
var import_InlineWorkers1299 = __toESM(require_InlineWorkers(), 1);
|
|
251837
251955
|
function FullscreenButtonViewModel(fullscreenElement, container) {
|
|
251838
251956
|
if (!defined_default(container)) {
|
|
251839
251957
|
container = document.body;
|
|
@@ -251981,94 +252099,159 @@ ${terrainTip}`;
|
|
|
251981
252099
|
};
|
|
251982
252100
|
var FullscreenButton_default = FullscreenButton;
|
|
251983
252101
|
|
|
251984
|
-
// packages/widgets/Source/
|
|
251985
|
-
var
|
|
252102
|
+
// packages/widgets/Source/InfoBox/InfoBox.js
|
|
252103
|
+
var import_InlineWorkers1302 = __toESM(require_InlineWorkers(), 1);
|
|
251986
252104
|
|
|
251987
|
-
// packages/widgets/Source/
|
|
251988
|
-
var
|
|
251989
|
-
|
|
251990
|
-
|
|
251991
|
-
|
|
251992
|
-
|
|
251993
|
-
this.
|
|
251994
|
-
this.
|
|
251995
|
-
|
|
251996
|
-
this.
|
|
251997
|
-
|
|
252105
|
+
// packages/widgets/Source/InfoBox/InfoBoxViewModel.js
|
|
252106
|
+
var import_InlineWorkers1301 = __toESM(require_InlineWorkers(), 1);
|
|
252107
|
+
var cameraEnabledPath = "M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z";
|
|
252108
|
+
var cameraDisabledPath = "M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";
|
|
252109
|
+
function InfoBoxViewModel() {
|
|
252110
|
+
this._cameraClicked = new Event_default();
|
|
252111
|
+
this._closeClicked = new Event_default();
|
|
252112
|
+
this.maxHeight = 500;
|
|
252113
|
+
this.enableCamera = false;
|
|
252114
|
+
this.isCameraTracking = false;
|
|
252115
|
+
this.showInfo = false;
|
|
252116
|
+
this.titleText = "";
|
|
252117
|
+
this.description = "";
|
|
252118
|
+
knockout_default.track(this, [
|
|
252119
|
+
"showInfo",
|
|
252120
|
+
"titleText",
|
|
252121
|
+
"description",
|
|
252122
|
+
"maxHeight",
|
|
252123
|
+
"enableCamera",
|
|
252124
|
+
"isCameraTracking"
|
|
252125
|
+
]);
|
|
252126
|
+
this._loadingIndicatorHtml = '<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>';
|
|
252127
|
+
this.cameraIconPath = void 0;
|
|
252128
|
+
knockout_default.defineProperty(this, "cameraIconPath", {
|
|
252129
|
+
get: function() {
|
|
252130
|
+
return !this.enableCamera || this.isCameraTracking ? cameraDisabledPath : cameraEnabledPath;
|
|
252131
|
+
}
|
|
251998
252132
|
});
|
|
251999
|
-
this
|
|
252000
|
-
knockout_default.track(this, ["tooltip"]);
|
|
252001
|
-
}
|
|
252002
|
-
Object.defineProperties(HomeButtonViewModel.prototype, {
|
|
252003
|
-
/**
|
|
252004
|
-
* Gets the scene to control.
|
|
252005
|
-
* @memberof HomeButtonViewModel.prototype
|
|
252006
|
-
*
|
|
252007
|
-
* @type {Scene}
|
|
252008
|
-
*/
|
|
252009
|
-
scene: {
|
|
252133
|
+
knockout_default.defineProperty(this, "_bodyless", {
|
|
252010
252134
|
get: function() {
|
|
252011
|
-
return this.
|
|
252135
|
+
return !defined_default(this.description) || this.description.length === 0;
|
|
252012
252136
|
}
|
|
252013
|
-
}
|
|
252137
|
+
});
|
|
252138
|
+
}
|
|
252139
|
+
InfoBoxViewModel.prototype.maxHeightOffset = function(offset) {
|
|
252140
|
+
return `${this.maxHeight - offset}px`;
|
|
252141
|
+
};
|
|
252142
|
+
Object.defineProperties(InfoBoxViewModel.prototype, {
|
|
252014
252143
|
/**
|
|
252015
|
-
* Gets
|
|
252016
|
-
* @memberof
|
|
252017
|
-
*
|
|
252018
|
-
* @type {Command}
|
|
252144
|
+
* Gets an {@link Event} that is fired when the user clicks the camera icon.
|
|
252145
|
+
* @memberof InfoBoxViewModel.prototype
|
|
252146
|
+
* @type {Event}
|
|
252019
252147
|
*/
|
|
252020
|
-
|
|
252148
|
+
cameraClicked: {
|
|
252021
252149
|
get: function() {
|
|
252022
|
-
return this.
|
|
252150
|
+
return this._cameraClicked;
|
|
252023
252151
|
}
|
|
252024
252152
|
},
|
|
252025
252153
|
/**
|
|
252026
|
-
* Gets
|
|
252027
|
-
*
|
|
252028
|
-
*
|
|
252029
|
-
* @memberof HomeButtonViewModel.prototype
|
|
252030
|
-
*
|
|
252031
|
-
* @type {number|undefined}
|
|
252154
|
+
* Gets an {@link Event} that is fired when the user closes the info box.
|
|
252155
|
+
* @memberof InfoBoxViewModel.prototype
|
|
252156
|
+
* @type {Event}
|
|
252032
252157
|
*/
|
|
252033
|
-
|
|
252158
|
+
closeClicked: {
|
|
252034
252159
|
get: function() {
|
|
252035
|
-
return this.
|
|
252036
|
-
},
|
|
252037
|
-
set: function(value) {
|
|
252038
|
-
if (defined_default(value) && value < 0) {
|
|
252039
|
-
throw new DeveloperError_default("value must be positive.");
|
|
252040
|
-
}
|
|
252041
|
-
this._duration = value;
|
|
252160
|
+
return this._closeClicked;
|
|
252042
252161
|
}
|
|
252043
252162
|
}
|
|
252044
252163
|
});
|
|
252045
|
-
var
|
|
252164
|
+
var InfoBoxViewModel_default = InfoBoxViewModel;
|
|
252046
252165
|
|
|
252047
|
-
// packages/widgets/Source/
|
|
252048
|
-
function
|
|
252049
|
-
|
|
252050
|
-
throw new DeveloperError_default("container is required.");
|
|
252051
|
-
}
|
|
252166
|
+
// packages/widgets/Source/InfoBox/InfoBox.js
|
|
252167
|
+
function InfoBox(container) {
|
|
252168
|
+
Check_default.defined("container", container);
|
|
252052
252169
|
container = getElement_default(container);
|
|
252053
|
-
const
|
|
252054
|
-
|
|
252055
|
-
|
|
252056
|
-
element.type = "button";
|
|
252057
|
-
element.className = "cesium-button cesium-toolbar-button cesium-home-button";
|
|
252058
|
-
element.setAttribute(
|
|
252170
|
+
const infoElement = document.createElement("div");
|
|
252171
|
+
infoElement.className = "cesium-infoBox";
|
|
252172
|
+
infoElement.setAttribute(
|
|
252059
252173
|
"data-bind",
|
|
252060
|
-
|
|
252174
|
+
'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'
|
|
252061
252175
|
);
|
|
252062
|
-
container.appendChild(
|
|
252063
|
-
|
|
252176
|
+
container.appendChild(infoElement);
|
|
252177
|
+
const titleElement = document.createElement("div");
|
|
252178
|
+
titleElement.className = "cesium-infoBox-title";
|
|
252179
|
+
titleElement.setAttribute("data-bind", "text: titleText");
|
|
252180
|
+
infoElement.appendChild(titleElement);
|
|
252181
|
+
const cameraElement = document.createElement("button");
|
|
252182
|
+
cameraElement.type = "button";
|
|
252183
|
+
cameraElement.className = "cesium-button cesium-infoBox-camera";
|
|
252184
|
+
cameraElement.setAttribute(
|
|
252185
|
+
"data-bind",
|
|
252186
|
+
'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'
|
|
252187
|
+
);
|
|
252188
|
+
infoElement.appendChild(cameraElement);
|
|
252189
|
+
const closeElement = document.createElement("button");
|
|
252190
|
+
closeElement.type = "button";
|
|
252191
|
+
closeElement.className = "cesium-infoBox-close";
|
|
252192
|
+
closeElement.setAttribute(
|
|
252193
|
+
"data-bind",
|
|
252194
|
+
"click: function () { closeClicked.raiseEvent(this); }"
|
|
252195
|
+
);
|
|
252196
|
+
closeElement.innerHTML = "×";
|
|
252197
|
+
infoElement.appendChild(closeElement);
|
|
252198
|
+
const frame = document.createElement("iframe");
|
|
252199
|
+
frame.className = "cesium-infoBox-iframe";
|
|
252200
|
+
frame.setAttribute("sandbox", "allow-same-origin allow-popups allow-forms");
|
|
252201
|
+
frame.setAttribute(
|
|
252202
|
+
"data-bind",
|
|
252203
|
+
"style : { maxHeight : maxHeightOffset(40) }"
|
|
252204
|
+
);
|
|
252205
|
+
frame.setAttribute("allowfullscreen", true);
|
|
252206
|
+
infoElement.appendChild(frame);
|
|
252207
|
+
const viewModel = new InfoBoxViewModel_default();
|
|
252208
|
+
knockout_default.applyBindings(viewModel, infoElement);
|
|
252064
252209
|
this._container = container;
|
|
252210
|
+
this._element = infoElement;
|
|
252211
|
+
this._frame = frame;
|
|
252065
252212
|
this._viewModel = viewModel;
|
|
252066
|
-
this.
|
|
252213
|
+
this._descriptionSubscription = void 0;
|
|
252214
|
+
const that = this;
|
|
252215
|
+
frame.addEventListener("load", function() {
|
|
252216
|
+
const frameDocument = frame.contentDocument;
|
|
252217
|
+
const cssLink = frameDocument.createElement("link");
|
|
252218
|
+
cssLink.href = buildModuleUrl_default("Widgets/InfoBox/InfoBoxDescription.css");
|
|
252219
|
+
cssLink.rel = "stylesheet";
|
|
252220
|
+
cssLink.type = "text/css";
|
|
252221
|
+
const frameContent = frameDocument.createElement("div");
|
|
252222
|
+
frameContent.className = "cesium-infoBox-description";
|
|
252223
|
+
frameDocument.head.appendChild(cssLink);
|
|
252224
|
+
frameDocument.body.appendChild(frameContent);
|
|
252225
|
+
that._descriptionSubscription = subscribeAndEvaluate_default(
|
|
252226
|
+
viewModel,
|
|
252227
|
+
"description",
|
|
252228
|
+
function(value) {
|
|
252229
|
+
frame.style.height = "5px";
|
|
252230
|
+
frameContent.innerHTML = value;
|
|
252231
|
+
let background = null;
|
|
252232
|
+
const firstElementChild = frameContent.firstElementChild;
|
|
252233
|
+
if (firstElementChild !== null && frameContent.childNodes.length === 1) {
|
|
252234
|
+
const style = window.getComputedStyle(firstElementChild);
|
|
252235
|
+
if (style !== null) {
|
|
252236
|
+
const backgroundColor = style["background-color"];
|
|
252237
|
+
const color = Color_default.fromCssColorString(backgroundColor);
|
|
252238
|
+
if (defined_default(color) && color.alpha !== 0) {
|
|
252239
|
+
background = style["background-color"];
|
|
252240
|
+
}
|
|
252241
|
+
}
|
|
252242
|
+
}
|
|
252243
|
+
infoElement.style["background-color"] = background;
|
|
252244
|
+
const height = frameContent.getBoundingClientRect().height;
|
|
252245
|
+
frame.style.height = `${height}px`;
|
|
252246
|
+
}
|
|
252247
|
+
);
|
|
252248
|
+
});
|
|
252249
|
+
frame.setAttribute("src", "about:blank");
|
|
252067
252250
|
}
|
|
252068
|
-
Object.defineProperties(
|
|
252251
|
+
Object.defineProperties(InfoBox.prototype, {
|
|
252069
252252
|
/**
|
|
252070
252253
|
* Gets the parent container.
|
|
252071
|
-
* @memberof
|
|
252254
|
+
* @memberof InfoBox.prototype
|
|
252072
252255
|
*
|
|
252073
252256
|
* @type {Element}
|
|
252074
252257
|
*/
|
|
@@ -252079,31 +252262,46 @@ ${terrainTip}`;
|
|
|
252079
252262
|
},
|
|
252080
252263
|
/**
|
|
252081
252264
|
* Gets the view model.
|
|
252082
|
-
* @memberof
|
|
252265
|
+
* @memberof InfoBox.prototype
|
|
252083
252266
|
*
|
|
252084
|
-
* @type {
|
|
252267
|
+
* @type {InfoBoxViewModel}
|
|
252085
252268
|
*/
|
|
252086
252269
|
viewModel: {
|
|
252087
252270
|
get: function() {
|
|
252088
252271
|
return this._viewModel;
|
|
252089
252272
|
}
|
|
252273
|
+
},
|
|
252274
|
+
/**
|
|
252275
|
+
* Gets the iframe used to display the description.
|
|
252276
|
+
* @memberof InfoBox.prototype
|
|
252277
|
+
*
|
|
252278
|
+
* @type {HTMLIFrameElement}
|
|
252279
|
+
*/
|
|
252280
|
+
frame: {
|
|
252281
|
+
get: function() {
|
|
252282
|
+
return this._frame;
|
|
252283
|
+
}
|
|
252090
252284
|
}
|
|
252091
252285
|
});
|
|
252092
|
-
|
|
252286
|
+
InfoBox.prototype.isDestroyed = function() {
|
|
252093
252287
|
return false;
|
|
252094
252288
|
};
|
|
252095
|
-
|
|
252289
|
+
InfoBox.prototype.destroy = function() {
|
|
252290
|
+
const container = this._container;
|
|
252096
252291
|
knockout_default.cleanNode(this._element);
|
|
252097
|
-
|
|
252292
|
+
container.removeChild(this._element);
|
|
252293
|
+
if (defined_default(this._descriptionSubscription)) {
|
|
252294
|
+
this._descriptionSubscription.dispose();
|
|
252295
|
+
}
|
|
252098
252296
|
return destroyObject_default(this);
|
|
252099
252297
|
};
|
|
252100
|
-
var
|
|
252298
|
+
var InfoBox_default = InfoBox;
|
|
252101
252299
|
|
|
252102
252300
|
// packages/widgets/Source/Geocoder/Geocoder.js
|
|
252103
|
-
var
|
|
252301
|
+
var import_InlineWorkers1304 = __toESM(require_InlineWorkers(), 1);
|
|
252104
252302
|
|
|
252105
252303
|
// packages/widgets/Source/Geocoder/GeocoderViewModel.js
|
|
252106
|
-
var
|
|
252304
|
+
var import_InlineWorkers1303 = __toESM(require_InlineWorkers(), 1);
|
|
252107
252305
|
var DEFAULT_HEIGHT = 1e3;
|
|
252108
252306
|
function GeocoderViewModel(options) {
|
|
252109
252307
|
if (!defined_default(options) || !defined_default(options.scene)) {
|
|
@@ -252540,730 +252738,82 @@ ${terrainTip}`;
|
|
|
252540
252738
|
viewModel._stopSearchPath = stopSearchPath;
|
|
252541
252739
|
const form = document.createElement("form");
|
|
252542
252740
|
form.setAttribute("data-bind", "submit: search");
|
|
252543
|
-
const textBox = document.createElement("input");
|
|
252544
|
-
textBox.type = "search";
|
|
252545
|
-
textBox.className = "cesium-geocoder-input";
|
|
252546
|
-
textBox.setAttribute("placeholder", "Enter an address or landmark...");
|
|
252547
|
-
textBox.setAttribute(
|
|
252548
|
-
"data-bind",
|
|
252549
|
-
'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'
|
|
252550
|
-
);
|
|
252551
|
-
this._onTextBoxFocus = function() {
|
|
252552
|
-
setTimeout(function() {
|
|
252553
|
-
textBox.select();
|
|
252554
|
-
}, 0);
|
|
252555
|
-
};
|
|
252556
|
-
textBox.addEventListener("focus", this._onTextBoxFocus, false);
|
|
252557
|
-
form.appendChild(textBox);
|
|
252558
|
-
this._textBox = textBox;
|
|
252559
|
-
const searchButton = document.createElement("span");
|
|
252560
|
-
searchButton.className = "cesium-geocoder-searchButton";
|
|
252561
|
-
searchButton.setAttribute(
|
|
252562
|
-
"data-bind",
|
|
252563
|
-
"click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"
|
|
252564
|
-
);
|
|
252565
|
-
form.appendChild(searchButton);
|
|
252566
|
-
container.appendChild(form);
|
|
252567
|
-
const searchSuggestionsContainer = document.createElement("div");
|
|
252568
|
-
searchSuggestionsContainer.className = "search-results";
|
|
252569
|
-
searchSuggestionsContainer.setAttribute(
|
|
252570
|
-
"data-bind",
|
|
252571
|
-
"visible: _suggestionsVisible"
|
|
252572
|
-
);
|
|
252573
|
-
const suggestionsList = document.createElement("ul");
|
|
252574
|
-
suggestionsList.setAttribute("data-bind", "foreach: _suggestions");
|
|
252575
|
-
const suggestions = document.createElement("li");
|
|
252576
|
-
suggestionsList.appendChild(suggestions);
|
|
252577
|
-
suggestions.setAttribute(
|
|
252578
|
-
"data-bind",
|
|
252579
|
-
"text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"
|
|
252580
|
-
);
|
|
252581
|
-
searchSuggestionsContainer.appendChild(suggestionsList);
|
|
252582
|
-
container.appendChild(searchSuggestionsContainer);
|
|
252583
|
-
knockout_default.applyBindings(viewModel, form);
|
|
252584
|
-
knockout_default.applyBindings(viewModel, searchSuggestionsContainer);
|
|
252585
|
-
this._container = container;
|
|
252586
|
-
this._searchSuggestionsContainer = searchSuggestionsContainer;
|
|
252587
|
-
this._viewModel = viewModel;
|
|
252588
|
-
this._form = form;
|
|
252589
|
-
this._onInputBegin = function(e) {
|
|
252590
|
-
let target = e.target;
|
|
252591
|
-
if (typeof e.composedPath === "function") {
|
|
252592
|
-
target = e.composedPath()[0];
|
|
252593
|
-
}
|
|
252594
|
-
if (!container.contains(target)) {
|
|
252595
|
-
viewModel._focusTextbox = false;
|
|
252596
|
-
viewModel.hideSuggestions();
|
|
252597
|
-
}
|
|
252598
|
-
};
|
|
252599
|
-
this._onInputEnd = function(e) {
|
|
252600
|
-
viewModel._focusTextbox = true;
|
|
252601
|
-
viewModel.showSuggestions();
|
|
252602
|
-
};
|
|
252603
|
-
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
252604
|
-
document.addEventListener("pointerdown", this._onInputBegin, true);
|
|
252605
|
-
container.addEventListener("pointerup", this._onInputEnd, true);
|
|
252606
|
-
container.addEventListener("pointercancel", this._onInputEnd, true);
|
|
252607
|
-
} else {
|
|
252608
|
-
document.addEventListener("mousedown", this._onInputBegin, true);
|
|
252609
|
-
container.addEventListener("mouseup", this._onInputEnd, true);
|
|
252610
|
-
document.addEventListener("touchstart", this._onInputBegin, true);
|
|
252611
|
-
container.addEventListener("touchend", this._onInputEnd, true);
|
|
252612
|
-
container.addEventListener("touchcancel", this._onInputEnd, true);
|
|
252613
|
-
}
|
|
252614
|
-
}
|
|
252615
|
-
Object.defineProperties(Geocoder.prototype, {
|
|
252616
|
-
/**
|
|
252617
|
-
* Gets the parent container.
|
|
252618
|
-
* @memberof Geocoder.prototype
|
|
252619
|
-
*
|
|
252620
|
-
* @type {Element}
|
|
252621
|
-
*/
|
|
252622
|
-
container: {
|
|
252623
|
-
get: function() {
|
|
252624
|
-
return this._container;
|
|
252625
|
-
}
|
|
252626
|
-
},
|
|
252627
|
-
/**
|
|
252628
|
-
* Gets the parent container.
|
|
252629
|
-
* @memberof Geocoder.prototype
|
|
252630
|
-
*
|
|
252631
|
-
* @type {Element}
|
|
252632
|
-
*/
|
|
252633
|
-
searchSuggestionsContainer: {
|
|
252634
|
-
get: function() {
|
|
252635
|
-
return this._searchSuggestionsContainer;
|
|
252636
|
-
}
|
|
252637
|
-
},
|
|
252638
|
-
/**
|
|
252639
|
-
* Gets the view model.
|
|
252640
|
-
* @memberof Geocoder.prototype
|
|
252641
|
-
*
|
|
252642
|
-
* @type {GeocoderViewModel}
|
|
252643
|
-
*/
|
|
252644
|
-
viewModel: {
|
|
252645
|
-
get: function() {
|
|
252646
|
-
return this._viewModel;
|
|
252647
|
-
}
|
|
252648
|
-
}
|
|
252649
|
-
});
|
|
252650
|
-
Geocoder.prototype.isDestroyed = function() {
|
|
252651
|
-
return false;
|
|
252652
|
-
};
|
|
252653
|
-
Geocoder.prototype.destroy = function() {
|
|
252654
|
-
const container = this._container;
|
|
252655
|
-
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
252656
|
-
document.removeEventListener("pointerdown", this._onInputBegin, true);
|
|
252657
|
-
container.removeEventListener("pointerup", this._onInputEnd, true);
|
|
252658
|
-
} else {
|
|
252659
|
-
document.removeEventListener("mousedown", this._onInputBegin, true);
|
|
252660
|
-
container.removeEventListener("mouseup", this._onInputEnd, true);
|
|
252661
|
-
document.removeEventListener("touchstart", this._onInputBegin, true);
|
|
252662
|
-
container.removeEventListener("touchend", this._onInputEnd, true);
|
|
252663
|
-
}
|
|
252664
|
-
this._viewModel.destroy();
|
|
252665
|
-
knockout_default.cleanNode(this._form);
|
|
252666
|
-
knockout_default.cleanNode(this._searchSuggestionsContainer);
|
|
252667
|
-
container.removeChild(this._form);
|
|
252668
|
-
container.removeChild(this._searchSuggestionsContainer);
|
|
252669
|
-
this._textBox.removeEventListener("focus", this._onTextBoxFocus, false);
|
|
252670
|
-
return destroyObject_default(this);
|
|
252671
|
-
};
|
|
252672
|
-
var Geocoder_default = Geocoder;
|
|
252673
|
-
|
|
252674
|
-
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.js
|
|
252675
|
-
var import_InlineWorkers1304 = __toESM(require_InlineWorkers(), 1);
|
|
252676
|
-
|
|
252677
|
-
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js
|
|
252678
|
-
var import_InlineWorkers1303 = __toESM(require_InlineWorkers(), 1);
|
|
252679
|
-
function expandItemsHandler(data, event) {
|
|
252680
|
-
const nestedList = event.currentTarget.parentElement.parentElement.querySelector(
|
|
252681
|
-
`#${data.name}-expander`
|
|
252682
|
-
);
|
|
252683
|
-
nestedList.classList.toggle("active");
|
|
252684
|
-
event.currentTarget.textContent = event.currentTarget.textContent === "+" ? "-" : "+";
|
|
252685
|
-
}
|
|
252686
|
-
function trackSublayer(sublayer, viewModel) {
|
|
252687
|
-
knockout_default.track(sublayer);
|
|
252688
|
-
for (let i = 0; i < sublayer.sublayers.length; i++) {
|
|
252689
|
-
trackSublayer(sublayer.sublayers[i], viewModel);
|
|
252690
|
-
}
|
|
252691
|
-
}
|
|
252692
|
-
function isFullModel(layer) {
|
|
252693
|
-
return layer.modelName === "FullModel";
|
|
252694
|
-
}
|
|
252695
|
-
function isOverview(layer) {
|
|
252696
|
-
return layer.modelName === "Overview";
|
|
252697
|
-
}
|
|
252698
|
-
function isTopLayer(layer) {
|
|
252699
|
-
return isOverview(layer) || isFullModel(layer);
|
|
252700
|
-
}
|
|
252701
|
-
function addTopLayer(layer, viewModel) {
|
|
252702
|
-
if (isTopLayer(layer)) {
|
|
252703
|
-
layer.visibility = false;
|
|
252704
|
-
for (let i = 0; i < layer.sublayers.length; i++) {
|
|
252705
|
-
layer.sublayers[i].visibility = true;
|
|
252706
|
-
}
|
|
252707
|
-
const topLayer = {
|
|
252708
|
-
name: layer.name,
|
|
252709
|
-
modelName: layer.modelName,
|
|
252710
|
-
disable: knockout_default.observable(false),
|
|
252711
|
-
index: viewModel.sublayers.length
|
|
252712
|
-
};
|
|
252713
|
-
viewModel.topLayers.push(topLayer);
|
|
252714
|
-
viewModel.sublayers.push(layer);
|
|
252715
|
-
return topLayer;
|
|
252716
|
-
}
|
|
252717
|
-
}
|
|
252718
|
-
function handleTopLayerSelector(layer, viewModel) {
|
|
252719
|
-
if (isTopLayer(layer)) {
|
|
252720
|
-
viewModel.sublayers.forEach((elem) => elem.visibility = false);
|
|
252721
|
-
viewModel.sublayers[layer.index].visibility = true;
|
|
252722
|
-
const bsl = document.getElementById("bsl-wrapper");
|
|
252723
|
-
if (isFullModel(layer)) {
|
|
252724
|
-
viewModel.currentLevel = viewModel.selectedLevel;
|
|
252725
|
-
bsl.style.display = "block";
|
|
252726
|
-
} else {
|
|
252727
|
-
viewModel.selectedLevel = viewModel.currentLevel;
|
|
252728
|
-
viewModel.currentLevel = "All";
|
|
252729
|
-
bsl.style.display = "none";
|
|
252730
|
-
}
|
|
252731
|
-
}
|
|
252732
|
-
}
|
|
252733
|
-
async function setLevels(i3sProvider, levels) {
|
|
252734
|
-
try {
|
|
252735
|
-
const attributes = i3sProvider.getAttributeNames();
|
|
252736
|
-
for (let index = 0; index < attributes.length; index++) {
|
|
252737
|
-
if (attributes[index] === "BldgLevel") {
|
|
252738
|
-
const values = i3sProvider.getAttributeValues(attributes[index]);
|
|
252739
|
-
for (let i = 0; i < values.length; i++) {
|
|
252740
|
-
levels.push(values[i]);
|
|
252741
|
-
}
|
|
252742
|
-
}
|
|
252743
|
-
}
|
|
252744
|
-
levels.sort((a3, b) => a3 - b);
|
|
252745
|
-
levels.unshift("All");
|
|
252746
|
-
} catch (error) {
|
|
252747
|
-
console.log(`There was an error getting attributes: ${error}`);
|
|
252748
|
-
}
|
|
252749
|
-
}
|
|
252750
|
-
function I3SBuildingSceneLayerExplorerViewModel(i3sProvider) {
|
|
252751
|
-
const that = this;
|
|
252752
|
-
this.levels = [];
|
|
252753
|
-
this.viewModel = {
|
|
252754
|
-
sublayers: [],
|
|
252755
|
-
levels: this.levels,
|
|
252756
|
-
currentLevel: knockout_default.observable(),
|
|
252757
|
-
selectedLevel: "All",
|
|
252758
|
-
topLayers: [
|
|
252759
|
-
{
|
|
252760
|
-
name: "Select a layer to explore...",
|
|
252761
|
-
disable: knockout_default.observable(true),
|
|
252762
|
-
index: -1
|
|
252763
|
-
}
|
|
252764
|
-
],
|
|
252765
|
-
currentLayer: knockout_default.observable(),
|
|
252766
|
-
expandClickHandler: expandItemsHandler,
|
|
252767
|
-
setOptionDisable: function(option, item) {
|
|
252768
|
-
knockout_default.applyBindingsToNode(option, { disable: item.disable }, item);
|
|
252769
|
-
},
|
|
252770
|
-
defaultLayer: void 0
|
|
252771
|
-
};
|
|
252772
|
-
this.viewModel.currentLayer.subscribe(function(layer) {
|
|
252773
|
-
handleTopLayerSelector(layer, that.viewModel);
|
|
252774
|
-
});
|
|
252775
|
-
const sublayers = i3sProvider.sublayers;
|
|
252776
|
-
for (let i = 0; i < sublayers.length; i++) {
|
|
252777
|
-
trackSublayer(sublayers[i], this.viewModel);
|
|
252778
|
-
const topLayer = addTopLayer(sublayers[i], this.viewModel);
|
|
252779
|
-
if (defined_default(topLayer) && (isOverview(topLayer) || !defined_default(this.viewModel.defaultLayer) && isFullModel(topLayer))) {
|
|
252780
|
-
this.viewModel.defaultLayer = topLayer;
|
|
252781
|
-
}
|
|
252782
|
-
}
|
|
252783
|
-
if (this.viewModel.topLayers.length === 1 && sublayers.length > 0) {
|
|
252784
|
-
i3sProvider.show = false;
|
|
252785
|
-
const fullModel = {
|
|
252786
|
-
name: "Full Model",
|
|
252787
|
-
modelName: "FullModel",
|
|
252788
|
-
visibility: i3sProvider.show,
|
|
252789
|
-
sublayers: i3sProvider.sublayers
|
|
252790
|
-
};
|
|
252791
|
-
this.viewModel.defaultLayer = addTopLayer(fullModel, this.viewModel);
|
|
252792
|
-
this.viewModel.currentLayer.subscribe(function(layer) {
|
|
252793
|
-
i3sProvider.show = isFullModel(layer);
|
|
252794
|
-
});
|
|
252795
|
-
} else if (this.viewModel.topLayers.length === 1) {
|
|
252796
|
-
this.viewModel.topLayers[0].name = "Building layers not found";
|
|
252797
|
-
}
|
|
252798
|
-
setLevels(i3sProvider, this.levels);
|
|
252799
|
-
this.viewModel.currentLevel.subscribe(function(newValue) {
|
|
252800
|
-
if (newValue !== "All") {
|
|
252801
|
-
i3sProvider.filterByAttributes([
|
|
252802
|
-
{
|
|
252803
|
-
name: "BldgLevel",
|
|
252804
|
-
values: [newValue]
|
|
252805
|
-
}
|
|
252806
|
-
]);
|
|
252807
|
-
} else {
|
|
252808
|
-
i3sProvider.filterByAttributes();
|
|
252809
|
-
}
|
|
252810
|
-
});
|
|
252811
|
-
return this.viewModel;
|
|
252812
|
-
}
|
|
252813
|
-
var I3SBuildingSceneLayerExplorerViewModel_default = I3SBuildingSceneLayerExplorerViewModel;
|
|
252814
|
-
|
|
252815
|
-
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.js
|
|
252816
|
-
function I3SBuildingSceneLayerExplorer(containerId, i3sProvider) {
|
|
252817
|
-
const container = document.getElementById(containerId);
|
|
252818
|
-
Check_default.defined("container", container);
|
|
252819
|
-
Check_default.defined("i3sProvider", i3sProvider);
|
|
252820
|
-
const htmlWrapper = document.createElement("div");
|
|
252821
|
-
htmlWrapper.classList.add("cesium-viewer-i3s-explorer");
|
|
252822
|
-
htmlWrapper.innerHTML = `
|
|
252823
|
-
<h3>Building explorer</h3>
|
|
252824
|
-
<select
|
|
252825
|
-
data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
|
|
252826
|
-
></select>
|
|
252827
|
-
<div id="bsl-wrapper">
|
|
252828
|
-
<h3>Select Level</h3>
|
|
252829
|
-
<select data-bind="options: levels, value: currentLevel"></select>
|
|
252830
|
-
<h3>Disciplines & Categories</h3>
|
|
252831
|
-
<ul class="layersList" data-bind="foreach: sublayers">
|
|
252832
|
-
<ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
252833
|
-
<li>
|
|
252834
|
-
<div class="li-wrapper">
|
|
252835
|
-
<span
|
|
252836
|
-
class="expandItem"
|
|
252837
|
-
data-bind="click: $root.expandClickHandler"
|
|
252838
|
-
>+</span
|
|
252839
|
-
>
|
|
252840
|
-
<input
|
|
252841
|
-
type="checkbox"
|
|
252842
|
-
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
252843
|
-
/>
|
|
252844
|
-
<label data-bind="attr: { for: name}">
|
|
252845
|
-
<span data-bind="text: name"></span>
|
|
252846
|
-
</label>
|
|
252847
|
-
</div>
|
|
252848
|
-
<ul class="nested" data-bind="attr: { id: name + '-expander'}">
|
|
252849
|
-
<li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
252850
|
-
<div class="li-wrapper">
|
|
252851
|
-
<input
|
|
252852
|
-
type="checkbox"
|
|
252853
|
-
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
252854
|
-
/>
|
|
252855
|
-
<label data-bind="attr: { for: name}">
|
|
252856
|
-
<span data-bind="text: name"></span>
|
|
252857
|
-
</label>
|
|
252858
|
-
</div>
|
|
252859
|
-
</li>
|
|
252860
|
-
</ul>
|
|
252861
|
-
</li>
|
|
252862
|
-
</ul>
|
|
252863
|
-
</ul>
|
|
252864
|
-
</div>`;
|
|
252865
|
-
container.appendChild(htmlWrapper);
|
|
252866
|
-
const viewModel = new I3SBuildingSceneLayerExplorerViewModel_default(i3sProvider);
|
|
252867
|
-
knockout_default.track(viewModel);
|
|
252868
|
-
knockout_default.applyBindings(viewModel, container);
|
|
252869
|
-
if (defined_default(viewModel.defaultLayer)) {
|
|
252870
|
-
viewModel.currentLayer = viewModel.defaultLayer;
|
|
252871
|
-
}
|
|
252872
|
-
}
|
|
252873
|
-
var I3SBuildingSceneLayerExplorer_default = I3SBuildingSceneLayerExplorer;
|
|
252874
|
-
|
|
252875
|
-
// packages/widgets/Source/InfoBox/InfoBox.js
|
|
252876
|
-
var import_InlineWorkers1306 = __toESM(require_InlineWorkers(), 1);
|
|
252877
|
-
|
|
252878
|
-
// packages/widgets/Source/InfoBox/InfoBoxViewModel.js
|
|
252879
|
-
var import_InlineWorkers1305 = __toESM(require_InlineWorkers(), 1);
|
|
252880
|
-
var cameraEnabledPath = "M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z";
|
|
252881
|
-
var cameraDisabledPath = "M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";
|
|
252882
|
-
function InfoBoxViewModel() {
|
|
252883
|
-
this._cameraClicked = new Event_default();
|
|
252884
|
-
this._closeClicked = new Event_default();
|
|
252885
|
-
this.maxHeight = 500;
|
|
252886
|
-
this.enableCamera = false;
|
|
252887
|
-
this.isCameraTracking = false;
|
|
252888
|
-
this.showInfo = false;
|
|
252889
|
-
this.titleText = "";
|
|
252890
|
-
this.description = "";
|
|
252891
|
-
knockout_default.track(this, [
|
|
252892
|
-
"showInfo",
|
|
252893
|
-
"titleText",
|
|
252894
|
-
"description",
|
|
252895
|
-
"maxHeight",
|
|
252896
|
-
"enableCamera",
|
|
252897
|
-
"isCameraTracking"
|
|
252898
|
-
]);
|
|
252899
|
-
this._loadingIndicatorHtml = '<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>';
|
|
252900
|
-
this.cameraIconPath = void 0;
|
|
252901
|
-
knockout_default.defineProperty(this, "cameraIconPath", {
|
|
252902
|
-
get: function() {
|
|
252903
|
-
return !this.enableCamera || this.isCameraTracking ? cameraDisabledPath : cameraEnabledPath;
|
|
252904
|
-
}
|
|
252905
|
-
});
|
|
252906
|
-
knockout_default.defineProperty(this, "_bodyless", {
|
|
252907
|
-
get: function() {
|
|
252908
|
-
return !defined_default(this.description) || this.description.length === 0;
|
|
252909
|
-
}
|
|
252910
|
-
});
|
|
252911
|
-
}
|
|
252912
|
-
InfoBoxViewModel.prototype.maxHeightOffset = function(offset) {
|
|
252913
|
-
return `${this.maxHeight - offset}px`;
|
|
252914
|
-
};
|
|
252915
|
-
Object.defineProperties(InfoBoxViewModel.prototype, {
|
|
252916
|
-
/**
|
|
252917
|
-
* Gets an {@link Event} that is fired when the user clicks the camera icon.
|
|
252918
|
-
* @memberof InfoBoxViewModel.prototype
|
|
252919
|
-
* @type {Event}
|
|
252920
|
-
*/
|
|
252921
|
-
cameraClicked: {
|
|
252922
|
-
get: function() {
|
|
252923
|
-
return this._cameraClicked;
|
|
252924
|
-
}
|
|
252925
|
-
},
|
|
252926
|
-
/**
|
|
252927
|
-
* Gets an {@link Event} that is fired when the user closes the info box.
|
|
252928
|
-
* @memberof InfoBoxViewModel.prototype
|
|
252929
|
-
* @type {Event}
|
|
252930
|
-
*/
|
|
252931
|
-
closeClicked: {
|
|
252932
|
-
get: function() {
|
|
252933
|
-
return this._closeClicked;
|
|
252934
|
-
}
|
|
252935
|
-
}
|
|
252936
|
-
});
|
|
252937
|
-
var InfoBoxViewModel_default = InfoBoxViewModel;
|
|
252938
|
-
|
|
252939
|
-
// packages/widgets/Source/InfoBox/InfoBox.js
|
|
252940
|
-
function InfoBox(container) {
|
|
252941
|
-
Check_default.defined("container", container);
|
|
252942
|
-
container = getElement_default(container);
|
|
252943
|
-
const infoElement = document.createElement("div");
|
|
252944
|
-
infoElement.className = "cesium-infoBox";
|
|
252945
|
-
infoElement.setAttribute(
|
|
252946
|
-
"data-bind",
|
|
252947
|
-
'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'
|
|
252948
|
-
);
|
|
252949
|
-
container.appendChild(infoElement);
|
|
252950
|
-
const titleElement = document.createElement("div");
|
|
252951
|
-
titleElement.className = "cesium-infoBox-title";
|
|
252952
|
-
titleElement.setAttribute("data-bind", "text: titleText");
|
|
252953
|
-
infoElement.appendChild(titleElement);
|
|
252954
|
-
const cameraElement = document.createElement("button");
|
|
252955
|
-
cameraElement.type = "button";
|
|
252956
|
-
cameraElement.className = "cesium-button cesium-infoBox-camera";
|
|
252957
|
-
cameraElement.setAttribute(
|
|
252958
|
-
"data-bind",
|
|
252959
|
-
'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'
|
|
252960
|
-
);
|
|
252961
|
-
infoElement.appendChild(cameraElement);
|
|
252962
|
-
const closeElement = document.createElement("button");
|
|
252963
|
-
closeElement.type = "button";
|
|
252964
|
-
closeElement.className = "cesium-infoBox-close";
|
|
252965
|
-
closeElement.setAttribute(
|
|
252966
|
-
"data-bind",
|
|
252967
|
-
"click: function () { closeClicked.raiseEvent(this); }"
|
|
252968
|
-
);
|
|
252969
|
-
closeElement.innerHTML = "×";
|
|
252970
|
-
infoElement.appendChild(closeElement);
|
|
252971
|
-
const frame = document.createElement("iframe");
|
|
252972
|
-
frame.className = "cesium-infoBox-iframe";
|
|
252973
|
-
frame.setAttribute("sandbox", "allow-same-origin allow-popups allow-forms");
|
|
252974
|
-
frame.setAttribute(
|
|
252975
|
-
"data-bind",
|
|
252976
|
-
"style : { maxHeight : maxHeightOffset(40) }"
|
|
252977
|
-
);
|
|
252978
|
-
frame.setAttribute("allowfullscreen", true);
|
|
252979
|
-
infoElement.appendChild(frame);
|
|
252980
|
-
const viewModel = new InfoBoxViewModel_default();
|
|
252981
|
-
knockout_default.applyBindings(viewModel, infoElement);
|
|
252982
|
-
this._container = container;
|
|
252983
|
-
this._element = infoElement;
|
|
252984
|
-
this._frame = frame;
|
|
252985
|
-
this._viewModel = viewModel;
|
|
252986
|
-
this._descriptionSubscription = void 0;
|
|
252987
|
-
const that = this;
|
|
252988
|
-
frame.addEventListener("load", function() {
|
|
252989
|
-
const frameDocument = frame.contentDocument;
|
|
252990
|
-
const cssLink = frameDocument.createElement("link");
|
|
252991
|
-
cssLink.href = buildModuleUrl_default("Widgets/InfoBox/InfoBoxDescription.css");
|
|
252992
|
-
cssLink.rel = "stylesheet";
|
|
252993
|
-
cssLink.type = "text/css";
|
|
252994
|
-
const frameContent = frameDocument.createElement("div");
|
|
252995
|
-
frameContent.className = "cesium-infoBox-description";
|
|
252996
|
-
frameDocument.head.appendChild(cssLink);
|
|
252997
|
-
frameDocument.body.appendChild(frameContent);
|
|
252998
|
-
that._descriptionSubscription = subscribeAndEvaluate_default(
|
|
252999
|
-
viewModel,
|
|
253000
|
-
"description",
|
|
253001
|
-
function(value) {
|
|
253002
|
-
frame.style.height = "5px";
|
|
253003
|
-
frameContent.innerHTML = value;
|
|
253004
|
-
let background = null;
|
|
253005
|
-
const firstElementChild = frameContent.firstElementChild;
|
|
253006
|
-
if (firstElementChild !== null && frameContent.childNodes.length === 1) {
|
|
253007
|
-
const style = window.getComputedStyle(firstElementChild);
|
|
253008
|
-
if (style !== null) {
|
|
253009
|
-
const backgroundColor = style["background-color"];
|
|
253010
|
-
const color = Color_default.fromCssColorString(backgroundColor);
|
|
253011
|
-
if (defined_default(color) && color.alpha !== 0) {
|
|
253012
|
-
background = style["background-color"];
|
|
253013
|
-
}
|
|
253014
|
-
}
|
|
253015
|
-
}
|
|
253016
|
-
infoElement.style["background-color"] = background;
|
|
253017
|
-
const height = frameContent.getBoundingClientRect().height;
|
|
253018
|
-
frame.style.height = `${height}px`;
|
|
253019
|
-
}
|
|
253020
|
-
);
|
|
253021
|
-
});
|
|
253022
|
-
frame.setAttribute("src", "about:blank");
|
|
253023
|
-
}
|
|
253024
|
-
Object.defineProperties(InfoBox.prototype, {
|
|
253025
|
-
/**
|
|
253026
|
-
* Gets the parent container.
|
|
253027
|
-
* @memberof InfoBox.prototype
|
|
253028
|
-
*
|
|
253029
|
-
* @type {Element}
|
|
253030
|
-
*/
|
|
253031
|
-
container: {
|
|
253032
|
-
get: function() {
|
|
253033
|
-
return this._container;
|
|
253034
|
-
}
|
|
253035
|
-
},
|
|
253036
|
-
/**
|
|
253037
|
-
* Gets the view model.
|
|
253038
|
-
* @memberof InfoBox.prototype
|
|
253039
|
-
*
|
|
253040
|
-
* @type {InfoBoxViewModel}
|
|
253041
|
-
*/
|
|
253042
|
-
viewModel: {
|
|
253043
|
-
get: function() {
|
|
253044
|
-
return this._viewModel;
|
|
253045
|
-
}
|
|
253046
|
-
},
|
|
253047
|
-
/**
|
|
253048
|
-
* Gets the iframe used to display the description.
|
|
253049
|
-
* @memberof InfoBox.prototype
|
|
253050
|
-
*
|
|
253051
|
-
* @type {HTMLIFrameElement}
|
|
253052
|
-
*/
|
|
253053
|
-
frame: {
|
|
253054
|
-
get: function() {
|
|
253055
|
-
return this._frame;
|
|
253056
|
-
}
|
|
253057
|
-
}
|
|
253058
|
-
});
|
|
253059
|
-
InfoBox.prototype.isDestroyed = function() {
|
|
253060
|
-
return false;
|
|
253061
|
-
};
|
|
253062
|
-
InfoBox.prototype.destroy = function() {
|
|
253063
|
-
const container = this._container;
|
|
253064
|
-
knockout_default.cleanNode(this._element);
|
|
253065
|
-
container.removeChild(this._element);
|
|
253066
|
-
if (defined_default(this._descriptionSubscription)) {
|
|
253067
|
-
this._descriptionSubscription.dispose();
|
|
253068
|
-
}
|
|
253069
|
-
return destroyObject_default(this);
|
|
253070
|
-
};
|
|
253071
|
-
var InfoBox_default = InfoBox;
|
|
253072
|
-
|
|
253073
|
-
// packages/widgets/Source/ProjectionPicker/ProjectionPicker.js
|
|
253074
|
-
var import_InlineWorkers1308 = __toESM(require_InlineWorkers(), 1);
|
|
253075
|
-
|
|
253076
|
-
// packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js
|
|
253077
|
-
var import_InlineWorkers1307 = __toESM(require_InlineWorkers(), 1);
|
|
253078
|
-
function ProjectionPickerViewModel(scene) {
|
|
253079
|
-
if (!defined_default(scene)) {
|
|
253080
|
-
throw new DeveloperError_default("scene is required.");
|
|
253081
|
-
}
|
|
253082
|
-
this._scene = scene;
|
|
253083
|
-
this._orthographic = scene.camera.frustum instanceof OrthographicFrustum_default;
|
|
253084
|
-
this._flightInProgress = false;
|
|
253085
|
-
this.dropDownVisible = false;
|
|
253086
|
-
this.tooltipPerspective = "Perspective Projection";
|
|
253087
|
-
this.tooltipOrthographic = "Orthographic Projection";
|
|
253088
|
-
this.selectedTooltip = void 0;
|
|
253089
|
-
this.sceneMode = scene.mode;
|
|
253090
|
-
knockout_default.track(this, [
|
|
253091
|
-
"_orthographic",
|
|
253092
|
-
"_flightInProgress",
|
|
253093
|
-
"sceneMode",
|
|
253094
|
-
"dropDownVisible",
|
|
253095
|
-
"tooltipPerspective",
|
|
253096
|
-
"tooltipOrthographic"
|
|
253097
|
-
]);
|
|
253098
|
-
const that = this;
|
|
253099
|
-
knockout_default.defineProperty(this, "selectedTooltip", function() {
|
|
253100
|
-
if (that._orthographic) {
|
|
253101
|
-
return that.tooltipOrthographic;
|
|
253102
|
-
}
|
|
253103
|
-
return that.tooltipPerspective;
|
|
253104
|
-
});
|
|
253105
|
-
this._toggleDropDown = createCommand_default(function() {
|
|
253106
|
-
if (that.sceneMode === SceneMode_default.SCENE2D || that._flightInProgress) {
|
|
253107
|
-
return;
|
|
253108
|
-
}
|
|
253109
|
-
that.dropDownVisible = !that.dropDownVisible;
|
|
253110
|
-
});
|
|
253111
|
-
this._eventHelper = new EventHelper_default();
|
|
253112
|
-
this._eventHelper.add(
|
|
253113
|
-
scene.morphComplete,
|
|
253114
|
-
function(transitioner, oldMode, newMode, isMorphing) {
|
|
253115
|
-
that.sceneMode = newMode;
|
|
253116
|
-
that._orthographic = newMode === SceneMode_default.SCENE2D || that._scene.camera.frustum instanceof OrthographicFrustum_default;
|
|
253117
|
-
}
|
|
253118
|
-
);
|
|
253119
|
-
this._eventHelper.add(scene.preRender, function() {
|
|
253120
|
-
that._flightInProgress = defined_default(scene.camera._currentFlight);
|
|
253121
|
-
});
|
|
253122
|
-
this._switchToPerspective = createCommand_default(function() {
|
|
253123
|
-
if (that.sceneMode === SceneMode_default.SCENE2D) {
|
|
253124
|
-
return;
|
|
253125
|
-
}
|
|
253126
|
-
that._scene.camera.switchToPerspectiveFrustum();
|
|
253127
|
-
that._orthographic = false;
|
|
253128
|
-
that.dropDownVisible = false;
|
|
253129
|
-
});
|
|
253130
|
-
this._switchToOrthographic = createCommand_default(function() {
|
|
253131
|
-
if (that.sceneMode === SceneMode_default.SCENE2D) {
|
|
253132
|
-
return;
|
|
253133
|
-
}
|
|
253134
|
-
that._scene.camera.switchToOrthographicFrustum();
|
|
253135
|
-
that._orthographic = true;
|
|
253136
|
-
that.dropDownVisible = false;
|
|
253137
|
-
});
|
|
253138
|
-
this._sceneMode = SceneMode_default;
|
|
253139
|
-
}
|
|
253140
|
-
Object.defineProperties(ProjectionPickerViewModel.prototype, {
|
|
253141
|
-
/**
|
|
253142
|
-
* Gets the scene
|
|
253143
|
-
* @memberof ProjectionPickerViewModel.prototype
|
|
253144
|
-
* @type {Scene}
|
|
253145
|
-
*/
|
|
253146
|
-
scene: {
|
|
253147
|
-
get: function() {
|
|
253148
|
-
return this._scene;
|
|
253149
|
-
}
|
|
253150
|
-
},
|
|
253151
|
-
/**
|
|
253152
|
-
* Gets the command to toggle the drop down box.
|
|
253153
|
-
* @memberof ProjectionPickerViewModel.prototype
|
|
253154
|
-
*
|
|
253155
|
-
* @type {Command}
|
|
253156
|
-
*/
|
|
253157
|
-
toggleDropDown: {
|
|
253158
|
-
get: function() {
|
|
253159
|
-
return this._toggleDropDown;
|
|
253160
|
-
}
|
|
253161
|
-
},
|
|
253162
|
-
/**
|
|
253163
|
-
* Gets the command to switch to a perspective projection.
|
|
253164
|
-
* @memberof ProjectionPickerViewModel.prototype
|
|
253165
|
-
*
|
|
253166
|
-
* @type {Command}
|
|
253167
|
-
*/
|
|
253168
|
-
switchToPerspective: {
|
|
253169
|
-
get: function() {
|
|
253170
|
-
return this._switchToPerspective;
|
|
253171
|
-
}
|
|
253172
|
-
},
|
|
253173
|
-
/**
|
|
253174
|
-
* Gets the command to switch to orthographic projection.
|
|
253175
|
-
* @memberof ProjectionPickerViewModel.prototype
|
|
253176
|
-
*
|
|
253177
|
-
* @type {Command}
|
|
253178
|
-
*/
|
|
253179
|
-
switchToOrthographic: {
|
|
253180
|
-
get: function() {
|
|
253181
|
-
return this._switchToOrthographic;
|
|
253182
|
-
}
|
|
253183
|
-
},
|
|
253184
|
-
/**
|
|
253185
|
-
* Gets whether the scene is currently using an orthographic projection.
|
|
253186
|
-
* @memberof ProjectionPickerViewModel.prototype
|
|
253187
|
-
*
|
|
253188
|
-
* @type {Command}
|
|
253189
|
-
*/
|
|
253190
|
-
isOrthographicProjection: {
|
|
253191
|
-
get: function() {
|
|
253192
|
-
return this._orthographic;
|
|
253193
|
-
}
|
|
253194
|
-
}
|
|
253195
|
-
});
|
|
253196
|
-
ProjectionPickerViewModel.prototype.isDestroyed = function() {
|
|
253197
|
-
return false;
|
|
253198
|
-
};
|
|
253199
|
-
ProjectionPickerViewModel.prototype.destroy = function() {
|
|
253200
|
-
this._eventHelper.removeAll();
|
|
253201
|
-
destroyObject_default(this);
|
|
253202
|
-
};
|
|
253203
|
-
var ProjectionPickerViewModel_default = ProjectionPickerViewModel;
|
|
253204
|
-
|
|
253205
|
-
// packages/widgets/Source/ProjectionPicker/ProjectionPicker.js
|
|
253206
|
-
var perspectivePath = "M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z";
|
|
253207
|
-
var orthographicPath = "m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";
|
|
253208
|
-
function ProjectionPicker(container, scene) {
|
|
253209
|
-
if (!defined_default(container)) {
|
|
253210
|
-
throw new DeveloperError_default("container is required.");
|
|
253211
|
-
}
|
|
253212
|
-
if (!defined_default(scene)) {
|
|
253213
|
-
throw new DeveloperError_default("scene is required.");
|
|
253214
|
-
}
|
|
253215
|
-
container = getElement_default(container);
|
|
253216
|
-
const viewModel = new ProjectionPickerViewModel_default(scene);
|
|
253217
|
-
viewModel._perspectivePath = perspectivePath;
|
|
253218
|
-
viewModel._orthographicPath = orthographicPath;
|
|
253219
|
-
const wrapper = document.createElement("span");
|
|
253220
|
-
wrapper.className = "cesium-projectionPicker-wrapper cesium-toolbar-button";
|
|
253221
|
-
container.appendChild(wrapper);
|
|
253222
|
-
const button = document.createElement("button");
|
|
253223
|
-
button.type = "button";
|
|
253224
|
-
button.className = "cesium-button cesium-toolbar-button";
|
|
253225
|
-
button.setAttribute(
|
|
252741
|
+
const textBox = document.createElement("input");
|
|
252742
|
+
textBox.type = "search";
|
|
252743
|
+
textBox.className = "cesium-geocoder-input";
|
|
252744
|
+
textBox.setAttribute("placeholder", "Enter an address or landmark...");
|
|
252745
|
+
textBox.setAttribute(
|
|
253226
252746
|
"data-bind",
|
|
253227
|
-
'
|
|
252747
|
+
'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'
|
|
253228
252748
|
);
|
|
253229
|
-
|
|
253230
|
-
|
|
253231
|
-
|
|
253232
|
-
|
|
253233
|
-
|
|
253234
|
-
|
|
252749
|
+
this._onTextBoxFocus = function() {
|
|
252750
|
+
setTimeout(function() {
|
|
252751
|
+
textBox.select();
|
|
252752
|
+
}, 0);
|
|
252753
|
+
};
|
|
252754
|
+
textBox.addEventListener("focus", this._onTextBoxFocus, false);
|
|
252755
|
+
form.appendChild(textBox);
|
|
252756
|
+
this._textBox = textBox;
|
|
252757
|
+
const searchButton = document.createElement("span");
|
|
252758
|
+
searchButton.className = "cesium-geocoder-searchButton";
|
|
252759
|
+
searchButton.setAttribute(
|
|
253235
252760
|
"data-bind",
|
|
253236
|
-
|
|
252761
|
+
"click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"
|
|
253237
252762
|
);
|
|
253238
|
-
|
|
253239
|
-
|
|
253240
|
-
|
|
253241
|
-
|
|
253242
|
-
|
|
252763
|
+
form.appendChild(searchButton);
|
|
252764
|
+
container.appendChild(form);
|
|
252765
|
+
const searchSuggestionsContainer = document.createElement("div");
|
|
252766
|
+
searchSuggestionsContainer.className = "search-results";
|
|
252767
|
+
searchSuggestionsContainer.setAttribute(
|
|
253243
252768
|
"data-bind",
|
|
253244
|
-
|
|
252769
|
+
"visible: _suggestionsVisible"
|
|
253245
252770
|
);
|
|
253246
|
-
|
|
253247
|
-
|
|
253248
|
-
|
|
252771
|
+
const suggestionsList = document.createElement("ul");
|
|
252772
|
+
suggestionsList.setAttribute("data-bind", "foreach: _suggestions");
|
|
252773
|
+
const suggestions = document.createElement("li");
|
|
252774
|
+
suggestionsList.appendChild(suggestions);
|
|
252775
|
+
suggestions.setAttribute(
|
|
252776
|
+
"data-bind",
|
|
252777
|
+
"text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"
|
|
252778
|
+
);
|
|
252779
|
+
searchSuggestionsContainer.appendChild(suggestionsList);
|
|
252780
|
+
container.appendChild(searchSuggestionsContainer);
|
|
252781
|
+
knockout_default.applyBindings(viewModel, form);
|
|
252782
|
+
knockout_default.applyBindings(viewModel, searchSuggestionsContainer);
|
|
253249
252783
|
this._container = container;
|
|
253250
|
-
this.
|
|
253251
|
-
this.
|
|
253252
|
-
|
|
253253
|
-
|
|
252784
|
+
this._searchSuggestionsContainer = searchSuggestionsContainer;
|
|
252785
|
+
this._viewModel = viewModel;
|
|
252786
|
+
this._form = form;
|
|
252787
|
+
this._onInputBegin = function(e) {
|
|
252788
|
+
let target = e.target;
|
|
252789
|
+
if (typeof e.composedPath === "function") {
|
|
252790
|
+
target = e.composedPath()[0];
|
|
253254
252791
|
}
|
|
252792
|
+
if (!container.contains(target)) {
|
|
252793
|
+
viewModel._focusTextbox = false;
|
|
252794
|
+
viewModel.hideSuggestions();
|
|
252795
|
+
}
|
|
252796
|
+
};
|
|
252797
|
+
this._onInputEnd = function(e) {
|
|
252798
|
+
viewModel._focusTextbox = true;
|
|
252799
|
+
viewModel.showSuggestions();
|
|
253255
252800
|
};
|
|
253256
252801
|
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253257
|
-
document.addEventListener("pointerdown", this.
|
|
252802
|
+
document.addEventListener("pointerdown", this._onInputBegin, true);
|
|
252803
|
+
container.addEventListener("pointerup", this._onInputEnd, true);
|
|
252804
|
+
container.addEventListener("pointercancel", this._onInputEnd, true);
|
|
253258
252805
|
} else {
|
|
253259
|
-
document.addEventListener("mousedown", this.
|
|
253260
|
-
|
|
252806
|
+
document.addEventListener("mousedown", this._onInputBegin, true);
|
|
252807
|
+
container.addEventListener("mouseup", this._onInputEnd, true);
|
|
252808
|
+
document.addEventListener("touchstart", this._onInputBegin, true);
|
|
252809
|
+
container.addEventListener("touchend", this._onInputEnd, true);
|
|
252810
|
+
container.addEventListener("touchcancel", this._onInputEnd, true);
|
|
253261
252811
|
}
|
|
253262
252812
|
}
|
|
253263
|
-
Object.defineProperties(
|
|
252813
|
+
Object.defineProperties(Geocoder.prototype, {
|
|
253264
252814
|
/**
|
|
253265
252815
|
* Gets the parent container.
|
|
253266
|
-
* @memberof
|
|
252816
|
+
* @memberof Geocoder.prototype
|
|
253267
252817
|
*
|
|
253268
252818
|
* @type {Element}
|
|
253269
252819
|
*/
|
|
@@ -253272,11 +252822,22 @@ ${terrainTip}`;
|
|
|
253272
252822
|
return this._container;
|
|
253273
252823
|
}
|
|
253274
252824
|
},
|
|
252825
|
+
/**
|
|
252826
|
+
* Gets the parent container.
|
|
252827
|
+
* @memberof Geocoder.prototype
|
|
252828
|
+
*
|
|
252829
|
+
* @type {Element}
|
|
252830
|
+
*/
|
|
252831
|
+
searchSuggestionsContainer: {
|
|
252832
|
+
get: function() {
|
|
252833
|
+
return this._searchSuggestionsContainer;
|
|
252834
|
+
}
|
|
252835
|
+
},
|
|
253275
252836
|
/**
|
|
253276
252837
|
* Gets the view model.
|
|
253277
|
-
* @memberof
|
|
252838
|
+
* @memberof Geocoder.prototype
|
|
253278
252839
|
*
|
|
253279
|
-
* @type {
|
|
252840
|
+
* @type {GeocoderViewModel}
|
|
253280
252841
|
*/
|
|
253281
252842
|
viewModel: {
|
|
253282
252843
|
get: function() {
|
|
@@ -253284,28 +252845,236 @@ ${terrainTip}`;
|
|
|
253284
252845
|
}
|
|
253285
252846
|
}
|
|
253286
252847
|
});
|
|
253287
|
-
|
|
252848
|
+
Geocoder.prototype.isDestroyed = function() {
|
|
253288
252849
|
return false;
|
|
253289
252850
|
};
|
|
253290
|
-
|
|
253291
|
-
this.
|
|
252851
|
+
Geocoder.prototype.destroy = function() {
|
|
252852
|
+
const container = this._container;
|
|
253292
252853
|
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253293
|
-
document.removeEventListener("pointerdown", this.
|
|
252854
|
+
document.removeEventListener("pointerdown", this._onInputBegin, true);
|
|
252855
|
+
container.removeEventListener("pointerup", this._onInputEnd, true);
|
|
253294
252856
|
} else {
|
|
253295
|
-
document.removeEventListener("mousedown", this.
|
|
253296
|
-
|
|
252857
|
+
document.removeEventListener("mousedown", this._onInputBegin, true);
|
|
252858
|
+
container.removeEventListener("mouseup", this._onInputEnd, true);
|
|
252859
|
+
document.removeEventListener("touchstart", this._onInputBegin, true);
|
|
252860
|
+
container.removeEventListener("touchend", this._onInputEnd, true);
|
|
253297
252861
|
}
|
|
253298
|
-
|
|
253299
|
-
|
|
252862
|
+
this._viewModel.destroy();
|
|
252863
|
+
knockout_default.cleanNode(this._form);
|
|
252864
|
+
knockout_default.cleanNode(this._searchSuggestionsContainer);
|
|
252865
|
+
container.removeChild(this._form);
|
|
252866
|
+
container.removeChild(this._searchSuggestionsContainer);
|
|
252867
|
+
this._textBox.removeEventListener("focus", this._onTextBoxFocus, false);
|
|
253300
252868
|
return destroyObject_default(this);
|
|
253301
252869
|
};
|
|
253302
|
-
var
|
|
252870
|
+
var Geocoder_default = Geocoder;
|
|
252871
|
+
|
|
252872
|
+
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.js
|
|
252873
|
+
var import_InlineWorkers1306 = __toESM(require_InlineWorkers(), 1);
|
|
252874
|
+
|
|
252875
|
+
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel.js
|
|
252876
|
+
var import_InlineWorkers1305 = __toESM(require_InlineWorkers(), 1);
|
|
252877
|
+
function expandItemsHandler(data, event) {
|
|
252878
|
+
const nestedList = event.currentTarget.parentElement.parentElement.querySelector(
|
|
252879
|
+
`#${data.name}-expander`
|
|
252880
|
+
);
|
|
252881
|
+
nestedList.classList.toggle("active");
|
|
252882
|
+
event.currentTarget.textContent = event.currentTarget.textContent === "+" ? "-" : "+";
|
|
252883
|
+
}
|
|
252884
|
+
function trackSublayer(sublayer, viewModel) {
|
|
252885
|
+
knockout_default.track(sublayer);
|
|
252886
|
+
for (let i = 0; i < sublayer.sublayers.length; i++) {
|
|
252887
|
+
trackSublayer(sublayer.sublayers[i], viewModel);
|
|
252888
|
+
}
|
|
252889
|
+
}
|
|
252890
|
+
function isFullModel(layer) {
|
|
252891
|
+
return layer.modelName === "FullModel";
|
|
252892
|
+
}
|
|
252893
|
+
function isOverview(layer) {
|
|
252894
|
+
return layer.modelName === "Overview";
|
|
252895
|
+
}
|
|
252896
|
+
function isTopLayer(layer) {
|
|
252897
|
+
return isOverview(layer) || isFullModel(layer);
|
|
252898
|
+
}
|
|
252899
|
+
function addTopLayer(layer, viewModel) {
|
|
252900
|
+
if (isTopLayer(layer)) {
|
|
252901
|
+
layer.visibility = false;
|
|
252902
|
+
for (let i = 0; i < layer.sublayers.length; i++) {
|
|
252903
|
+
layer.sublayers[i].visibility = true;
|
|
252904
|
+
}
|
|
252905
|
+
const topLayer = {
|
|
252906
|
+
name: layer.name,
|
|
252907
|
+
modelName: layer.modelName,
|
|
252908
|
+
disable: knockout_default.observable(false),
|
|
252909
|
+
index: viewModel.sublayers.length
|
|
252910
|
+
};
|
|
252911
|
+
viewModel.topLayers.push(topLayer);
|
|
252912
|
+
viewModel.sublayers.push(layer);
|
|
252913
|
+
return topLayer;
|
|
252914
|
+
}
|
|
252915
|
+
}
|
|
252916
|
+
function handleTopLayerSelector(layer, viewModel) {
|
|
252917
|
+
if (isTopLayer(layer)) {
|
|
252918
|
+
viewModel.sublayers.forEach((elem) => elem.visibility = false);
|
|
252919
|
+
viewModel.sublayers[layer.index].visibility = true;
|
|
252920
|
+
const bsl = document.getElementById("bsl-wrapper");
|
|
252921
|
+
if (isFullModel(layer)) {
|
|
252922
|
+
viewModel.currentLevel = viewModel.selectedLevel;
|
|
252923
|
+
bsl.style.display = "block";
|
|
252924
|
+
} else {
|
|
252925
|
+
viewModel.selectedLevel = viewModel.currentLevel;
|
|
252926
|
+
viewModel.currentLevel = "All";
|
|
252927
|
+
bsl.style.display = "none";
|
|
252928
|
+
}
|
|
252929
|
+
}
|
|
252930
|
+
}
|
|
252931
|
+
async function setLevels(i3sProvider, levels) {
|
|
252932
|
+
try {
|
|
252933
|
+
const attributes = i3sProvider.getAttributeNames();
|
|
252934
|
+
for (let index = 0; index < attributes.length; index++) {
|
|
252935
|
+
if (attributes[index] === "BldgLevel") {
|
|
252936
|
+
const values = i3sProvider.getAttributeValues(attributes[index]);
|
|
252937
|
+
for (let i = 0; i < values.length; i++) {
|
|
252938
|
+
levels.push(values[i]);
|
|
252939
|
+
}
|
|
252940
|
+
}
|
|
252941
|
+
}
|
|
252942
|
+
levels.sort((a3, b) => a3 - b);
|
|
252943
|
+
levels.unshift("All");
|
|
252944
|
+
} catch (error) {
|
|
252945
|
+
console.log(`There was an error getting attributes: ${error}`);
|
|
252946
|
+
}
|
|
252947
|
+
}
|
|
252948
|
+
function I3SBuildingSceneLayerExplorerViewModel(i3sProvider) {
|
|
252949
|
+
const that = this;
|
|
252950
|
+
this.levels = [];
|
|
252951
|
+
this.viewModel = {
|
|
252952
|
+
sublayers: [],
|
|
252953
|
+
levels: this.levels,
|
|
252954
|
+
currentLevel: knockout_default.observable(),
|
|
252955
|
+
selectedLevel: "All",
|
|
252956
|
+
topLayers: [
|
|
252957
|
+
{
|
|
252958
|
+
name: "Select a layer to explore...",
|
|
252959
|
+
disable: knockout_default.observable(true),
|
|
252960
|
+
index: -1
|
|
252961
|
+
}
|
|
252962
|
+
],
|
|
252963
|
+
currentLayer: knockout_default.observable(),
|
|
252964
|
+
expandClickHandler: expandItemsHandler,
|
|
252965
|
+
setOptionDisable: function(option, item) {
|
|
252966
|
+
knockout_default.applyBindingsToNode(option, { disable: item.disable }, item);
|
|
252967
|
+
},
|
|
252968
|
+
defaultLayer: void 0
|
|
252969
|
+
};
|
|
252970
|
+
this.viewModel.currentLayer.subscribe(function(layer) {
|
|
252971
|
+
handleTopLayerSelector(layer, that.viewModel);
|
|
252972
|
+
});
|
|
252973
|
+
const sublayers = i3sProvider.sublayers;
|
|
252974
|
+
for (let i = 0; i < sublayers.length; i++) {
|
|
252975
|
+
trackSublayer(sublayers[i], this.viewModel);
|
|
252976
|
+
const topLayer = addTopLayer(sublayers[i], this.viewModel);
|
|
252977
|
+
if (defined_default(topLayer) && (isOverview(topLayer) || !defined_default(this.viewModel.defaultLayer) && isFullModel(topLayer))) {
|
|
252978
|
+
this.viewModel.defaultLayer = topLayer;
|
|
252979
|
+
}
|
|
252980
|
+
}
|
|
252981
|
+
if (this.viewModel.topLayers.length === 1 && sublayers.length > 0) {
|
|
252982
|
+
i3sProvider.show = false;
|
|
252983
|
+
const fullModel = {
|
|
252984
|
+
name: "Full Model",
|
|
252985
|
+
modelName: "FullModel",
|
|
252986
|
+
visibility: i3sProvider.show,
|
|
252987
|
+
sublayers: i3sProvider.sublayers
|
|
252988
|
+
};
|
|
252989
|
+
this.viewModel.defaultLayer = addTopLayer(fullModel, this.viewModel);
|
|
252990
|
+
this.viewModel.currentLayer.subscribe(function(layer) {
|
|
252991
|
+
i3sProvider.show = isFullModel(layer);
|
|
252992
|
+
});
|
|
252993
|
+
} else if (this.viewModel.topLayers.length === 1) {
|
|
252994
|
+
this.viewModel.topLayers[0].name = "Building layers not found";
|
|
252995
|
+
}
|
|
252996
|
+
setLevels(i3sProvider, this.levels);
|
|
252997
|
+
this.viewModel.currentLevel.subscribe(function(newValue) {
|
|
252998
|
+
if (newValue !== "All") {
|
|
252999
|
+
i3sProvider.filterByAttributes([
|
|
253000
|
+
{
|
|
253001
|
+
name: "BldgLevel",
|
|
253002
|
+
values: [newValue]
|
|
253003
|
+
}
|
|
253004
|
+
]);
|
|
253005
|
+
} else {
|
|
253006
|
+
i3sProvider.filterByAttributes();
|
|
253007
|
+
}
|
|
253008
|
+
});
|
|
253009
|
+
return this.viewModel;
|
|
253010
|
+
}
|
|
253011
|
+
var I3SBuildingSceneLayerExplorerViewModel_default = I3SBuildingSceneLayerExplorerViewModel;
|
|
253012
|
+
|
|
253013
|
+
// packages/widgets/Source/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.js
|
|
253014
|
+
function I3SBuildingSceneLayerExplorer(containerId, i3sProvider) {
|
|
253015
|
+
const container = document.getElementById(containerId);
|
|
253016
|
+
Check_default.defined("container", container);
|
|
253017
|
+
Check_default.defined("i3sProvider", i3sProvider);
|
|
253018
|
+
const htmlWrapper = document.createElement("div");
|
|
253019
|
+
htmlWrapper.classList.add("cesium-viewer-i3s-explorer");
|
|
253020
|
+
htmlWrapper.innerHTML = `
|
|
253021
|
+
<h3>Building explorer</h3>
|
|
253022
|
+
<select
|
|
253023
|
+
data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
|
|
253024
|
+
></select>
|
|
253025
|
+
<div id="bsl-wrapper">
|
|
253026
|
+
<h3>Select Level</h3>
|
|
253027
|
+
<select data-bind="options: levels, value: currentLevel"></select>
|
|
253028
|
+
<h3>Disciplines & Categories</h3>
|
|
253029
|
+
<ul class="layersList" data-bind="foreach: sublayers">
|
|
253030
|
+
<ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
253031
|
+
<li>
|
|
253032
|
+
<div class="li-wrapper">
|
|
253033
|
+
<span
|
|
253034
|
+
class="expandItem"
|
|
253035
|
+
data-bind="click: $root.expandClickHandler"
|
|
253036
|
+
>+</span
|
|
253037
|
+
>
|
|
253038
|
+
<input
|
|
253039
|
+
type="checkbox"
|
|
253040
|
+
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
253041
|
+
/>
|
|
253042
|
+
<label data-bind="attr: { for: name}">
|
|
253043
|
+
<span data-bind="text: name"></span>
|
|
253044
|
+
</label>
|
|
253045
|
+
</div>
|
|
253046
|
+
<ul class="nested" data-bind="attr: { id: name + '-expander'}">
|
|
253047
|
+
<li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
253048
|
+
<div class="li-wrapper">
|
|
253049
|
+
<input
|
|
253050
|
+
type="checkbox"
|
|
253051
|
+
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
253052
|
+
/>
|
|
253053
|
+
<label data-bind="attr: { for: name}">
|
|
253054
|
+
<span data-bind="text: name"></span>
|
|
253055
|
+
</label>
|
|
253056
|
+
</div>
|
|
253057
|
+
</li>
|
|
253058
|
+
</ul>
|
|
253059
|
+
</li>
|
|
253060
|
+
</ul>
|
|
253061
|
+
</ul>
|
|
253062
|
+
</div>`;
|
|
253063
|
+
container.appendChild(htmlWrapper);
|
|
253064
|
+
const viewModel = new I3SBuildingSceneLayerExplorerViewModel_default(i3sProvider);
|
|
253065
|
+
knockout_default.track(viewModel);
|
|
253066
|
+
knockout_default.applyBindings(viewModel, container);
|
|
253067
|
+
if (defined_default(viewModel.defaultLayer)) {
|
|
253068
|
+
viewModel.currentLayer = viewModel.defaultLayer;
|
|
253069
|
+
}
|
|
253070
|
+
}
|
|
253071
|
+
var I3SBuildingSceneLayerExplorer_default = I3SBuildingSceneLayerExplorer;
|
|
253303
253072
|
|
|
253304
253073
|
// packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdog.js
|
|
253305
|
-
var
|
|
253074
|
+
var import_InlineWorkers1308 = __toESM(require_InlineWorkers(), 1);
|
|
253306
253075
|
|
|
253307
253076
|
// packages/widgets/Source/PerformanceWatchdog/PerformanceWatchdogViewModel.js
|
|
253308
|
-
var
|
|
253077
|
+
var import_InlineWorkers1307 = __toESM(require_InlineWorkers(), 1);
|
|
253309
253078
|
function PerformanceWatchdogViewModel(options) {
|
|
253310
253079
|
if (!defined_default(options) || !defined_default(options.scene)) {
|
|
253311
253080
|
throw new DeveloperError_default("options.scene is required.");
|
|
@@ -253432,462 +253201,11 @@ ${terrainTip}`;
|
|
|
253432
253201
|
};
|
|
253433
253202
|
var PerformanceWatchdog_default = PerformanceWatchdog;
|
|
253434
253203
|
|
|
253435
|
-
// packages/widgets/Source/SceneModePicker/SceneModePicker.js
|
|
253436
|
-
var import_InlineWorkers1312 = __toESM(require_InlineWorkers(), 1);
|
|
253437
|
-
|
|
253438
|
-
// packages/widgets/Source/SceneModePicker/SceneModePickerViewModel.js
|
|
253439
|
-
var import_InlineWorkers1311 = __toESM(require_InlineWorkers(), 1);
|
|
253440
|
-
function SceneModePickerViewModel(scene, duration) {
|
|
253441
|
-
if (!defined_default(scene)) {
|
|
253442
|
-
throw new DeveloperError_default("scene is required.");
|
|
253443
|
-
}
|
|
253444
|
-
this._scene = scene;
|
|
253445
|
-
const that = this;
|
|
253446
|
-
const morphStart = function(transitioner, oldMode, newMode, isMorphing) {
|
|
253447
|
-
that.sceneMode = newMode;
|
|
253448
|
-
that.dropDownVisible = false;
|
|
253449
|
-
};
|
|
253450
|
-
this._eventHelper = new EventHelper_default();
|
|
253451
|
-
this._eventHelper.add(scene.morphStart, morphStart);
|
|
253452
|
-
this._duration = duration ?? 2;
|
|
253453
|
-
this.sceneMode = scene.mode;
|
|
253454
|
-
this.dropDownVisible = false;
|
|
253455
|
-
this.tooltip2D = "2D";
|
|
253456
|
-
this.tooltip3D = "3D";
|
|
253457
|
-
this.tooltipColumbusView = "Columbus View";
|
|
253458
|
-
knockout_default.track(this, [
|
|
253459
|
-
"sceneMode",
|
|
253460
|
-
"dropDownVisible",
|
|
253461
|
-
"tooltip2D",
|
|
253462
|
-
"tooltip3D",
|
|
253463
|
-
"tooltipColumbusView"
|
|
253464
|
-
]);
|
|
253465
|
-
this.selectedTooltip = void 0;
|
|
253466
|
-
knockout_default.defineProperty(this, "selectedTooltip", function() {
|
|
253467
|
-
const mode2 = that.sceneMode;
|
|
253468
|
-
if (mode2 === SceneMode_default.SCENE2D) {
|
|
253469
|
-
return that.tooltip2D;
|
|
253470
|
-
}
|
|
253471
|
-
if (mode2 === SceneMode_default.SCENE3D) {
|
|
253472
|
-
return that.tooltip3D;
|
|
253473
|
-
}
|
|
253474
|
-
return that.tooltipColumbusView;
|
|
253475
|
-
});
|
|
253476
|
-
this._toggleDropDown = createCommand_default(function() {
|
|
253477
|
-
that.dropDownVisible = !that.dropDownVisible;
|
|
253478
|
-
});
|
|
253479
|
-
this._morphTo2D = createCommand_default(function() {
|
|
253480
|
-
scene.morphTo2D(that._duration);
|
|
253481
|
-
});
|
|
253482
|
-
this._morphTo3D = createCommand_default(function() {
|
|
253483
|
-
scene.morphTo3D(that._duration);
|
|
253484
|
-
});
|
|
253485
|
-
this._morphToColumbusView = createCommand_default(function() {
|
|
253486
|
-
scene.morphToColumbusView(that._duration);
|
|
253487
|
-
});
|
|
253488
|
-
this._sceneMode = SceneMode_default;
|
|
253489
|
-
}
|
|
253490
|
-
Object.defineProperties(SceneModePickerViewModel.prototype, {
|
|
253491
|
-
/**
|
|
253492
|
-
* Gets the scene
|
|
253493
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253494
|
-
* @type {Scene}
|
|
253495
|
-
*/
|
|
253496
|
-
scene: {
|
|
253497
|
-
get: function() {
|
|
253498
|
-
return this._scene;
|
|
253499
|
-
}
|
|
253500
|
-
},
|
|
253501
|
-
/**
|
|
253502
|
-
* Gets or sets the the duration of scene mode transition animations in seconds.
|
|
253503
|
-
* A value of zero causes the scene to instantly change modes.
|
|
253504
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253505
|
-
* @type {number}
|
|
253506
|
-
*/
|
|
253507
|
-
duration: {
|
|
253508
|
-
get: function() {
|
|
253509
|
-
return this._duration;
|
|
253510
|
-
},
|
|
253511
|
-
set: function(value) {
|
|
253512
|
-
if (value < 0) {
|
|
253513
|
-
throw new DeveloperError_default("duration value must be positive.");
|
|
253514
|
-
}
|
|
253515
|
-
this._duration = value;
|
|
253516
|
-
}
|
|
253517
|
-
},
|
|
253518
|
-
/**
|
|
253519
|
-
* Gets the command to toggle the drop down box.
|
|
253520
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253521
|
-
*
|
|
253522
|
-
* @type {Command}
|
|
253523
|
-
*/
|
|
253524
|
-
toggleDropDown: {
|
|
253525
|
-
get: function() {
|
|
253526
|
-
return this._toggleDropDown;
|
|
253527
|
-
}
|
|
253528
|
-
},
|
|
253529
|
-
/**
|
|
253530
|
-
* Gets the command to morph to 2D.
|
|
253531
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253532
|
-
*
|
|
253533
|
-
* @type {Command}
|
|
253534
|
-
*/
|
|
253535
|
-
morphTo2D: {
|
|
253536
|
-
get: function() {
|
|
253537
|
-
return this._morphTo2D;
|
|
253538
|
-
}
|
|
253539
|
-
},
|
|
253540
|
-
/**
|
|
253541
|
-
* Gets the command to morph to 3D.
|
|
253542
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253543
|
-
*
|
|
253544
|
-
* @type {Command}
|
|
253545
|
-
*/
|
|
253546
|
-
morphTo3D: {
|
|
253547
|
-
get: function() {
|
|
253548
|
-
return this._morphTo3D;
|
|
253549
|
-
}
|
|
253550
|
-
},
|
|
253551
|
-
/**
|
|
253552
|
-
* Gets the command to morph to Columbus View.
|
|
253553
|
-
* @memberof SceneModePickerViewModel.prototype
|
|
253554
|
-
*
|
|
253555
|
-
* @type {Command}
|
|
253556
|
-
*/
|
|
253557
|
-
morphToColumbusView: {
|
|
253558
|
-
get: function() {
|
|
253559
|
-
return this._morphToColumbusView;
|
|
253560
|
-
}
|
|
253561
|
-
}
|
|
253562
|
-
});
|
|
253563
|
-
SceneModePickerViewModel.prototype.isDestroyed = function() {
|
|
253564
|
-
return false;
|
|
253565
|
-
};
|
|
253566
|
-
SceneModePickerViewModel.prototype.destroy = function() {
|
|
253567
|
-
this._eventHelper.removeAll();
|
|
253568
|
-
destroyObject_default(this);
|
|
253569
|
-
};
|
|
253570
|
-
var SceneModePickerViewModel_default = SceneModePickerViewModel;
|
|
253571
|
-
|
|
253572
|
-
// packages/widgets/Source/SceneModePicker/SceneModePicker.js
|
|
253573
|
-
var globePath = "m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z";
|
|
253574
|
-
var flatMapPath = "m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z";
|
|
253575
|
-
var columbusViewPath = "m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";
|
|
253576
|
-
function SceneModePicker(container, scene, duration) {
|
|
253577
|
-
if (!defined_default(container)) {
|
|
253578
|
-
throw new DeveloperError_default("container is required.");
|
|
253579
|
-
}
|
|
253580
|
-
if (!defined_default(scene)) {
|
|
253581
|
-
throw new DeveloperError_default("scene is required.");
|
|
253582
|
-
}
|
|
253583
|
-
container = getElement_default(container);
|
|
253584
|
-
const viewModel = new SceneModePickerViewModel_default(scene, duration);
|
|
253585
|
-
viewModel._globePath = globePath;
|
|
253586
|
-
viewModel._flatMapPath = flatMapPath;
|
|
253587
|
-
viewModel._columbusViewPath = columbusViewPath;
|
|
253588
|
-
const wrapper = document.createElement("span");
|
|
253589
|
-
wrapper.className = "cesium-sceneModePicker-wrapper cesium-toolbar-button";
|
|
253590
|
-
container.appendChild(wrapper);
|
|
253591
|
-
const button = document.createElement("button");
|
|
253592
|
-
button.type = "button";
|
|
253593
|
-
button.className = "cesium-button cesium-toolbar-button";
|
|
253594
|
-
button.setAttribute(
|
|
253595
|
-
"data-bind",
|
|
253596
|
-
'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'
|
|
253597
|
-
);
|
|
253598
|
-
button.innerHTML = '<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->';
|
|
253599
|
-
wrapper.appendChild(button);
|
|
253600
|
-
const morphTo3DButton = document.createElement("button");
|
|
253601
|
-
morphTo3DButton.type = "button";
|
|
253602
|
-
morphTo3DButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
253603
|
-
morphTo3DButton.setAttribute(
|
|
253604
|
-
"data-bind",
|
|
253605
|
-
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'
|
|
253606
|
-
);
|
|
253607
|
-
wrapper.appendChild(morphTo3DButton);
|
|
253608
|
-
const morphTo2DButton = document.createElement("button");
|
|
253609
|
-
morphTo2DButton.type = "button";
|
|
253610
|
-
morphTo2DButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
253611
|
-
morphTo2DButton.setAttribute(
|
|
253612
|
-
"data-bind",
|
|
253613
|
-
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'
|
|
253614
|
-
);
|
|
253615
|
-
wrapper.appendChild(morphTo2DButton);
|
|
253616
|
-
const morphToCVButton = document.createElement("button");
|
|
253617
|
-
morphToCVButton.type = "button";
|
|
253618
|
-
morphToCVButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
253619
|
-
morphToCVButton.setAttribute(
|
|
253620
|
-
"data-bind",
|
|
253621
|
-
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'
|
|
253622
|
-
);
|
|
253623
|
-
wrapper.appendChild(morphToCVButton);
|
|
253624
|
-
knockout_default.applyBindings(viewModel, wrapper);
|
|
253625
|
-
this._viewModel = viewModel;
|
|
253626
|
-
this._container = container;
|
|
253627
|
-
this._wrapper = wrapper;
|
|
253628
|
-
this._closeDropDown = function(e) {
|
|
253629
|
-
if (!wrapper.contains(e.target)) {
|
|
253630
|
-
viewModel.dropDownVisible = false;
|
|
253631
|
-
}
|
|
253632
|
-
};
|
|
253633
|
-
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253634
|
-
document.addEventListener("pointerdown", this._closeDropDown, true);
|
|
253635
|
-
} else {
|
|
253636
|
-
document.addEventListener("mousedown", this._closeDropDown, true);
|
|
253637
|
-
document.addEventListener("touchstart", this._closeDropDown, true);
|
|
253638
|
-
}
|
|
253639
|
-
}
|
|
253640
|
-
Object.defineProperties(SceneModePicker.prototype, {
|
|
253641
|
-
/**
|
|
253642
|
-
* Gets the parent container.
|
|
253643
|
-
* @memberof SceneModePicker.prototype
|
|
253644
|
-
*
|
|
253645
|
-
* @type {Element}
|
|
253646
|
-
*/
|
|
253647
|
-
container: {
|
|
253648
|
-
get: function() {
|
|
253649
|
-
return this._container;
|
|
253650
|
-
}
|
|
253651
|
-
},
|
|
253652
|
-
/**
|
|
253653
|
-
* Gets the view model.
|
|
253654
|
-
* @memberof SceneModePicker.prototype
|
|
253655
|
-
*
|
|
253656
|
-
* @type {SceneModePickerViewModel}
|
|
253657
|
-
*/
|
|
253658
|
-
viewModel: {
|
|
253659
|
-
get: function() {
|
|
253660
|
-
return this._viewModel;
|
|
253661
|
-
}
|
|
253662
|
-
}
|
|
253663
|
-
});
|
|
253664
|
-
SceneModePicker.prototype.isDestroyed = function() {
|
|
253665
|
-
return false;
|
|
253666
|
-
};
|
|
253667
|
-
SceneModePicker.prototype.destroy = function() {
|
|
253668
|
-
this._viewModel.destroy();
|
|
253669
|
-
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253670
|
-
document.removeEventListener("pointerdown", this._closeDropDown, true);
|
|
253671
|
-
} else {
|
|
253672
|
-
document.removeEventListener("mousedown", this._closeDropDown, true);
|
|
253673
|
-
document.removeEventListener("touchstart", this._closeDropDown, true);
|
|
253674
|
-
}
|
|
253675
|
-
knockout_default.cleanNode(this._wrapper);
|
|
253676
|
-
this._container.removeChild(this._wrapper);
|
|
253677
|
-
return destroyObject_default(this);
|
|
253678
|
-
};
|
|
253679
|
-
var SceneModePicker_default = SceneModePicker;
|
|
253680
|
-
|
|
253681
|
-
// packages/widgets/Source/SelectionIndicator/SelectionIndicator.js
|
|
253682
|
-
var import_InlineWorkers1314 = __toESM(require_InlineWorkers(), 1);
|
|
253683
|
-
|
|
253684
|
-
// packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js
|
|
253685
|
-
var import_InlineWorkers1313 = __toESM(require_InlineWorkers(), 1);
|
|
253686
|
-
var screenSpacePos = new Cartesian2_default();
|
|
253687
|
-
var offScreen = "-1000px";
|
|
253688
|
-
function SelectionIndicatorViewModel(scene, selectionIndicatorElement, container) {
|
|
253689
|
-
if (!defined_default(scene)) {
|
|
253690
|
-
throw new DeveloperError_default("scene is required.");
|
|
253691
|
-
}
|
|
253692
|
-
if (!defined_default(selectionIndicatorElement)) {
|
|
253693
|
-
throw new DeveloperError_default("selectionIndicatorElement is required.");
|
|
253694
|
-
}
|
|
253695
|
-
if (!defined_default(container)) {
|
|
253696
|
-
throw new DeveloperError_default("container is required.");
|
|
253697
|
-
}
|
|
253698
|
-
this._scene = scene;
|
|
253699
|
-
this._screenPositionX = offScreen;
|
|
253700
|
-
this._screenPositionY = offScreen;
|
|
253701
|
-
this._tweens = scene.tweens;
|
|
253702
|
-
this._container = container ?? document.body;
|
|
253703
|
-
this._selectionIndicatorElement = selectionIndicatorElement;
|
|
253704
|
-
this._scale = 1;
|
|
253705
|
-
this.position = void 0;
|
|
253706
|
-
this.showSelection = false;
|
|
253707
|
-
knockout_default.track(this, [
|
|
253708
|
-
"position",
|
|
253709
|
-
"_screenPositionX",
|
|
253710
|
-
"_screenPositionY",
|
|
253711
|
-
"_scale",
|
|
253712
|
-
"showSelection"
|
|
253713
|
-
]);
|
|
253714
|
-
this.isVisible = void 0;
|
|
253715
|
-
knockout_default.defineProperty(this, "isVisible", {
|
|
253716
|
-
get: function() {
|
|
253717
|
-
return this.showSelection && defined_default(this.position);
|
|
253718
|
-
}
|
|
253719
|
-
});
|
|
253720
|
-
knockout_default.defineProperty(this, "_transform", {
|
|
253721
|
-
get: function() {
|
|
253722
|
-
return `scale(${this._scale})`;
|
|
253723
|
-
}
|
|
253724
|
-
});
|
|
253725
|
-
this.computeScreenSpacePosition = function(position, result) {
|
|
253726
|
-
return SceneTransforms_default.worldToWindowCoordinates(scene, position, result);
|
|
253727
|
-
};
|
|
253728
|
-
}
|
|
253729
|
-
SelectionIndicatorViewModel.prototype.update = function() {
|
|
253730
|
-
if (this.showSelection && defined_default(this.position)) {
|
|
253731
|
-
const screenPosition = this.computeScreenSpacePosition(
|
|
253732
|
-
this.position,
|
|
253733
|
-
screenSpacePos
|
|
253734
|
-
);
|
|
253735
|
-
if (!defined_default(screenPosition)) {
|
|
253736
|
-
this._screenPositionX = offScreen;
|
|
253737
|
-
this._screenPositionY = offScreen;
|
|
253738
|
-
} else {
|
|
253739
|
-
const container = this._container;
|
|
253740
|
-
const containerWidth = container.parentNode.clientWidth;
|
|
253741
|
-
const containerHeight = container.parentNode.clientHeight;
|
|
253742
|
-
const indicatorSize = this._selectionIndicatorElement.clientWidth;
|
|
253743
|
-
const halfSize = indicatorSize * 0.5;
|
|
253744
|
-
screenPosition.x = Math.min(
|
|
253745
|
-
Math.max(screenPosition.x, -indicatorSize),
|
|
253746
|
-
containerWidth + indicatorSize
|
|
253747
|
-
) - halfSize;
|
|
253748
|
-
screenPosition.y = Math.min(
|
|
253749
|
-
Math.max(screenPosition.y, -indicatorSize),
|
|
253750
|
-
containerHeight + indicatorSize
|
|
253751
|
-
) - halfSize;
|
|
253752
|
-
this._screenPositionX = `${Math.floor(screenPosition.x + 0.25)}px`;
|
|
253753
|
-
this._screenPositionY = `${Math.floor(screenPosition.y + 0.25)}px`;
|
|
253754
|
-
}
|
|
253755
|
-
}
|
|
253756
|
-
};
|
|
253757
|
-
SelectionIndicatorViewModel.prototype.animateAppear = function() {
|
|
253758
|
-
this._tweens.addProperty({
|
|
253759
|
-
object: this,
|
|
253760
|
-
property: "_scale",
|
|
253761
|
-
startValue: 2,
|
|
253762
|
-
stopValue: 1,
|
|
253763
|
-
duration: 0.8,
|
|
253764
|
-
easingFunction: EasingFunction_default.EXPONENTIAL_OUT
|
|
253765
|
-
});
|
|
253766
|
-
};
|
|
253767
|
-
SelectionIndicatorViewModel.prototype.animateDepart = function() {
|
|
253768
|
-
this._tweens.addProperty({
|
|
253769
|
-
object: this,
|
|
253770
|
-
property: "_scale",
|
|
253771
|
-
startValue: this._scale,
|
|
253772
|
-
stopValue: 1.5,
|
|
253773
|
-
duration: 0.8,
|
|
253774
|
-
easingFunction: EasingFunction_default.EXPONENTIAL_OUT
|
|
253775
|
-
});
|
|
253776
|
-
};
|
|
253777
|
-
Object.defineProperties(SelectionIndicatorViewModel.prototype, {
|
|
253778
|
-
/**
|
|
253779
|
-
* Gets the HTML element containing the selection indicator.
|
|
253780
|
-
* @memberof SelectionIndicatorViewModel.prototype
|
|
253781
|
-
*
|
|
253782
|
-
* @type {Element}
|
|
253783
|
-
*/
|
|
253784
|
-
container: {
|
|
253785
|
-
get: function() {
|
|
253786
|
-
return this._container;
|
|
253787
|
-
}
|
|
253788
|
-
},
|
|
253789
|
-
/**
|
|
253790
|
-
* Gets the HTML element that holds the selection indicator.
|
|
253791
|
-
* @memberof SelectionIndicatorViewModel.prototype
|
|
253792
|
-
*
|
|
253793
|
-
* @type {Element}
|
|
253794
|
-
*/
|
|
253795
|
-
selectionIndicatorElement: {
|
|
253796
|
-
get: function() {
|
|
253797
|
-
return this._selectionIndicatorElement;
|
|
253798
|
-
}
|
|
253799
|
-
},
|
|
253800
|
-
/**
|
|
253801
|
-
* Gets the scene being used.
|
|
253802
|
-
* @memberof SelectionIndicatorViewModel.prototype
|
|
253803
|
-
*
|
|
253804
|
-
* @type {Scene}
|
|
253805
|
-
*/
|
|
253806
|
-
scene: {
|
|
253807
|
-
get: function() {
|
|
253808
|
-
return this._scene;
|
|
253809
|
-
}
|
|
253810
|
-
}
|
|
253811
|
-
});
|
|
253812
|
-
var SelectionIndicatorViewModel_default = SelectionIndicatorViewModel;
|
|
253813
|
-
|
|
253814
|
-
// packages/widgets/Source/SelectionIndicator/SelectionIndicator.js
|
|
253815
|
-
function SelectionIndicator(container, scene) {
|
|
253816
|
-
if (!defined_default(container)) {
|
|
253817
|
-
throw new DeveloperError_default("container is required.");
|
|
253818
|
-
}
|
|
253819
|
-
container = getElement_default(container);
|
|
253820
|
-
this._container = container;
|
|
253821
|
-
const el = document.createElement("div");
|
|
253822
|
-
el.className = "cesium-selection-wrapper";
|
|
253823
|
-
el.setAttribute(
|
|
253824
|
-
"data-bind",
|
|
253825
|
-
'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'
|
|
253826
|
-
);
|
|
253827
|
-
container.appendChild(el);
|
|
253828
|
-
this._element = el;
|
|
253829
|
-
const svgNS3 = "http://www.w3.org/2000/svg";
|
|
253830
|
-
const path = "M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z";
|
|
253831
|
-
const svg2 = document.createElementNS(svgNS3, "svg:svg");
|
|
253832
|
-
svg2.setAttribute("width", 160);
|
|
253833
|
-
svg2.setAttribute("height", 160);
|
|
253834
|
-
svg2.setAttribute("viewBox", "0 0 160 160");
|
|
253835
|
-
const group = document.createElementNS(svgNS3, "g");
|
|
253836
|
-
group.setAttribute("transform", "translate(80,80)");
|
|
253837
|
-
svg2.appendChild(group);
|
|
253838
|
-
const pathElement = document.createElementNS(svgNS3, "path");
|
|
253839
|
-
pathElement.setAttribute("data-bind", "attr: { transform: _transform }");
|
|
253840
|
-
pathElement.setAttribute("d", path);
|
|
253841
|
-
group.appendChild(pathElement);
|
|
253842
|
-
el.appendChild(svg2);
|
|
253843
|
-
const viewModel = new SelectionIndicatorViewModel_default(
|
|
253844
|
-
scene,
|
|
253845
|
-
this._element,
|
|
253846
|
-
this._container
|
|
253847
|
-
);
|
|
253848
|
-
this._viewModel = viewModel;
|
|
253849
|
-
knockout_default.applyBindings(this._viewModel, this._element);
|
|
253850
|
-
}
|
|
253851
|
-
Object.defineProperties(SelectionIndicator.prototype, {
|
|
253852
|
-
/**
|
|
253853
|
-
* Gets the parent container.
|
|
253854
|
-
* @memberof SelectionIndicator.prototype
|
|
253855
|
-
*
|
|
253856
|
-
* @type {Element}
|
|
253857
|
-
*/
|
|
253858
|
-
container: {
|
|
253859
|
-
get: function() {
|
|
253860
|
-
return this._container;
|
|
253861
|
-
}
|
|
253862
|
-
},
|
|
253863
|
-
/**
|
|
253864
|
-
* Gets the view model.
|
|
253865
|
-
* @memberof SelectionIndicator.prototype
|
|
253866
|
-
*
|
|
253867
|
-
* @type {SelectionIndicatorViewModel}
|
|
253868
|
-
*/
|
|
253869
|
-
viewModel: {
|
|
253870
|
-
get: function() {
|
|
253871
|
-
return this._viewModel;
|
|
253872
|
-
}
|
|
253873
|
-
}
|
|
253874
|
-
});
|
|
253875
|
-
SelectionIndicator.prototype.isDestroyed = function() {
|
|
253876
|
-
return false;
|
|
253877
|
-
};
|
|
253878
|
-
SelectionIndicator.prototype.destroy = function() {
|
|
253879
|
-
const container = this._container;
|
|
253880
|
-
knockout_default.cleanNode(this._element);
|
|
253881
|
-
container.removeChild(this._element);
|
|
253882
|
-
return destroyObject_default(this);
|
|
253883
|
-
};
|
|
253884
|
-
var SelectionIndicator_default = SelectionIndicator;
|
|
253885
|
-
|
|
253886
253204
|
// packages/widgets/Source/NavigationHelpButton/NavigationHelpButton.js
|
|
253887
|
-
var
|
|
253205
|
+
var import_InlineWorkers1310 = __toESM(require_InlineWorkers(), 1);
|
|
253888
253206
|
|
|
253889
253207
|
// packages/widgets/Source/NavigationHelpButton/NavigationHelpButtonViewModel.js
|
|
253890
|
-
var
|
|
253208
|
+
var import_InlineWorkers1309 = __toESM(require_InlineWorkers(), 1);
|
|
253891
253209
|
function NavigationHelpButtonViewModel() {
|
|
253892
253210
|
this.showInstructions = false;
|
|
253893
253211
|
const that = this;
|
|
@@ -254085,11 +253403,242 @@ ${terrainTip}`;
|
|
|
254085
253403
|
};
|
|
254086
253404
|
var NavigationHelpButton_default = NavigationHelpButton;
|
|
254087
253405
|
|
|
253406
|
+
// packages/widgets/Source/ProjectionPicker/ProjectionPicker.js
|
|
253407
|
+
var import_InlineWorkers1312 = __toESM(require_InlineWorkers(), 1);
|
|
253408
|
+
|
|
253409
|
+
// packages/widgets/Source/ProjectionPicker/ProjectionPickerViewModel.js
|
|
253410
|
+
var import_InlineWorkers1311 = __toESM(require_InlineWorkers(), 1);
|
|
253411
|
+
function ProjectionPickerViewModel(scene) {
|
|
253412
|
+
if (!defined_default(scene)) {
|
|
253413
|
+
throw new DeveloperError_default("scene is required.");
|
|
253414
|
+
}
|
|
253415
|
+
this._scene = scene;
|
|
253416
|
+
this._orthographic = scene.camera.frustum instanceof OrthographicFrustum_default;
|
|
253417
|
+
this._flightInProgress = false;
|
|
253418
|
+
this.dropDownVisible = false;
|
|
253419
|
+
this.tooltipPerspective = "Perspective Projection";
|
|
253420
|
+
this.tooltipOrthographic = "Orthographic Projection";
|
|
253421
|
+
this.selectedTooltip = void 0;
|
|
253422
|
+
this.sceneMode = scene.mode;
|
|
253423
|
+
knockout_default.track(this, [
|
|
253424
|
+
"_orthographic",
|
|
253425
|
+
"_flightInProgress",
|
|
253426
|
+
"sceneMode",
|
|
253427
|
+
"dropDownVisible",
|
|
253428
|
+
"tooltipPerspective",
|
|
253429
|
+
"tooltipOrthographic"
|
|
253430
|
+
]);
|
|
253431
|
+
const that = this;
|
|
253432
|
+
knockout_default.defineProperty(this, "selectedTooltip", function() {
|
|
253433
|
+
if (that._orthographic) {
|
|
253434
|
+
return that.tooltipOrthographic;
|
|
253435
|
+
}
|
|
253436
|
+
return that.tooltipPerspective;
|
|
253437
|
+
});
|
|
253438
|
+
this._toggleDropDown = createCommand_default(function() {
|
|
253439
|
+
if (that.sceneMode === SceneMode_default.SCENE2D || that._flightInProgress) {
|
|
253440
|
+
return;
|
|
253441
|
+
}
|
|
253442
|
+
that.dropDownVisible = !that.dropDownVisible;
|
|
253443
|
+
});
|
|
253444
|
+
this._eventHelper = new EventHelper_default();
|
|
253445
|
+
this._eventHelper.add(
|
|
253446
|
+
scene.morphComplete,
|
|
253447
|
+
function(transitioner, oldMode, newMode, isMorphing) {
|
|
253448
|
+
that.sceneMode = newMode;
|
|
253449
|
+
that._orthographic = newMode === SceneMode_default.SCENE2D || that._scene.camera.frustum instanceof OrthographicFrustum_default;
|
|
253450
|
+
}
|
|
253451
|
+
);
|
|
253452
|
+
this._eventHelper.add(scene.preRender, function() {
|
|
253453
|
+
that._flightInProgress = defined_default(scene.camera._currentFlight);
|
|
253454
|
+
});
|
|
253455
|
+
this._switchToPerspective = createCommand_default(function() {
|
|
253456
|
+
if (that.sceneMode === SceneMode_default.SCENE2D) {
|
|
253457
|
+
return;
|
|
253458
|
+
}
|
|
253459
|
+
that._scene.camera.switchToPerspectiveFrustum();
|
|
253460
|
+
that._orthographic = false;
|
|
253461
|
+
that.dropDownVisible = false;
|
|
253462
|
+
});
|
|
253463
|
+
this._switchToOrthographic = createCommand_default(function() {
|
|
253464
|
+
if (that.sceneMode === SceneMode_default.SCENE2D) {
|
|
253465
|
+
return;
|
|
253466
|
+
}
|
|
253467
|
+
that._scene.camera.switchToOrthographicFrustum();
|
|
253468
|
+
that._orthographic = true;
|
|
253469
|
+
that.dropDownVisible = false;
|
|
253470
|
+
});
|
|
253471
|
+
this._sceneMode = SceneMode_default;
|
|
253472
|
+
}
|
|
253473
|
+
Object.defineProperties(ProjectionPickerViewModel.prototype, {
|
|
253474
|
+
/**
|
|
253475
|
+
* Gets the scene
|
|
253476
|
+
* @memberof ProjectionPickerViewModel.prototype
|
|
253477
|
+
* @type {Scene}
|
|
253478
|
+
*/
|
|
253479
|
+
scene: {
|
|
253480
|
+
get: function() {
|
|
253481
|
+
return this._scene;
|
|
253482
|
+
}
|
|
253483
|
+
},
|
|
253484
|
+
/**
|
|
253485
|
+
* Gets the command to toggle the drop down box.
|
|
253486
|
+
* @memberof ProjectionPickerViewModel.prototype
|
|
253487
|
+
*
|
|
253488
|
+
* @type {Command}
|
|
253489
|
+
*/
|
|
253490
|
+
toggleDropDown: {
|
|
253491
|
+
get: function() {
|
|
253492
|
+
return this._toggleDropDown;
|
|
253493
|
+
}
|
|
253494
|
+
},
|
|
253495
|
+
/**
|
|
253496
|
+
* Gets the command to switch to a perspective projection.
|
|
253497
|
+
* @memberof ProjectionPickerViewModel.prototype
|
|
253498
|
+
*
|
|
253499
|
+
* @type {Command}
|
|
253500
|
+
*/
|
|
253501
|
+
switchToPerspective: {
|
|
253502
|
+
get: function() {
|
|
253503
|
+
return this._switchToPerspective;
|
|
253504
|
+
}
|
|
253505
|
+
},
|
|
253506
|
+
/**
|
|
253507
|
+
* Gets the command to switch to orthographic projection.
|
|
253508
|
+
* @memberof ProjectionPickerViewModel.prototype
|
|
253509
|
+
*
|
|
253510
|
+
* @type {Command}
|
|
253511
|
+
*/
|
|
253512
|
+
switchToOrthographic: {
|
|
253513
|
+
get: function() {
|
|
253514
|
+
return this._switchToOrthographic;
|
|
253515
|
+
}
|
|
253516
|
+
},
|
|
253517
|
+
/**
|
|
253518
|
+
* Gets whether the scene is currently using an orthographic projection.
|
|
253519
|
+
* @memberof ProjectionPickerViewModel.prototype
|
|
253520
|
+
*
|
|
253521
|
+
* @type {Command}
|
|
253522
|
+
*/
|
|
253523
|
+
isOrthographicProjection: {
|
|
253524
|
+
get: function() {
|
|
253525
|
+
return this._orthographic;
|
|
253526
|
+
}
|
|
253527
|
+
}
|
|
253528
|
+
});
|
|
253529
|
+
ProjectionPickerViewModel.prototype.isDestroyed = function() {
|
|
253530
|
+
return false;
|
|
253531
|
+
};
|
|
253532
|
+
ProjectionPickerViewModel.prototype.destroy = function() {
|
|
253533
|
+
this._eventHelper.removeAll();
|
|
253534
|
+
destroyObject_default(this);
|
|
253535
|
+
};
|
|
253536
|
+
var ProjectionPickerViewModel_default = ProjectionPickerViewModel;
|
|
253537
|
+
|
|
253538
|
+
// packages/widgets/Source/ProjectionPicker/ProjectionPicker.js
|
|
253539
|
+
var perspectivePath = "M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z";
|
|
253540
|
+
var orthographicPath = "m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";
|
|
253541
|
+
function ProjectionPicker(container, scene) {
|
|
253542
|
+
if (!defined_default(container)) {
|
|
253543
|
+
throw new DeveloperError_default("container is required.");
|
|
253544
|
+
}
|
|
253545
|
+
if (!defined_default(scene)) {
|
|
253546
|
+
throw new DeveloperError_default("scene is required.");
|
|
253547
|
+
}
|
|
253548
|
+
container = getElement_default(container);
|
|
253549
|
+
const viewModel = new ProjectionPickerViewModel_default(scene);
|
|
253550
|
+
viewModel._perspectivePath = perspectivePath;
|
|
253551
|
+
viewModel._orthographicPath = orthographicPath;
|
|
253552
|
+
const wrapper = document.createElement("span");
|
|
253553
|
+
wrapper.className = "cesium-projectionPicker-wrapper cesium-toolbar-button";
|
|
253554
|
+
container.appendChild(wrapper);
|
|
253555
|
+
const button = document.createElement("button");
|
|
253556
|
+
button.type = "button";
|
|
253557
|
+
button.className = "cesium-button cesium-toolbar-button";
|
|
253558
|
+
button.setAttribute(
|
|
253559
|
+
"data-bind",
|
|
253560
|
+
'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'
|
|
253561
|
+
);
|
|
253562
|
+
button.innerHTML = '<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->';
|
|
253563
|
+
wrapper.appendChild(button);
|
|
253564
|
+
const perspectiveButton = document.createElement("button");
|
|
253565
|
+
perspectiveButton.type = "button";
|
|
253566
|
+
perspectiveButton.className = "cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon";
|
|
253567
|
+
perspectiveButton.setAttribute(
|
|
253568
|
+
"data-bind",
|
|
253569
|
+
'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'
|
|
253570
|
+
);
|
|
253571
|
+
wrapper.appendChild(perspectiveButton);
|
|
253572
|
+
const orthographicButton = document.createElement("button");
|
|
253573
|
+
orthographicButton.type = "button";
|
|
253574
|
+
orthographicButton.className = "cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon";
|
|
253575
|
+
orthographicButton.setAttribute(
|
|
253576
|
+
"data-bind",
|
|
253577
|
+
'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'
|
|
253578
|
+
);
|
|
253579
|
+
wrapper.appendChild(orthographicButton);
|
|
253580
|
+
knockout_default.applyBindings(viewModel, wrapper);
|
|
253581
|
+
this._viewModel = viewModel;
|
|
253582
|
+
this._container = container;
|
|
253583
|
+
this._wrapper = wrapper;
|
|
253584
|
+
this._closeDropDown = function(e) {
|
|
253585
|
+
if (!wrapper.contains(e.target)) {
|
|
253586
|
+
viewModel.dropDownVisible = false;
|
|
253587
|
+
}
|
|
253588
|
+
};
|
|
253589
|
+
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253590
|
+
document.addEventListener("pointerdown", this._closeDropDown, true);
|
|
253591
|
+
} else {
|
|
253592
|
+
document.addEventListener("mousedown", this._closeDropDown, true);
|
|
253593
|
+
document.addEventListener("touchstart", this._closeDropDown, true);
|
|
253594
|
+
}
|
|
253595
|
+
}
|
|
253596
|
+
Object.defineProperties(ProjectionPicker.prototype, {
|
|
253597
|
+
/**
|
|
253598
|
+
* Gets the parent container.
|
|
253599
|
+
* @memberof ProjectionPicker.prototype
|
|
253600
|
+
*
|
|
253601
|
+
* @type {Element}
|
|
253602
|
+
*/
|
|
253603
|
+
container: {
|
|
253604
|
+
get: function() {
|
|
253605
|
+
return this._container;
|
|
253606
|
+
}
|
|
253607
|
+
},
|
|
253608
|
+
/**
|
|
253609
|
+
* Gets the view model.
|
|
253610
|
+
* @memberof ProjectionPicker.prototype
|
|
253611
|
+
*
|
|
253612
|
+
* @type {ProjectionPickerViewModel}
|
|
253613
|
+
*/
|
|
253614
|
+
viewModel: {
|
|
253615
|
+
get: function() {
|
|
253616
|
+
return this._viewModel;
|
|
253617
|
+
}
|
|
253618
|
+
}
|
|
253619
|
+
});
|
|
253620
|
+
ProjectionPicker.prototype.isDestroyed = function() {
|
|
253621
|
+
return false;
|
|
253622
|
+
};
|
|
253623
|
+
ProjectionPicker.prototype.destroy = function() {
|
|
253624
|
+
this._viewModel.destroy();
|
|
253625
|
+
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
253626
|
+
document.removeEventListener("pointerdown", this._closeDropDown, true);
|
|
253627
|
+
} else {
|
|
253628
|
+
document.removeEventListener("mousedown", this._closeDropDown, true);
|
|
253629
|
+
document.removeEventListener("touchstart", this._closeDropDown, true);
|
|
253630
|
+
}
|
|
253631
|
+
knockout_default.cleanNode(this._wrapper);
|
|
253632
|
+
this._container.removeChild(this._wrapper);
|
|
253633
|
+
return destroyObject_default(this);
|
|
253634
|
+
};
|
|
253635
|
+
var ProjectionPicker_default = ProjectionPicker;
|
|
253636
|
+
|
|
254088
253637
|
// packages/widgets/Source/Timeline/Timeline.js
|
|
254089
|
-
var
|
|
253638
|
+
var import_InlineWorkers1315 = __toESM(require_InlineWorkers(), 1);
|
|
254090
253639
|
|
|
254091
253640
|
// packages/widgets/Source/Timeline/TimelineHighlightRange.js
|
|
254092
|
-
var
|
|
253641
|
+
var import_InlineWorkers1313 = __toESM(require_InlineWorkers(), 1);
|
|
254093
253642
|
function TimelineHighlightRange(color, heightInPx, base) {
|
|
254094
253643
|
this._color = color;
|
|
254095
253644
|
this._height = heightInPx;
|
|
@@ -254144,7 +253693,7 @@ ${terrainTip}`;
|
|
|
254144
253693
|
var TimelineHighlightRange_default = TimelineHighlightRange;
|
|
254145
253694
|
|
|
254146
253695
|
// packages/widgets/Source/Timeline/TimelineTrack.js
|
|
254147
|
-
var
|
|
253696
|
+
var import_InlineWorkers1314 = __toESM(require_InlineWorkers(), 1);
|
|
254148
253697
|
function TimelineTrack(interval, pixelHeight, color, backgroundColor) {
|
|
254149
253698
|
this.interval = interval;
|
|
254150
253699
|
this.height = pixelHeight;
|
|
@@ -255011,11 +254560,257 @@ ${terrainTip}`;
|
|
|
255011
254560
|
};
|
|
255012
254561
|
var Timeline_default = Timeline;
|
|
255013
254562
|
|
|
254563
|
+
// packages/widgets/Source/SceneModePicker/SceneModePicker.js
|
|
254564
|
+
var import_InlineWorkers1317 = __toESM(require_InlineWorkers(), 1);
|
|
254565
|
+
|
|
254566
|
+
// packages/widgets/Source/SceneModePicker/SceneModePickerViewModel.js
|
|
254567
|
+
var import_InlineWorkers1316 = __toESM(require_InlineWorkers(), 1);
|
|
254568
|
+
function SceneModePickerViewModel(scene, duration) {
|
|
254569
|
+
if (!defined_default(scene)) {
|
|
254570
|
+
throw new DeveloperError_default("scene is required.");
|
|
254571
|
+
}
|
|
254572
|
+
this._scene = scene;
|
|
254573
|
+
const that = this;
|
|
254574
|
+
const morphStart = function(transitioner, oldMode, newMode, isMorphing) {
|
|
254575
|
+
that.sceneMode = newMode;
|
|
254576
|
+
that.dropDownVisible = false;
|
|
254577
|
+
};
|
|
254578
|
+
this._eventHelper = new EventHelper_default();
|
|
254579
|
+
this._eventHelper.add(scene.morphStart, morphStart);
|
|
254580
|
+
this._duration = duration ?? 2;
|
|
254581
|
+
this.sceneMode = scene.mode;
|
|
254582
|
+
this.dropDownVisible = false;
|
|
254583
|
+
this.tooltip2D = "2D";
|
|
254584
|
+
this.tooltip3D = "3D";
|
|
254585
|
+
this.tooltipColumbusView = "Columbus View";
|
|
254586
|
+
knockout_default.track(this, [
|
|
254587
|
+
"sceneMode",
|
|
254588
|
+
"dropDownVisible",
|
|
254589
|
+
"tooltip2D",
|
|
254590
|
+
"tooltip3D",
|
|
254591
|
+
"tooltipColumbusView"
|
|
254592
|
+
]);
|
|
254593
|
+
this.selectedTooltip = void 0;
|
|
254594
|
+
knockout_default.defineProperty(this, "selectedTooltip", function() {
|
|
254595
|
+
const mode2 = that.sceneMode;
|
|
254596
|
+
if (mode2 === SceneMode_default.SCENE2D) {
|
|
254597
|
+
return that.tooltip2D;
|
|
254598
|
+
}
|
|
254599
|
+
if (mode2 === SceneMode_default.SCENE3D) {
|
|
254600
|
+
return that.tooltip3D;
|
|
254601
|
+
}
|
|
254602
|
+
return that.tooltipColumbusView;
|
|
254603
|
+
});
|
|
254604
|
+
this._toggleDropDown = createCommand_default(function() {
|
|
254605
|
+
that.dropDownVisible = !that.dropDownVisible;
|
|
254606
|
+
});
|
|
254607
|
+
this._morphTo2D = createCommand_default(function() {
|
|
254608
|
+
scene.morphTo2D(that._duration);
|
|
254609
|
+
});
|
|
254610
|
+
this._morphTo3D = createCommand_default(function() {
|
|
254611
|
+
scene.morphTo3D(that._duration);
|
|
254612
|
+
});
|
|
254613
|
+
this._morphToColumbusView = createCommand_default(function() {
|
|
254614
|
+
scene.morphToColumbusView(that._duration);
|
|
254615
|
+
});
|
|
254616
|
+
this._sceneMode = SceneMode_default;
|
|
254617
|
+
}
|
|
254618
|
+
Object.defineProperties(SceneModePickerViewModel.prototype, {
|
|
254619
|
+
/**
|
|
254620
|
+
* Gets the scene
|
|
254621
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254622
|
+
* @type {Scene}
|
|
254623
|
+
*/
|
|
254624
|
+
scene: {
|
|
254625
|
+
get: function() {
|
|
254626
|
+
return this._scene;
|
|
254627
|
+
}
|
|
254628
|
+
},
|
|
254629
|
+
/**
|
|
254630
|
+
* Gets or sets the the duration of scene mode transition animations in seconds.
|
|
254631
|
+
* A value of zero causes the scene to instantly change modes.
|
|
254632
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254633
|
+
* @type {number}
|
|
254634
|
+
*/
|
|
254635
|
+
duration: {
|
|
254636
|
+
get: function() {
|
|
254637
|
+
return this._duration;
|
|
254638
|
+
},
|
|
254639
|
+
set: function(value) {
|
|
254640
|
+
if (value < 0) {
|
|
254641
|
+
throw new DeveloperError_default("duration value must be positive.");
|
|
254642
|
+
}
|
|
254643
|
+
this._duration = value;
|
|
254644
|
+
}
|
|
254645
|
+
},
|
|
254646
|
+
/**
|
|
254647
|
+
* Gets the command to toggle the drop down box.
|
|
254648
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254649
|
+
*
|
|
254650
|
+
* @type {Command}
|
|
254651
|
+
*/
|
|
254652
|
+
toggleDropDown: {
|
|
254653
|
+
get: function() {
|
|
254654
|
+
return this._toggleDropDown;
|
|
254655
|
+
}
|
|
254656
|
+
},
|
|
254657
|
+
/**
|
|
254658
|
+
* Gets the command to morph to 2D.
|
|
254659
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254660
|
+
*
|
|
254661
|
+
* @type {Command}
|
|
254662
|
+
*/
|
|
254663
|
+
morphTo2D: {
|
|
254664
|
+
get: function() {
|
|
254665
|
+
return this._morphTo2D;
|
|
254666
|
+
}
|
|
254667
|
+
},
|
|
254668
|
+
/**
|
|
254669
|
+
* Gets the command to morph to 3D.
|
|
254670
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254671
|
+
*
|
|
254672
|
+
* @type {Command}
|
|
254673
|
+
*/
|
|
254674
|
+
morphTo3D: {
|
|
254675
|
+
get: function() {
|
|
254676
|
+
return this._morphTo3D;
|
|
254677
|
+
}
|
|
254678
|
+
},
|
|
254679
|
+
/**
|
|
254680
|
+
* Gets the command to morph to Columbus View.
|
|
254681
|
+
* @memberof SceneModePickerViewModel.prototype
|
|
254682
|
+
*
|
|
254683
|
+
* @type {Command}
|
|
254684
|
+
*/
|
|
254685
|
+
morphToColumbusView: {
|
|
254686
|
+
get: function() {
|
|
254687
|
+
return this._morphToColumbusView;
|
|
254688
|
+
}
|
|
254689
|
+
}
|
|
254690
|
+
});
|
|
254691
|
+
SceneModePickerViewModel.prototype.isDestroyed = function() {
|
|
254692
|
+
return false;
|
|
254693
|
+
};
|
|
254694
|
+
SceneModePickerViewModel.prototype.destroy = function() {
|
|
254695
|
+
this._eventHelper.removeAll();
|
|
254696
|
+
destroyObject_default(this);
|
|
254697
|
+
};
|
|
254698
|
+
var SceneModePickerViewModel_default = SceneModePickerViewModel;
|
|
254699
|
+
|
|
254700
|
+
// packages/widgets/Source/SceneModePicker/SceneModePicker.js
|
|
254701
|
+
var globePath = "m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z";
|
|
254702
|
+
var flatMapPath = "m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z";
|
|
254703
|
+
var columbusViewPath = "m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";
|
|
254704
|
+
function SceneModePicker(container, scene, duration) {
|
|
254705
|
+
if (!defined_default(container)) {
|
|
254706
|
+
throw new DeveloperError_default("container is required.");
|
|
254707
|
+
}
|
|
254708
|
+
if (!defined_default(scene)) {
|
|
254709
|
+
throw new DeveloperError_default("scene is required.");
|
|
254710
|
+
}
|
|
254711
|
+
container = getElement_default(container);
|
|
254712
|
+
const viewModel = new SceneModePickerViewModel_default(scene, duration);
|
|
254713
|
+
viewModel._globePath = globePath;
|
|
254714
|
+
viewModel._flatMapPath = flatMapPath;
|
|
254715
|
+
viewModel._columbusViewPath = columbusViewPath;
|
|
254716
|
+
const wrapper = document.createElement("span");
|
|
254717
|
+
wrapper.className = "cesium-sceneModePicker-wrapper cesium-toolbar-button";
|
|
254718
|
+
container.appendChild(wrapper);
|
|
254719
|
+
const button = document.createElement("button");
|
|
254720
|
+
button.type = "button";
|
|
254721
|
+
button.className = "cesium-button cesium-toolbar-button";
|
|
254722
|
+
button.setAttribute(
|
|
254723
|
+
"data-bind",
|
|
254724
|
+
'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'
|
|
254725
|
+
);
|
|
254726
|
+
button.innerHTML = '<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->';
|
|
254727
|
+
wrapper.appendChild(button);
|
|
254728
|
+
const morphTo3DButton = document.createElement("button");
|
|
254729
|
+
morphTo3DButton.type = "button";
|
|
254730
|
+
morphTo3DButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
254731
|
+
morphTo3DButton.setAttribute(
|
|
254732
|
+
"data-bind",
|
|
254733
|
+
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'
|
|
254734
|
+
);
|
|
254735
|
+
wrapper.appendChild(morphTo3DButton);
|
|
254736
|
+
const morphTo2DButton = document.createElement("button");
|
|
254737
|
+
morphTo2DButton.type = "button";
|
|
254738
|
+
morphTo2DButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
254739
|
+
morphTo2DButton.setAttribute(
|
|
254740
|
+
"data-bind",
|
|
254741
|
+
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'
|
|
254742
|
+
);
|
|
254743
|
+
wrapper.appendChild(morphTo2DButton);
|
|
254744
|
+
const morphToCVButton = document.createElement("button");
|
|
254745
|
+
morphToCVButton.type = "button";
|
|
254746
|
+
morphToCVButton.className = "cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon";
|
|
254747
|
+
morphToCVButton.setAttribute(
|
|
254748
|
+
"data-bind",
|
|
254749
|
+
'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'
|
|
254750
|
+
);
|
|
254751
|
+
wrapper.appendChild(morphToCVButton);
|
|
254752
|
+
knockout_default.applyBindings(viewModel, wrapper);
|
|
254753
|
+
this._viewModel = viewModel;
|
|
254754
|
+
this._container = container;
|
|
254755
|
+
this._wrapper = wrapper;
|
|
254756
|
+
this._closeDropDown = function(e) {
|
|
254757
|
+
if (!wrapper.contains(e.target)) {
|
|
254758
|
+
viewModel.dropDownVisible = false;
|
|
254759
|
+
}
|
|
254760
|
+
};
|
|
254761
|
+
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
254762
|
+
document.addEventListener("pointerdown", this._closeDropDown, true);
|
|
254763
|
+
} else {
|
|
254764
|
+
document.addEventListener("mousedown", this._closeDropDown, true);
|
|
254765
|
+
document.addEventListener("touchstart", this._closeDropDown, true);
|
|
254766
|
+
}
|
|
254767
|
+
}
|
|
254768
|
+
Object.defineProperties(SceneModePicker.prototype, {
|
|
254769
|
+
/**
|
|
254770
|
+
* Gets the parent container.
|
|
254771
|
+
* @memberof SceneModePicker.prototype
|
|
254772
|
+
*
|
|
254773
|
+
* @type {Element}
|
|
254774
|
+
*/
|
|
254775
|
+
container: {
|
|
254776
|
+
get: function() {
|
|
254777
|
+
return this._container;
|
|
254778
|
+
}
|
|
254779
|
+
},
|
|
254780
|
+
/**
|
|
254781
|
+
* Gets the view model.
|
|
254782
|
+
* @memberof SceneModePicker.prototype
|
|
254783
|
+
*
|
|
254784
|
+
* @type {SceneModePickerViewModel}
|
|
254785
|
+
*/
|
|
254786
|
+
viewModel: {
|
|
254787
|
+
get: function() {
|
|
254788
|
+
return this._viewModel;
|
|
254789
|
+
}
|
|
254790
|
+
}
|
|
254791
|
+
});
|
|
254792
|
+
SceneModePicker.prototype.isDestroyed = function() {
|
|
254793
|
+
return false;
|
|
254794
|
+
};
|
|
254795
|
+
SceneModePicker.prototype.destroy = function() {
|
|
254796
|
+
this._viewModel.destroy();
|
|
254797
|
+
if (FeatureDetection_default.supportsPointerEvents()) {
|
|
254798
|
+
document.removeEventListener("pointerdown", this._closeDropDown, true);
|
|
254799
|
+
} else {
|
|
254800
|
+
document.removeEventListener("mousedown", this._closeDropDown, true);
|
|
254801
|
+
document.removeEventListener("touchstart", this._closeDropDown, true);
|
|
254802
|
+
}
|
|
254803
|
+
knockout_default.cleanNode(this._wrapper);
|
|
254804
|
+
this._container.removeChild(this._wrapper);
|
|
254805
|
+
return destroyObject_default(this);
|
|
254806
|
+
};
|
|
254807
|
+
var SceneModePicker_default = SceneModePicker;
|
|
254808
|
+
|
|
255014
254809
|
// packages/widgets/Source/VRButton/VRButton.js
|
|
255015
|
-
var
|
|
254810
|
+
var import_InlineWorkers1319 = __toESM(require_InlineWorkers(), 1);
|
|
255016
254811
|
|
|
255017
254812
|
// packages/widgets/Source/VRButton/VRButtonViewModel.js
|
|
255018
|
-
var
|
|
254813
|
+
var import_InlineWorkers1318 = __toESM(require_InlineWorkers(), 1);
|
|
255019
254814
|
var import_nosleep = __toESM(require_src(), 1);
|
|
255020
254815
|
function lockScreen(orientation) {
|
|
255021
254816
|
let locked = false;
|
|
@@ -255239,10 +255034,10 @@ ${terrainTip}`;
|
|
|
255239
255034
|
var VRButton_default = VRButton;
|
|
255240
255035
|
|
|
255241
255036
|
// packages/widgets/Source/VoxelInspector/VoxelInspector.js
|
|
255242
|
-
var
|
|
255037
|
+
var import_InlineWorkers1321 = __toESM(require_InlineWorkers(), 1);
|
|
255243
255038
|
|
|
255244
255039
|
// packages/widgets/Source/VoxelInspector/VoxelInspectorViewModel.js
|
|
255245
|
-
var
|
|
255040
|
+
var import_InlineWorkers1320 = __toESM(require_InlineWorkers(), 1);
|
|
255246
255041
|
function formatShaderString(str) {
|
|
255247
255042
|
const lines = str.split("\n");
|
|
255248
255043
|
let firstLineIdx;
|
|
@@ -256304,6 +256099,211 @@ ${terrainTip}`;
|
|
|
256304
256099
|
}
|
|
256305
256100
|
var VoxelInspector_default = VoxelInspector;
|
|
256306
256101
|
|
|
256102
|
+
// packages/widgets/Source/SelectionIndicator/SelectionIndicator.js
|
|
256103
|
+
var import_InlineWorkers1323 = __toESM(require_InlineWorkers(), 1);
|
|
256104
|
+
|
|
256105
|
+
// packages/widgets/Source/SelectionIndicator/SelectionIndicatorViewModel.js
|
|
256106
|
+
var import_InlineWorkers1322 = __toESM(require_InlineWorkers(), 1);
|
|
256107
|
+
var screenSpacePos = new Cartesian2_default();
|
|
256108
|
+
var offScreen = "-1000px";
|
|
256109
|
+
function SelectionIndicatorViewModel(scene, selectionIndicatorElement, container) {
|
|
256110
|
+
if (!defined_default(scene)) {
|
|
256111
|
+
throw new DeveloperError_default("scene is required.");
|
|
256112
|
+
}
|
|
256113
|
+
if (!defined_default(selectionIndicatorElement)) {
|
|
256114
|
+
throw new DeveloperError_default("selectionIndicatorElement is required.");
|
|
256115
|
+
}
|
|
256116
|
+
if (!defined_default(container)) {
|
|
256117
|
+
throw new DeveloperError_default("container is required.");
|
|
256118
|
+
}
|
|
256119
|
+
this._scene = scene;
|
|
256120
|
+
this._screenPositionX = offScreen;
|
|
256121
|
+
this._screenPositionY = offScreen;
|
|
256122
|
+
this._tweens = scene.tweens;
|
|
256123
|
+
this._container = container ?? document.body;
|
|
256124
|
+
this._selectionIndicatorElement = selectionIndicatorElement;
|
|
256125
|
+
this._scale = 1;
|
|
256126
|
+
this.position = void 0;
|
|
256127
|
+
this.showSelection = false;
|
|
256128
|
+
knockout_default.track(this, [
|
|
256129
|
+
"position",
|
|
256130
|
+
"_screenPositionX",
|
|
256131
|
+
"_screenPositionY",
|
|
256132
|
+
"_scale",
|
|
256133
|
+
"showSelection"
|
|
256134
|
+
]);
|
|
256135
|
+
this.isVisible = void 0;
|
|
256136
|
+
knockout_default.defineProperty(this, "isVisible", {
|
|
256137
|
+
get: function() {
|
|
256138
|
+
return this.showSelection && defined_default(this.position);
|
|
256139
|
+
}
|
|
256140
|
+
});
|
|
256141
|
+
knockout_default.defineProperty(this, "_transform", {
|
|
256142
|
+
get: function() {
|
|
256143
|
+
return `scale(${this._scale})`;
|
|
256144
|
+
}
|
|
256145
|
+
});
|
|
256146
|
+
this.computeScreenSpacePosition = function(position, result) {
|
|
256147
|
+
return SceneTransforms_default.worldToWindowCoordinates(scene, position, result);
|
|
256148
|
+
};
|
|
256149
|
+
}
|
|
256150
|
+
SelectionIndicatorViewModel.prototype.update = function() {
|
|
256151
|
+
if (this.showSelection && defined_default(this.position)) {
|
|
256152
|
+
const screenPosition = this.computeScreenSpacePosition(
|
|
256153
|
+
this.position,
|
|
256154
|
+
screenSpacePos
|
|
256155
|
+
);
|
|
256156
|
+
if (!defined_default(screenPosition)) {
|
|
256157
|
+
this._screenPositionX = offScreen;
|
|
256158
|
+
this._screenPositionY = offScreen;
|
|
256159
|
+
} else {
|
|
256160
|
+
const container = this._container;
|
|
256161
|
+
const containerWidth = container.parentNode.clientWidth;
|
|
256162
|
+
const containerHeight = container.parentNode.clientHeight;
|
|
256163
|
+
const indicatorSize = this._selectionIndicatorElement.clientWidth;
|
|
256164
|
+
const halfSize = indicatorSize * 0.5;
|
|
256165
|
+
screenPosition.x = Math.min(
|
|
256166
|
+
Math.max(screenPosition.x, -indicatorSize),
|
|
256167
|
+
containerWidth + indicatorSize
|
|
256168
|
+
) - halfSize;
|
|
256169
|
+
screenPosition.y = Math.min(
|
|
256170
|
+
Math.max(screenPosition.y, -indicatorSize),
|
|
256171
|
+
containerHeight + indicatorSize
|
|
256172
|
+
) - halfSize;
|
|
256173
|
+
this._screenPositionX = `${Math.floor(screenPosition.x + 0.25)}px`;
|
|
256174
|
+
this._screenPositionY = `${Math.floor(screenPosition.y + 0.25)}px`;
|
|
256175
|
+
}
|
|
256176
|
+
}
|
|
256177
|
+
};
|
|
256178
|
+
SelectionIndicatorViewModel.prototype.animateAppear = function() {
|
|
256179
|
+
this._tweens.addProperty({
|
|
256180
|
+
object: this,
|
|
256181
|
+
property: "_scale",
|
|
256182
|
+
startValue: 2,
|
|
256183
|
+
stopValue: 1,
|
|
256184
|
+
duration: 0.8,
|
|
256185
|
+
easingFunction: EasingFunction_default.EXPONENTIAL_OUT
|
|
256186
|
+
});
|
|
256187
|
+
};
|
|
256188
|
+
SelectionIndicatorViewModel.prototype.animateDepart = function() {
|
|
256189
|
+
this._tweens.addProperty({
|
|
256190
|
+
object: this,
|
|
256191
|
+
property: "_scale",
|
|
256192
|
+
startValue: this._scale,
|
|
256193
|
+
stopValue: 1.5,
|
|
256194
|
+
duration: 0.8,
|
|
256195
|
+
easingFunction: EasingFunction_default.EXPONENTIAL_OUT
|
|
256196
|
+
});
|
|
256197
|
+
};
|
|
256198
|
+
Object.defineProperties(SelectionIndicatorViewModel.prototype, {
|
|
256199
|
+
/**
|
|
256200
|
+
* Gets the HTML element containing the selection indicator.
|
|
256201
|
+
* @memberof SelectionIndicatorViewModel.prototype
|
|
256202
|
+
*
|
|
256203
|
+
* @type {Element}
|
|
256204
|
+
*/
|
|
256205
|
+
container: {
|
|
256206
|
+
get: function() {
|
|
256207
|
+
return this._container;
|
|
256208
|
+
}
|
|
256209
|
+
},
|
|
256210
|
+
/**
|
|
256211
|
+
* Gets the HTML element that holds the selection indicator.
|
|
256212
|
+
* @memberof SelectionIndicatorViewModel.prototype
|
|
256213
|
+
*
|
|
256214
|
+
* @type {Element}
|
|
256215
|
+
*/
|
|
256216
|
+
selectionIndicatorElement: {
|
|
256217
|
+
get: function() {
|
|
256218
|
+
return this._selectionIndicatorElement;
|
|
256219
|
+
}
|
|
256220
|
+
},
|
|
256221
|
+
/**
|
|
256222
|
+
* Gets the scene being used.
|
|
256223
|
+
* @memberof SelectionIndicatorViewModel.prototype
|
|
256224
|
+
*
|
|
256225
|
+
* @type {Scene}
|
|
256226
|
+
*/
|
|
256227
|
+
scene: {
|
|
256228
|
+
get: function() {
|
|
256229
|
+
return this._scene;
|
|
256230
|
+
}
|
|
256231
|
+
}
|
|
256232
|
+
});
|
|
256233
|
+
var SelectionIndicatorViewModel_default = SelectionIndicatorViewModel;
|
|
256234
|
+
|
|
256235
|
+
// packages/widgets/Source/SelectionIndicator/SelectionIndicator.js
|
|
256236
|
+
function SelectionIndicator(container, scene) {
|
|
256237
|
+
if (!defined_default(container)) {
|
|
256238
|
+
throw new DeveloperError_default("container is required.");
|
|
256239
|
+
}
|
|
256240
|
+
container = getElement_default(container);
|
|
256241
|
+
this._container = container;
|
|
256242
|
+
const el = document.createElement("div");
|
|
256243
|
+
el.className = "cesium-selection-wrapper";
|
|
256244
|
+
el.setAttribute(
|
|
256245
|
+
"data-bind",
|
|
256246
|
+
'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'
|
|
256247
|
+
);
|
|
256248
|
+
container.appendChild(el);
|
|
256249
|
+
this._element = el;
|
|
256250
|
+
const svgNS3 = "http://www.w3.org/2000/svg";
|
|
256251
|
+
const path = "M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z";
|
|
256252
|
+
const svg2 = document.createElementNS(svgNS3, "svg:svg");
|
|
256253
|
+
svg2.setAttribute("width", 160);
|
|
256254
|
+
svg2.setAttribute("height", 160);
|
|
256255
|
+
svg2.setAttribute("viewBox", "0 0 160 160");
|
|
256256
|
+
const group = document.createElementNS(svgNS3, "g");
|
|
256257
|
+
group.setAttribute("transform", "translate(80,80)");
|
|
256258
|
+
svg2.appendChild(group);
|
|
256259
|
+
const pathElement = document.createElementNS(svgNS3, "path");
|
|
256260
|
+
pathElement.setAttribute("data-bind", "attr: { transform: _transform }");
|
|
256261
|
+
pathElement.setAttribute("d", path);
|
|
256262
|
+
group.appendChild(pathElement);
|
|
256263
|
+
el.appendChild(svg2);
|
|
256264
|
+
const viewModel = new SelectionIndicatorViewModel_default(
|
|
256265
|
+
scene,
|
|
256266
|
+
this._element,
|
|
256267
|
+
this._container
|
|
256268
|
+
);
|
|
256269
|
+
this._viewModel = viewModel;
|
|
256270
|
+
knockout_default.applyBindings(this._viewModel, this._element);
|
|
256271
|
+
}
|
|
256272
|
+
Object.defineProperties(SelectionIndicator.prototype, {
|
|
256273
|
+
/**
|
|
256274
|
+
* Gets the parent container.
|
|
256275
|
+
* @memberof SelectionIndicator.prototype
|
|
256276
|
+
*
|
|
256277
|
+
* @type {Element}
|
|
256278
|
+
*/
|
|
256279
|
+
container: {
|
|
256280
|
+
get: function() {
|
|
256281
|
+
return this._container;
|
|
256282
|
+
}
|
|
256283
|
+
},
|
|
256284
|
+
/**
|
|
256285
|
+
* Gets the view model.
|
|
256286
|
+
* @memberof SelectionIndicator.prototype
|
|
256287
|
+
*
|
|
256288
|
+
* @type {SelectionIndicatorViewModel}
|
|
256289
|
+
*/
|
|
256290
|
+
viewModel: {
|
|
256291
|
+
get: function() {
|
|
256292
|
+
return this._viewModel;
|
|
256293
|
+
}
|
|
256294
|
+
}
|
|
256295
|
+
});
|
|
256296
|
+
SelectionIndicator.prototype.isDestroyed = function() {
|
|
256297
|
+
return false;
|
|
256298
|
+
};
|
|
256299
|
+
SelectionIndicator.prototype.destroy = function() {
|
|
256300
|
+
const container = this._container;
|
|
256301
|
+
knockout_default.cleanNode(this._element);
|
|
256302
|
+
container.removeChild(this._element);
|
|
256303
|
+
return destroyObject_default(this);
|
|
256304
|
+
};
|
|
256305
|
+
var SelectionIndicator_default = SelectionIndicator;
|
|
256306
|
+
|
|
256307
256307
|
// packages/widgets/Source/Viewer/Viewer.js
|
|
256308
256308
|
var import_InlineWorkers1324 = __toESM(require_InlineWorkers(), 1);
|
|
256309
256309
|
var boundingSphereScratch5 = new BoundingSphere_default();
|
|
@@ -258034,9 +258034,9 @@ ${terrainTip}`;
|
|
|
258034
258034
|
var viewerVoxelInspectorMixin_default = viewerVoxelInspectorMixin;
|
|
258035
258035
|
|
|
258036
258036
|
// packages/widgets/index.js
|
|
258037
|
-
globalThis.CESIUM_VERSION = "1.128.
|
|
258037
|
+
globalThis.CESIUM_VERSION = "1.128.26";
|
|
258038
258038
|
|
|
258039
258039
|
// Source/Cesium.js
|
|
258040
|
-
var VERSION2 = "1.128.
|
|
258040
|
+
var VERSION2 = "1.128.26";
|
|
258041
258041
|
return __toCommonJS(Cesium_exports);
|
|
258042
258042
|
})();
|