deeptwins-cesium-engine 0.0.3
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/ThirdParty/Workers/zip-web-worker.js +640 -0
- package/Build/Workers/chunk-2363JE27.js +163 -0
- package/Build/Workers/chunk-23T2IPHV.js +55 -0
- package/Build/Workers/chunk-27SAH2Q2.js +55 -0
- package/Build/Workers/chunk-2AM4E2WD.js +101 -0
- package/Build/Workers/chunk-2H4D4HBM.js +101 -0
- package/Build/Workers/chunk-2KBLMCYQ.js +198 -0
- package/Build/Workers/chunk-2MWF4IES.js +398 -0
- package/Build/Workers/chunk-2O7PRNCW.js +288 -0
- package/Build/Workers/chunk-2RCIRXNI.js +75 -0
- package/Build/Workers/chunk-3JIEAYRM.js +940 -0
- package/Build/Workers/chunk-3VNQVXD6.js +837 -0
- package/Build/Workers/chunk-3XR54LVR.js +75 -0
- package/Build/Workers/chunk-3YTMGEXW.js +1443 -0
- package/Build/Workers/chunk-3ZP3VA4L.js +171 -0
- package/Build/Workers/chunk-4AKOLNCZ.js +139 -0
- package/Build/Workers/chunk-4BHWJWS3.js +171 -0
- package/Build/Workers/chunk-4QSCEADX.js +1800 -0
- package/Build/Workers/chunk-4ZKQXB7T.js +1460 -0
- package/Build/Workers/chunk-4ZX6BO6C.js +476 -0
- package/Build/Workers/chunk-55NHNEI7.js +163 -0
- package/Build/Workers/chunk-5F3SUA6W.js +8366 -0
- package/Build/Workers/chunk-5FBLADWD.js +692 -0
- package/Build/Workers/chunk-5H7FXJTE.js +2719 -0
- package/Build/Workers/chunk-5JKH4AMT.js +58 -0
- package/Build/Workers/chunk-5MTUN2SE.js +642 -0
- package/Build/Workers/chunk-5PWCXSID.js +256 -0
- package/Build/Workers/chunk-5RL7XAZS.js +256 -0
- package/Build/Workers/chunk-5TZVQOFD.js +305 -0
- package/Build/Workers/chunk-67FTKXPJ.js +352 -0
- package/Build/Workers/chunk-6AIBN5NQ.js +1054 -0
- package/Build/Workers/chunk-6D6BOTSA.js +414 -0
- package/Build/Workers/chunk-6FGAWC5J.js +44 -0
- package/Build/Workers/chunk-6HKAPCSO.js +280 -0
- package/Build/Workers/chunk-6UJDVUJ4.js +8366 -0
- package/Build/Workers/chunk-73Q77JO7.js +138 -0
- package/Build/Workers/chunk-7A6QUBKY.js +58 -0
- package/Build/Workers/chunk-7APZZMCL.js +73 -0
- package/Build/Workers/chunk-7BHC3VOI.js +511 -0
- package/Build/Workers/chunk-7GQHESFY.js +368 -0
- package/Build/Workers/chunk-7MVC3OLP.js +58 -0
- package/Build/Workers/chunk-7UNMLR74.js +1800 -0
- package/Build/Workers/chunk-A2QTGP5S.js +55 -0
- package/Build/Workers/chunk-A3FZIBXG.js +55 -0
- package/Build/Workers/chunk-A53R2F2L.js +305 -0
- package/Build/Workers/chunk-A6LIUE7X.js +692 -0
- package/Build/Workers/chunk-A6YFUGJO.js +139 -0
- package/Build/Workers/chunk-AJYWXC6I.js +97 -0
- package/Build/Workers/chunk-ALTIGQTT.js +288 -0
- package/Build/Workers/chunk-AOIO5VUS.js +8366 -0
- package/Build/Workers/chunk-AT2CG6PG.js +3514 -0
- package/Build/Workers/chunk-ATX74V7S.js +55 -0
- package/Build/Workers/chunk-AZPXT6RB.js +1067 -0
- package/Build/Workers/chunk-B7JRBTT6.js +682 -0
- package/Build/Workers/chunk-BALMTCKJ.js +138 -0
- package/Build/Workers/chunk-BBYRID6W.js +352 -0
- package/Build/Workers/chunk-BDX4AYXL.js +162 -0
- package/Build/Workers/chunk-BG2DK4Q5.js +101 -0
- package/Build/Workers/chunk-BSNC3NBZ.js +139 -0
- package/Build/Workers/chunk-BZLYQCIC.js +958 -0
- package/Build/Workers/chunk-C4NX77B5.js +57 -0
- package/Build/Workers/chunk-CHNDJRYA.js +1054 -0
- package/Build/Workers/chunk-CJOV55CW.js +1067 -0
- package/Build/Workers/chunk-COGPE5Z2.js +241 -0
- package/Build/Workers/chunk-CRCK5VX6.js +497 -0
- package/Build/Workers/chunk-CTLQNSVP.js +455 -0
- package/Build/Workers/chunk-CW7W27IZ.js +299 -0
- package/Build/Workers/chunk-DICY26ID.js +2719 -0
- package/Build/Workers/chunk-DLAVWLZW.js +682 -0
- package/Build/Workers/chunk-DMEFNTUV.js +1317 -0
- package/Build/Workers/chunk-DQSJEOZY.js +55 -0
- package/Build/Workers/chunk-F6UXXCPK.js +3514 -0
- package/Build/Workers/chunk-FKIR6F3B.js +97 -0
- package/Build/Workers/chunk-FRBZJJVU.js +2719 -0
- package/Build/Workers/chunk-FRLH26PM.js +940 -0
- package/Build/Workers/chunk-FT6HYEKU.js +3514 -0
- package/Build/Workers/chunk-FYDCQ2VN.js +73 -0
- package/Build/Workers/chunk-G5OKIL5P.js +55 -0
- package/Build/Workers/chunk-G6VHLVWG.js +101 -0
- package/Build/Workers/chunk-GBGV4U6Z.js +219 -0
- package/Build/Workers/chunk-GDU4RZSZ.js +940 -0
- package/Build/Workers/chunk-GJRVCSXV.js +37 -0
- package/Build/Workers/chunk-GKWOUMYA.js +37 -0
- package/Build/Workers/chunk-GNDFFW5Z.js +1443 -0
- package/Build/Workers/chunk-GNQ5BH75.js +352 -0
- package/Build/Workers/chunk-GNQUZV4R.js +171 -0
- package/Build/Workers/chunk-GOCJHCLA.js +352 -0
- package/Build/Workers/chunk-GTY4K4IA.js +219 -0
- package/Build/Workers/chunk-GXBTJBHN.js +102 -0
- package/Build/Workers/chunk-H6Q7E4BQ.js +114 -0
- package/Build/Workers/chunk-HEGESGGY.js +219 -0
- package/Build/Workers/chunk-HG3HIMYL.js +241 -0
- package/Build/Workers/chunk-HGEYVFMI.js +1800 -0
- package/Build/Workers/chunk-HHGOFZVQ.js +124 -0
- package/Build/Workers/chunk-HXEVICMT.js +37 -0
- package/Build/Workers/chunk-HXKUEOOD.js +352 -0
- package/Build/Workers/chunk-I4REFVXB.js +256 -0
- package/Build/Workers/chunk-IL5F6WEE.js +497 -0
- package/Build/Workers/chunk-IOODZNYE.js +629 -0
- package/Build/Workers/chunk-IVLDVV5R.js +788 -0
- package/Build/Workers/chunk-IWP4XCPO.js +778 -0
- package/Build/Workers/chunk-JBTUZNI2.js +398 -0
- package/Build/Workers/chunk-JMSXZ6AI.js +414 -0
- package/Build/Workers/chunk-JTGVXCP2.js +2058 -0
- package/Build/Workers/chunk-JUK2ZSWT.js +198 -0
- package/Build/Workers/chunk-K6HQ5W6R.js +171 -0
- package/Build/Workers/chunk-KC3G7WHZ.js +57 -0
- package/Build/Workers/chunk-KGPKBCGY.js +97 -0
- package/Build/Workers/chunk-KKGD7HAW.js +414 -0
- package/Build/Workers/chunk-KQSN3QZM.js +368 -0
- package/Build/Workers/chunk-KROSQJUA.js +44 -0
- package/Build/Workers/chunk-L4JLDVCM.js +57 -0
- package/Build/Workers/chunk-LAOFDSKL.js +642 -0
- package/Build/Workers/chunk-LIYMRHGR.js +387 -0
- package/Build/Workers/chunk-LKCCQ3AW.js +198 -0
- package/Build/Workers/chunk-LLQFSX7U.js +139 -0
- package/Build/Workers/chunk-LSDXP6EX.js +75 -0
- package/Build/Workers/chunk-LTYK7VYQ.js +138 -0
- package/Build/Workers/chunk-LYMP3LWI.js +387 -0
- package/Build/Workers/chunk-M2WCZSU6.js +241 -0
- package/Build/Workers/chunk-M35VLUHY.js +352 -0
- package/Build/Workers/chunk-MAPGTIYK.js +2058 -0
- package/Build/Workers/chunk-MG6SYM3V.js +455 -0
- package/Build/Workers/chunk-MKMZHRB3.js +788 -0
- package/Build/Workers/chunk-MNR7L6SQ.js +1483 -0
- package/Build/Workers/chunk-MO25ZQ2I.js +958 -0
- package/Build/Workers/chunk-MOCL5YUJ.js +8366 -0
- package/Build/Workers/chunk-MRYY6ETH.js +280 -0
- package/Build/Workers/chunk-NAIA5L2S.js +682 -0
- package/Build/Workers/chunk-NMDV3OGH.js +958 -0
- package/Build/Workers/chunk-NYE77VTA.js +1054 -0
- package/Build/Workers/chunk-O6RZEKHZ.js +778 -0
- package/Build/Workers/chunk-OFOJ5HD6.js +1460 -0
- package/Build/Workers/chunk-OJNNQSZI.js +788 -0
- package/Build/Workers/chunk-OJXQBSG4.js +692 -0
- package/Build/Workers/chunk-OOCGX2OD.js +102 -0
- package/Build/Workers/chunk-OOY3DP7Z.js +788 -0
- package/Build/Workers/chunk-OSDDHXLU.js +1483 -0
- package/Build/Workers/chunk-OVZNLF46.js +241 -0
- package/Build/Workers/chunk-OXFU5HNU.js +162 -0
- package/Build/Workers/chunk-P5CGIJUY.js +73 -0
- package/Build/Workers/chunk-POLLOX2O.js +352 -0
- package/Build/Workers/chunk-POUR54ZW.js +37 -0
- package/Build/Workers/chunk-PR6F33M6.js +682 -0
- package/Build/Workers/chunk-Q6GCDF2J.js +44 -0
- package/Build/Workers/chunk-Q7HIBRGE.js +97 -0
- package/Build/Workers/chunk-QCJPQ5CQ.js +57 -0
- package/Build/Workers/chunk-QDKQNKG3.js +256 -0
- package/Build/Workers/chunk-QDTDTLQY.js +1067 -0
- package/Build/Workers/chunk-QEANVUGT.js +163 -0
- package/Build/Workers/chunk-QFBCIX7J.js +455 -0
- package/Build/Workers/chunk-QIKGPNLN.js +299 -0
- package/Build/Workers/chunk-QTKDUHWH.js +497 -0
- package/Build/Workers/chunk-QUAH3XOT.js +138 -0
- package/Build/Workers/chunk-R4MI537H.js +1443 -0
- package/Build/Workers/chunk-R5GL5C3T.js +1483 -0
- package/Build/Workers/chunk-RBAGNNPN.js +219 -0
- package/Build/Workers/chunk-RH6GMTSG.js +497 -0
- package/Build/Workers/chunk-RHJJWKSH.js +73 -0
- package/Build/Workers/chunk-RHV6AHJW.js +305 -0
- package/Build/Workers/chunk-RUZPDKUX.js +114 -0
- package/Build/Workers/chunk-RXZDTDIY.js +439 -0
- package/Build/Workers/chunk-SCSEVBY4.js +102 -0
- package/Build/Workers/chunk-SKMYTWWS.js +299 -0
- package/Build/Workers/chunk-SKVAQOZZ.js +1443 -0
- package/Build/Workers/chunk-SPA2KPH3.js +368 -0
- package/Build/Workers/chunk-STDNU6SV.js +1460 -0
- package/Build/Workers/chunk-SXOBEELD.js +55 -0
- package/Build/Workers/chunk-SYDXDJY5.js +2058 -0
- package/Build/Workers/chunk-SZ4ALZDU.js +305 -0
- package/Build/Workers/chunk-T2AGEECA.js +387 -0
- package/Build/Workers/chunk-T5ZG4SFF.js +1067 -0
- package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
- package/Build/Workers/chunk-TJF36YYN.js +837 -0
- package/Build/Workers/chunk-TNZHNGKK.js +439 -0
- package/Build/Workers/chunk-TTWIV2BN.js +102 -0
- package/Build/Workers/chunk-TX3TQPIA.js +44 -0
- package/Build/Workers/chunk-TYPTCQPI.js +1317 -0
- package/Build/Workers/chunk-TZA4ZWFC.js +75 -0
- package/Build/Workers/chunk-UFDTAQBE.js +476 -0
- package/Build/Workers/chunk-UG2DPFOL.js +352 -0
- package/Build/Workers/chunk-UG3AH5C3.js +629 -0
- package/Build/Workers/chunk-UPPGWBJU.js +511 -0
- package/Build/Workers/chunk-URGEDZBS.js +476 -0
- package/Build/Workers/chunk-V35NQOJC.js +642 -0
- package/Build/Workers/chunk-VDNDTTCD.js +958 -0
- package/Build/Workers/chunk-VQIKTYAO.js +368 -0
- package/Build/Workers/chunk-VRXHACYU.js +476 -0
- package/Build/Workers/chunk-VTYZVS6I.js +455 -0
- package/Build/Workers/chunk-VVNCCJGH.js +398 -0
- package/Build/Workers/chunk-W4V3BNFU.js +114 -0
- package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
- package/Build/Workers/chunk-W7UYJE5O.js +2719 -0
- package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
- package/Build/Workers/chunk-WGZVYW2C.js +124 -0
- package/Build/Workers/chunk-WNFIOIKE.js +414 -0
- package/Build/Workers/chunk-WNHOCO2K.js +280 -0
- package/Build/Workers/chunk-WQG2W2WD.js +837 -0
- package/Build/Workers/chunk-WTLYD4FE.js +1483 -0
- package/Build/Workers/chunk-WV2G6UNC.js +940 -0
- package/Build/Workers/chunk-WVC3OW5V.js +629 -0
- package/Build/Workers/chunk-WWQFFOV6.js +299 -0
- package/Build/Workers/chunk-XD7QHRAY.js +288 -0
- package/Build/Workers/chunk-XH6GW5M4.js +58 -0
- package/Build/Workers/chunk-XIX2VR7Z.js +778 -0
- package/Build/Workers/chunk-XJYSONL4.js +1054 -0
- package/Build/Workers/chunk-XP6ASNFM.js +1317 -0
- package/Build/Workers/chunk-XRDMBCX3.js +439 -0
- package/Build/Workers/chunk-XUA6BCV5.js +642 -0
- package/Build/Workers/chunk-XVBMYEYQ.js +124 -0
- package/Build/Workers/chunk-XWOAVRWZ.js +124 -0
- package/Build/Workers/chunk-Y4ALZ4SS.js +198 -0
- package/Build/Workers/chunk-Y4GOZA56.js +163 -0
- package/Build/Workers/chunk-YF2NVO5B.js +837 -0
- package/Build/Workers/chunk-YGVXG7IR.js +114 -0
- package/Build/Workers/chunk-YI7RTZGC.js +280 -0
- package/Build/Workers/chunk-YM4UTBTX.js +1800 -0
- package/Build/Workers/chunk-YP5ZF2MJ.js +162 -0
- package/Build/Workers/chunk-YSSL4KKM.js +387 -0
- package/Build/Workers/chunk-YSYSXSHF.js +629 -0
- package/Build/Workers/chunk-YX562XOB.js +692 -0
- package/Build/Workers/chunk-YZWA5B4R.js +511 -0
- package/Build/Workers/chunk-Z6DFT4D3.js +288 -0
- package/Build/Workers/chunk-Z6PVZUIE.js +398 -0
- package/Build/Workers/chunk-ZAI6LCSI.js +511 -0
- package/Build/Workers/chunk-ZBIINVUF.js +778 -0
- package/Build/Workers/chunk-ZG3TBDRX.js +1317 -0
- package/Build/Workers/chunk-ZGXHZJ75.js +439 -0
- package/Build/Workers/chunk-ZWDOE2JF.js +162 -0
- package/Build/Workers/combineGeometry.js +66 -0
- package/Build/Workers/createBoxGeometry.js +58 -0
- package/Build/Workers/createBoxOutlineGeometry.js +231 -0
- package/Build/Workers/createCircleGeometry.js +201 -0
- package/Build/Workers/createCircleOutlineGeometry.js +147 -0
- package/Build/Workers/createCoplanarPolygonGeometry.js +505 -0
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +225 -0
- package/Build/Workers/createCorridorGeometry.js +1258 -0
- package/Build/Workers/createCorridorOutlineGeometry.js +563 -0
- package/Build/Workers/createCylinderGeometry.js +60 -0
- package/Build/Workers/createCylinderOutlineGeometry.js +231 -0
- package/Build/Workers/createEllipseGeometry.js +72 -0
- package/Build/Workers/createEllipseOutlineGeometry.js +65 -0
- package/Build/Workers/createEllipsoidGeometry.js +59 -0
- package/Build/Workers/createEllipsoidOutlineGeometry.js +61 -0
- package/Build/Workers/createFrustumGeometry.js +58 -0
- package/Build/Workers/createFrustumOutlineGeometry.js +234 -0
- package/Build/Workers/createGeometry.js +173 -0
- package/Build/Workers/createGroundPolylineGeometry.js +1602 -0
- package/Build/Workers/createPlaneGeometry.js +223 -0
- package/Build/Workers/createPlaneOutlineGeometry.js +124 -0
- package/Build/Workers/createPolygonGeometry.js +1404 -0
- package/Build/Workers/createPolygonOutlineGeometry.js +532 -0
- package/Build/Workers/createPolylineGeometry.js +491 -0
- package/Build/Workers/createPolylineVolumeGeometry.js +374 -0
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +272 -0
- package/Build/Workers/createRectangleGeometry.js +1264 -0
- package/Build/Workers/createRectangleOutlineGeometry.js +476 -0
- package/Build/Workers/createSimplePolylineGeometry.js +397 -0
- package/Build/Workers/createSphereGeometry.js +116 -0
- package/Build/Workers/createSphereOutlineGeometry.js +116 -0
- package/Build/Workers/createTaskProcessorWorker.js +32 -0
- package/Build/Workers/createVectorTileClampedPolylines.js +492 -0
- package/Build/Workers/createVectorTileGeometries.js +387 -0
- package/Build/Workers/createVectorTilePoints.js +114 -0
- package/Build/Workers/createVectorTilePolygons.js +386 -0
- package/Build/Workers/createVectorTilePolylines.js +262 -0
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +565 -0
- package/Build/Workers/createVerticesFromHeightmap.js +2254 -0
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +499 -0
- package/Build/Workers/createWallGeometry.js +487 -0
- package/Build/Workers/createWallOutlineGeometry.js +335 -0
- package/Build/Workers/decodeDraco.js +369 -0
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +2666 -0
- package/Build/Workers/decodeI3S.js +1339 -0
- package/Build/Workers/gaussianSplatSorter.js +62 -0
- package/Build/Workers/gaussianSplatTextureGenerator.js +68 -0
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +3463 -0
- package/Build/Workers/transferTypedArrayTest.js +41 -0
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +820 -0
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/LICENSE.md +928 -0
- package/README.md +3 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/Source/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/Source/Assets/Images/bing_maps_credit.png +0 -0
- package/Source/Assets/Images/cesium_credit.png +0 -0
- package/Source/Assets/Images/google_earth_credit.png +0 -0
- package/Source/Assets/Images/ion-credit.png +0 -0
- package/Source/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/Source/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/Source/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/Source/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/Source/Assets/Textures/maki/airfield.png +0 -0
- package/Source/Assets/Textures/maki/airport.png +0 -0
- package/Source/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/Source/Assets/Textures/maki/america-football.png +0 -0
- package/Source/Assets/Textures/maki/art-gallery.png +0 -0
- package/Source/Assets/Textures/maki/bakery.png +0 -0
- package/Source/Assets/Textures/maki/bank.png +0 -0
- package/Source/Assets/Textures/maki/bar.png +0 -0
- package/Source/Assets/Textures/maki/baseball.png +0 -0
- package/Source/Assets/Textures/maki/basketball.png +0 -0
- package/Source/Assets/Textures/maki/beer.png +0 -0
- package/Source/Assets/Textures/maki/bicycle.png +0 -0
- package/Source/Assets/Textures/maki/building.png +0 -0
- package/Source/Assets/Textures/maki/bus.png +0 -0
- package/Source/Assets/Textures/maki/cafe.png +0 -0
- package/Source/Assets/Textures/maki/camera.png +0 -0
- package/Source/Assets/Textures/maki/campsite.png +0 -0
- package/Source/Assets/Textures/maki/car.png +0 -0
- package/Source/Assets/Textures/maki/cemetery.png +0 -0
- package/Source/Assets/Textures/maki/cesium.png +0 -0
- package/Source/Assets/Textures/maki/chemist.png +0 -0
- package/Source/Assets/Textures/maki/cinema.png +0 -0
- package/Source/Assets/Textures/maki/circle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/circle.png +0 -0
- package/Source/Assets/Textures/maki/city.png +0 -0
- package/Source/Assets/Textures/maki/clothing-store.png +0 -0
- package/Source/Assets/Textures/maki/college.png +0 -0
- package/Source/Assets/Textures/maki/commercial.png +0 -0
- package/Source/Assets/Textures/maki/cricket.png +0 -0
- package/Source/Assets/Textures/maki/cross.png +0 -0
- package/Source/Assets/Textures/maki/dam.png +0 -0
- package/Source/Assets/Textures/maki/danger.png +0 -0
- package/Source/Assets/Textures/maki/disability.png +0 -0
- package/Source/Assets/Textures/maki/dog-park.png +0 -0
- package/Source/Assets/Textures/maki/embassy.png +0 -0
- package/Source/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/Source/Assets/Textures/maki/entrance.png +0 -0
- package/Source/Assets/Textures/maki/farm.png +0 -0
- package/Source/Assets/Textures/maki/fast-food.png +0 -0
- package/Source/Assets/Textures/maki/ferry.png +0 -0
- package/Source/Assets/Textures/maki/fire-station.png +0 -0
- package/Source/Assets/Textures/maki/fuel.png +0 -0
- package/Source/Assets/Textures/maki/garden.png +0 -0
- package/Source/Assets/Textures/maki/gift.png +0 -0
- package/Source/Assets/Textures/maki/golf.png +0 -0
- package/Source/Assets/Textures/maki/grocery.png +0 -0
- package/Source/Assets/Textures/maki/hairdresser.png +0 -0
- package/Source/Assets/Textures/maki/harbor.png +0 -0
- package/Source/Assets/Textures/maki/heart.png +0 -0
- package/Source/Assets/Textures/maki/heliport.png +0 -0
- package/Source/Assets/Textures/maki/hospital.png +0 -0
- package/Source/Assets/Textures/maki/ice-cream.png +0 -0
- package/Source/Assets/Textures/maki/industrial.png +0 -0
- package/Source/Assets/Textures/maki/land-use.png +0 -0
- package/Source/Assets/Textures/maki/laundry.png +0 -0
- package/Source/Assets/Textures/maki/library.png +0 -0
- package/Source/Assets/Textures/maki/lighthouse.png +0 -0
- package/Source/Assets/Textures/maki/lodging.png +0 -0
- package/Source/Assets/Textures/maki/logging.png +0 -0
- package/Source/Assets/Textures/maki/london-underground.png +0 -0
- package/Source/Assets/Textures/maki/marker-stroked.png +0 -0
- package/Source/Assets/Textures/maki/marker.png +0 -0
- package/Source/Assets/Textures/maki/minefield.png +0 -0
- package/Source/Assets/Textures/maki/mobilephone.png +0 -0
- package/Source/Assets/Textures/maki/monument.png +0 -0
- package/Source/Assets/Textures/maki/museum.png +0 -0
- package/Source/Assets/Textures/maki/music.png +0 -0
- package/Source/Assets/Textures/maki/oil-well.png +0 -0
- package/Source/Assets/Textures/maki/park.png +0 -0
- package/Source/Assets/Textures/maki/park2.png +0 -0
- package/Source/Assets/Textures/maki/parking-garage.png +0 -0
- package/Source/Assets/Textures/maki/parking.png +0 -0
- package/Source/Assets/Textures/maki/pharmacy.png +0 -0
- package/Source/Assets/Textures/maki/pitch.png +0 -0
- package/Source/Assets/Textures/maki/place-of-worship.png +0 -0
- package/Source/Assets/Textures/maki/playground.png +0 -0
- package/Source/Assets/Textures/maki/police.png +0 -0
- package/Source/Assets/Textures/maki/polling-place.png +0 -0
- package/Source/Assets/Textures/maki/post.png +0 -0
- package/Source/Assets/Textures/maki/prison.png +0 -0
- package/Source/Assets/Textures/maki/rail-above.png +0 -0
- package/Source/Assets/Textures/maki/rail-light.png +0 -0
- package/Source/Assets/Textures/maki/rail-metro.png +0 -0
- package/Source/Assets/Textures/maki/rail-underground.png +0 -0
- package/Source/Assets/Textures/maki/rail.png +0 -0
- package/Source/Assets/Textures/maki/religious-christian.png +0 -0
- package/Source/Assets/Textures/maki/religious-jewish.png +0 -0
- package/Source/Assets/Textures/maki/religious-muslim.png +0 -0
- package/Source/Assets/Textures/maki/restaurant.png +0 -0
- package/Source/Assets/Textures/maki/roadblock.png +0 -0
- package/Source/Assets/Textures/maki/rocket.png +0 -0
- package/Source/Assets/Textures/maki/school.png +0 -0
- package/Source/Assets/Textures/maki/scooter.png +0 -0
- package/Source/Assets/Textures/maki/shop.png +0 -0
- package/Source/Assets/Textures/maki/skiing.png +0 -0
- package/Source/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/Source/Assets/Textures/maki/soccer.png +0 -0
- package/Source/Assets/Textures/maki/square-stroked.png +0 -0
- package/Source/Assets/Textures/maki/square.png +0 -0
- package/Source/Assets/Textures/maki/star-stroked.png +0 -0
- package/Source/Assets/Textures/maki/star.png +0 -0
- package/Source/Assets/Textures/maki/suitcase.png +0 -0
- package/Source/Assets/Textures/maki/swimming.png +0 -0
- package/Source/Assets/Textures/maki/telephone.png +0 -0
- package/Source/Assets/Textures/maki/tennis.png +0 -0
- package/Source/Assets/Textures/maki/theatre.png +0 -0
- package/Source/Assets/Textures/maki/toilets.png +0 -0
- package/Source/Assets/Textures/maki/town-hall.png +0 -0
- package/Source/Assets/Textures/maki/town.png +0 -0
- package/Source/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/Source/Assets/Textures/maki/triangle.png +0 -0
- package/Source/Assets/Textures/maki/village.png +0 -0
- package/Source/Assets/Textures/maki/warehouse.png +0 -0
- package/Source/Assets/Textures/maki/waste-basket.png +0 -0
- package/Source/Assets/Textures/maki/water.png +0 -0
- package/Source/Assets/Textures/maki/wetland.png +0 -0
- package/Source/Assets/Textures/maki/zoo.png +0 -0
- package/Source/Assets/Textures/moonSmall.jpg +0 -0
- package/Source/Assets/Textures/pin.svg +1 -0
- package/Source/Assets/Textures/waterNormals.jpg +0 -0
- package/Source/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/Source/Assets/approximateTerrainHeights.json +1 -0
- package/Source/Core/ApproximateTerrainHeights.js +255 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +755 -0
- package/Source/Core/ArcType.js +31 -0
- package/Source/Core/ArticulationStageType.js +23 -0
- package/Source/Core/AssociativeArray.js +127 -0
- package/Source/Core/AttributeCompression.js +527 -0
- package/Source/Core/AxisAlignedBoundingBox.js +294 -0
- package/Source/Core/BingMapsGeocoderService.js +127 -0
- package/Source/Core/BoundingRectangle.js +374 -0
- package/Source/Core/BoundingSphere.js +1506 -0
- package/Source/Core/BoxGeometry.js +893 -0
- package/Source/Core/BoxOutlineGeometry.js +312 -0
- package/Source/Core/Cartesian2.js +823 -0
- package/Source/Core/Cartesian3.js +1220 -0
- package/Source/Core/Cartesian4.js +979 -0
- package/Source/Core/Cartographic.js +304 -0
- package/Source/Core/CartographicGeocoderService.js +73 -0
- package/Source/Core/CatmullRomSpline.js +324 -0
- package/Source/Core/Cesium3DTilesTerrainData.js +932 -0
- package/Source/Core/Cesium3DTilesTerrainGeometryProcessor.js +1868 -0
- package/Source/Core/Cesium3DTilesTerrainProvider.js +1052 -0
- package/Source/Core/CesiumTerrainProvider.js +1408 -0
- package/Source/Core/Check.d.ts +131 -0
- package/Source/Core/Check.js +212 -0
- package/Source/Core/CircleGeometry.js +207 -0
- package/Source/Core/CircleOutlineGeometry.js +149 -0
- package/Source/Core/Clock.js +316 -0
- package/Source/Core/ClockRange.js +39 -0
- package/Source/Core/ClockStep.js +38 -0
- package/Source/Core/Color.js +2283 -0
- package/Source/Core/ColorGeometryInstanceAttribute.js +181 -0
- package/Source/Core/ComponentDatatype.js +338 -0
- package/Source/Core/CompressedTextureBuffer.js +125 -0
- package/Source/Core/ConstantSpline.js +119 -0
- package/Source/Core/CoplanarPolygonGeometry.js +600 -0
- package/Source/Core/CoplanarPolygonGeometryLibrary.js +132 -0
- package/Source/Core/CoplanarPolygonOutlineGeometry.js +237 -0
- package/Source/Core/CornerType.js +37 -0
- package/Source/Core/CorridorGeometry.js +1411 -0
- package/Source/Core/CorridorGeometryLibrary.js +501 -0
- package/Source/Core/CorridorOutlineGeometry.js +599 -0
- package/Source/Core/Credit.js +172 -0
- package/Source/Core/CubicRealPolynomial.js +238 -0
- package/Source/Core/CullingVolume.js +216 -0
- package/Source/Core/CustomHeightmapTerrainProvider.js +287 -0
- package/Source/Core/CylinderGeometry.js +479 -0
- package/Source/Core/CylinderGeometryLibrary.js +59 -0
- package/Source/Core/CylinderOutlineGeometry.js +269 -0
- package/Source/Core/DefaultProxy.js +26 -0
- package/Source/Core/DeveloperError.js +75 -0
- package/Source/Core/DistanceDisplayCondition.js +171 -0
- package/Source/Core/DistanceDisplayConditionGeometryInstanceAttribute.js +179 -0
- package/Source/Core/DoubleEndedPriorityQueue.js +405 -0
- package/Source/Core/DoublyLinkedList.js +112 -0
- package/Source/Core/EarthOrientationParameters.js +431 -0
- package/Source/Core/EarthOrientationParametersSample.js +52 -0
- package/Source/Core/EasingFunction.js +257 -0
- package/Source/Core/EllipseGeometry.js +1318 -0
- package/Source/Core/EllipseGeometryLibrary.js +365 -0
- package/Source/Core/EllipseOutlineGeometry.js +451 -0
- package/Source/Core/Ellipsoid.js +889 -0
- package/Source/Core/EllipsoidGeodesic.js +523 -0
- package/Source/Core/EllipsoidGeometry.js +650 -0
- package/Source/Core/EllipsoidOutlineGeometry.js +464 -0
- package/Source/Core/EllipsoidRhumbLine.js +751 -0
- package/Source/Core/EllipsoidTangentPlane.js +382 -0
- package/Source/Core/EllipsoidTerrainProvider.js +201 -0
- package/Source/Core/EllipsoidalOccluder.js +538 -0
- package/Source/Core/EncodedCartesian3.js +170 -0
- package/Source/Core/Event.js +205 -0
- package/Source/Core/EventHelper.js +74 -0
- package/Source/Core/ExtrapolationType.js +34 -0
- package/Source/Core/FeatureDetection.js +435 -0
- package/Source/Core/Frozen.js +24 -0
- package/Source/Core/FrustumGeometry.js +583 -0
- package/Source/Core/FrustumOutlineGeometry.js +253 -0
- package/Source/Core/Fullscreen.js +249 -0
- package/Source/Core/GeocodeType.js +24 -0
- package/Source/Core/GeocoderService.js +60 -0
- package/Source/Core/GeographicProjection.js +105 -0
- package/Source/Core/GeographicTilingScheme.js +245 -0
- package/Source/Core/Geometry.js +371 -0
- package/Source/Core/GeometryAttribute.js +133 -0
- package/Source/Core/GeometryAttributes.js +88 -0
- package/Source/Core/GeometryFactory.js +25 -0
- package/Source/Core/GeometryInstance.js +118 -0
- package/Source/Core/GeometryInstanceAttribute.js +133 -0
- package/Source/Core/GeometryOffsetAttribute.js +10 -0
- package/Source/Core/GeometryPipeline.js +3291 -0
- package/Source/Core/GeometryType.js +10 -0
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +584 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +606 -0
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +574 -0
- package/Source/Core/GoogleEarthEnterpriseTileInformation.js +136 -0
- package/Source/Core/GoogleGeocoderService.js +110 -0
- package/Source/Core/GoogleMaps.js +40 -0
- package/Source/Core/GregorianDate.js +153 -0
- package/Source/Core/GroundPolylineGeometry.js +1659 -0
- package/Source/Core/HeadingPitchRange.js +59 -0
- package/Source/Core/HeadingPitchRoll.js +235 -0
- package/Source/Core/Heap.js +233 -0
- package/Source/Core/HeightmapEncoding.js +25 -0
- package/Source/Core/HeightmapTerrainData.js +903 -0
- package/Source/Core/HeightmapTessellator.js +518 -0
- package/Source/Core/HermitePolynomialApproximation.js +341 -0
- package/Source/Core/HermiteSpline.js +620 -0
- package/Source/Core/HilbertOrder.js +112 -0
- package/Source/Core/ITwinPlatform.js +388 -0
- package/Source/Core/Iau2000Orientation.js +167 -0
- package/Source/Core/Iau2006XysData.js +275 -0
- package/Source/Core/Iau2006XysSample.js +32 -0
- package/Source/Core/IauOrientationAxes.js +105 -0
- package/Source/Core/IauOrientationParameters.js +54 -0
- package/Source/Core/IndexDatatype.js +199 -0
- package/Source/Core/InterpolationAlgorithm.js +65 -0
- package/Source/Core/InterpolationType.js +14 -0
- package/Source/Core/Intersect.js +34 -0
- package/Source/Core/IntersectionTests.js +1087 -0
- package/Source/Core/Intersections2D.js +358 -0
- package/Source/Core/Interval.js +23 -0
- package/Source/Core/Ion.js +56 -0
- package/Source/Core/IonGeocodeProviderType.js +33 -0
- package/Source/Core/IonGeocoderService.js +147 -0
- package/Source/Core/IonResource.js +321 -0
- package/Source/Core/Iso8601.js +54 -0
- package/Source/Core/JulianDate.js +1229 -0
- package/Source/Core/KTX2Transcoder.js +92 -0
- package/Source/Core/KeyboardEventModifier.js +32 -0
- package/Source/Core/LagrangePolynomialApproximation.js +71 -0
- package/Source/Core/LeapSecond.js +24 -0
- package/Source/Core/LinearApproximation.js +83 -0
- package/Source/Core/LinearSpline.js +166 -0
- package/Source/Core/ManagedArray.js +162 -0
- package/Source/Core/MapProjection.js +62 -0
- package/Source/Core/Math.js +1125 -0
- package/Source/Core/Matrix2.js +1092 -0
- package/Source/Core/Matrix3.js +1838 -0
- package/Source/Core/Matrix4.js +3233 -0
- package/Source/Core/MorphWeightSpline.js +161 -0
- package/Source/Core/MortonOrder.js +214 -0
- package/Source/Core/NearFarScalar.js +173 -0
- package/Source/Core/Occluder.js +727 -0
- package/Source/Core/OffsetGeometryInstanceAttribute.js +125 -0
- package/Source/Core/OpenCageGeocoderService.js +134 -0
- package/Source/Core/OrientedBoundingBox.js +1272 -0
- package/Source/Core/OrthographicFrustum.js +351 -0
- package/Source/Core/OrthographicOffCenterFrustum.js +463 -0
- package/Source/Core/Packable.js +40 -0
- package/Source/Core/PackableForInterpolation.js +43 -0
- package/Source/Core/PeliasGeocoderService.js +106 -0
- package/Source/Core/PerspectiveFrustum.js +459 -0
- package/Source/Core/PerspectiveOffCenterFrustum.js +522 -0
- package/Source/Core/PinBuilder.js +234 -0
- package/Source/Core/PixelFormat.js +603 -0
- package/Source/Core/Plane.js +312 -0
- package/Source/Core/PlaneGeometry.js +250 -0
- package/Source/Core/PlaneOutlineGeometry.js +113 -0
- package/Source/Core/PolygonGeometry.js +1580 -0
- package/Source/Core/PolygonGeometryLibrary.js +1301 -0
- package/Source/Core/PolygonHierarchy.js +25 -0
- package/Source/Core/PolygonOutlineGeometry.js +687 -0
- package/Source/Core/PolygonPipeline.js +632 -0
- package/Source/Core/PolylineGeometry.js +573 -0
- package/Source/Core/PolylinePipeline.js +573 -0
- package/Source/Core/PolylineVolumeGeometry.js +412 -0
- package/Source/Core/PolylineVolumeGeometryLibrary.js +701 -0
- package/Source/Core/PolylineVolumeOutlineGeometry.js +294 -0
- package/Source/Core/PrimitiveType.js +107 -0
- package/Source/Core/Proxy.js +24 -0
- package/Source/Core/QuadraticRealPolynomial.js +147 -0
- package/Source/Core/QuantizedMeshTerrainData.js +735 -0
- package/Source/Core/QuarticRealPolynomial.js +342 -0
- package/Source/Core/Quaternion.js +1145 -0
- package/Source/Core/QuaternionSpline.js +155 -0
- package/Source/Core/Queue.js +126 -0
- package/Source/Core/Ray.js +79 -0
- package/Source/Core/Rectangle.js +1071 -0
- package/Source/Core/RectangleCollisionChecker.js +95 -0
- package/Source/Core/RectangleGeometry.js +1480 -0
- package/Source/Core/RectangleGeometryLibrary.js +286 -0
- package/Source/Core/RectangleOutlineGeometry.js +532 -0
- package/Source/Core/ReferenceFrame.js +23 -0
- package/Source/Core/Request.js +193 -0
- package/Source/Core/RequestErrorEvent.js +58 -0
- package/Source/Core/RequestScheduler.js +519 -0
- package/Source/Core/RequestState.js +55 -0
- package/Source/Core/RequestType.js +39 -0
- package/Source/Core/Resource.js +2280 -0
- package/Source/Core/RuntimeError.js +65 -0
- package/Source/Core/S2Cell.js +734 -0
- package/Source/Core/ScreenSpaceEventHandler.js +1140 -0
- package/Source/Core/ScreenSpaceEventType.js +127 -0
- package/Source/Core/ShowGeometryInstanceAttribute.js +122 -0
- package/Source/Core/Simon1994PlanetaryPositions.js +684 -0
- package/Source/Core/SimplePolylineGeometry.js +454 -0
- package/Source/Core/SphereGeometry.js +117 -0
- package/Source/Core/SphereOutlineGeometry.js +119 -0
- package/Source/Core/Spherical.js +183 -0
- package/Source/Core/Spline.js +188 -0
- package/Source/Core/SteppedSpline.js +160 -0
- package/Source/Core/Stereographic.js +247 -0
- package/Source/Core/TaskProcessor.js +403 -0
- package/Source/Core/TerrainData.js +126 -0
- package/Source/Core/TerrainEncoding.js +772 -0
- package/Source/Core/TerrainMesh.js +361 -0
- package/Source/Core/TerrainPicker.js +607 -0
- package/Source/Core/TerrainProvider.js +585 -0
- package/Source/Core/TerrainQuantization.js +25 -0
- package/Source/Core/TexturePacker.js +181 -0
- package/Source/Core/TileAvailability.js +564 -0
- package/Source/Core/TileEdge.js +14 -0
- package/Source/Core/TileProviderError.js +170 -0
- package/Source/Core/TilingScheme.js +132 -0
- package/Source/Core/TimeConstants.js +83 -0
- package/Source/Core/TimeInterval.js +438 -0
- package/Source/Core/TimeIntervalCollection.js +1137 -0
- package/Source/Core/TimeStandard.js +30 -0
- package/Source/Core/Tipsify.js +314 -0
- package/Source/Core/TrackingReferenceFrame.js +45 -0
- package/Source/Core/Transforms.js +1277 -0
- package/Source/Core/TranslationRotationScale.js +57 -0
- package/Source/Core/TridiagonalSystemSolver.js +113 -0
- package/Source/Core/TrustedServers.js +146 -0
- package/Source/Core/VRTheWorldTerrainProvider.js +462 -0
- package/Source/Core/VertexFormat.js +311 -0
- package/Source/Core/VerticalExaggeration.js +70 -0
- package/Source/Core/VideoSynchronizer.js +222 -0
- package/Source/Core/Visibility.js +34 -0
- package/Source/Core/VulkanConstants.js +286 -0
- package/Source/Core/WallGeometry.js +623 -0
- package/Source/Core/WallGeometryLibrary.js +212 -0
- package/Source/Core/WallOutlineGeometry.js +431 -0
- package/Source/Core/WebGLConstants.js +614 -0
- package/Source/Core/WebMercatorProjection.js +152 -0
- package/Source/Core/WebMercatorTilingScheme.js +291 -0
- package/Source/Core/WindingOrder.js +36 -0
- package/Source/Core/WireframeIndexGenerator.js +238 -0
- package/Source/Core/addAllToArray.js +40 -0
- package/Source/Core/appendForwardSlash.js +10 -0
- package/Source/Core/arrayRemoveDuplicates.js +129 -0
- package/Source/Core/barycentricCoordinates.js +109 -0
- package/Source/Core/binarySearch.js +67 -0
- package/Source/Core/buildModuleUrl.js +153 -0
- package/Source/Core/clone.js +30 -0
- package/Source/Core/combine.js +79 -0
- package/Source/Core/createGuid.js +22 -0
- package/Source/Core/createWorldBathymetryAsync.js +45 -0
- package/Source/Core/createWorldTerrainAsync.js +50 -0
- package/Source/Core/decodeGoogleEarthEnterpriseData.js +93 -0
- package/Source/Core/decodeVectorPolylinePositions.js +51 -0
- package/Source/Core/defaultValue.js +29 -0
- package/Source/Core/defer.js +44 -0
- package/Source/Core/defined.d.ts +11 -0
- package/Source/Core/defined.js +17 -0
- package/Source/Core/deprecationWarning.js +53 -0
- package/Source/Core/destroyObject.js +53 -0
- package/Source/Core/formatError.js +30 -0
- package/Source/Core/getAbsoluteUri.js +46 -0
- package/Source/Core/getBaseUri.js +47 -0
- package/Source/Core/getExtensionFromUri.js +38 -0
- package/Source/Core/getFilenameFromUri.js +32 -0
- package/Source/Core/getImageFromTypedArray.js +24 -0
- package/Source/Core/getImagePixels.js +44 -0
- package/Source/Core/getJsonFromTypedArray.js +21 -0
- package/Source/Core/getMagic.js +14 -0
- package/Source/Core/getStringFromTypedArray.js +165 -0
- package/Source/Core/getTimestamp.js +26 -0
- package/Source/Core/isBitSet.js +7 -0
- package/Source/Core/isBlobUri.js +22 -0
- package/Source/Core/isCrossOriginUrl.js +30 -0
- package/Source/Core/isDataUri.js +22 -0
- package/Source/Core/isLeapYear.js +23 -0
- package/Source/Core/loadAndExecuteScript.js +27 -0
- package/Source/Core/loadImageFromTypedArray.js +66 -0
- package/Source/Core/loadKTX2.js +104 -0
- package/Source/Core/mergeSort.js +111 -0
- package/Source/Core/objectToQuery.js +57 -0
- package/Source/Core/oneTimeWarning.js +51 -0
- package/Source/Core/parseResponseHeaders.js +37 -0
- package/Source/Core/pointInsideTriangle.js +39 -0
- package/Source/Core/queryToObject.js +60 -0
- package/Source/Core/resizeImageToNextPowerOfTwo.js +31 -0
- package/Source/Core/sampleTerrain.js +291 -0
- package/Source/Core/sampleTerrainMostDetailed.js +132 -0
- package/Source/Core/scaleToGeodeticSurface.js +147 -0
- package/Source/Core/srgbToLinear.js +32 -0
- package/Source/Core/subdivideArray.js +35 -0
- package/Source/Core/webGLConstantToGlslType.js +25 -0
- package/Source/Core/wrapFunction.js +26 -0
- package/Source/Core/writeTextToCanvas.js +219 -0
- package/Source/DataSources/BillboardGraphics.js +419 -0
- package/Source/DataSources/BillboardVisualizer.js +351 -0
- package/Source/DataSources/BoundingSphereState.js +26 -0
- package/Source/DataSources/BoxGeometryUpdater.js +326 -0
- package/Source/DataSources/BoxGraphics.js +208 -0
- package/Source/DataSources/CallbackPositionProperty.js +172 -0
- package/Source/DataSources/CallbackProperty.js +117 -0
- package/Source/DataSources/Cesium3DTilesetGraphics.js +111 -0
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +261 -0
- package/Source/DataSources/CheckerboardMaterialProperty.js +157 -0
- package/Source/DataSources/ColorMaterialProperty.js +112 -0
- package/Source/DataSources/CompositeEntityCollection.js +591 -0
- package/Source/DataSources/CompositeMaterialProperty.js +128 -0
- package/Source/DataSources/CompositePositionProperty.js +153 -0
- package/Source/DataSources/CompositeProperty.js +154 -0
- package/Source/DataSources/ConstantPositionProperty.js +151 -0
- package/Source/DataSources/ConstantProperty.js +116 -0
- package/Source/DataSources/CorridorGeometryUpdater.js +409 -0
- package/Source/DataSources/CorridorGraphics.js +316 -0
- package/Source/DataSources/CustomDataSource.js +173 -0
- package/Source/DataSources/CylinderGeometryUpdater.js +375 -0
- package/Source/DataSources/CylinderGraphics.js +258 -0
- package/Source/DataSources/CzmlDataSource.js +5142 -0
- package/Source/DataSources/DataSource.js +121 -0
- package/Source/DataSources/DataSourceClock.js +164 -0
- package/Source/DataSources/DataSourceCollection.js +335 -0
- package/Source/DataSources/DataSourceDisplay.js +543 -0
- package/Source/DataSources/DynamicGeometryBatch.js +56 -0
- package/Source/DataSources/DynamicGeometryUpdater.js +270 -0
- package/Source/DataSources/EllipseGeometryUpdater.js +434 -0
- package/Source/DataSources/EllipseGraphics.js +343 -0
- package/Source/DataSources/EllipsoidGeometryUpdater.js +710 -0
- package/Source/DataSources/EllipsoidGraphics.js +312 -0
- package/Source/DataSources/Entity.js +789 -0
- package/Source/DataSources/EntityCluster.js +1022 -0
- package/Source/DataSources/EntityCollection.js +439 -0
- package/Source/DataSources/EntityView.js +476 -0
- package/Source/DataSources/GeoJsonDataSource.js +1064 -0
- package/Source/DataSources/GeometryUpdater.js +538 -0
- package/Source/DataSources/GeometryUpdaterSet.js +114 -0
- package/Source/DataSources/GeometryVisualizer.js +549 -0
- package/Source/DataSources/GpxDataSource.js +1018 -0
- package/Source/DataSources/GridMaterialProperty.js +204 -0
- package/Source/DataSources/GroundGeometryUpdater.js +234 -0
- package/Source/DataSources/ImageMaterialProperty.js +173 -0
- package/Source/DataSources/KmlCamera.js +13 -0
- package/Source/DataSources/KmlDataSource.js +4249 -0
- package/Source/DataSources/KmlLookAt.js +12 -0
- package/Source/DataSources/KmlTour.js +165 -0
- package/Source/DataSources/KmlTourFlyTo.js +109 -0
- package/Source/DataSources/KmlTourWait.js +52 -0
- package/Source/DataSources/LabelGraphics.js +401 -0
- package/Source/DataSources/LabelVisualizer.js +359 -0
- package/Source/DataSources/MaterialProperty.js +111 -0
- package/Source/DataSources/ModelGraphics.js +456 -0
- package/Source/DataSources/ModelVisualizer.js +560 -0
- package/Source/DataSources/NodeTransformationProperty.js +150 -0
- package/Source/DataSources/PathGraphics.js +161 -0
- package/Source/DataSources/PathVisualizer.js +823 -0
- package/Source/DataSources/PlaneGeometryUpdater.js +385 -0
- package/Source/DataSources/PlaneGraphics.js +208 -0
- package/Source/DataSources/PointGraphics.js +223 -0
- package/Source/DataSources/PointVisualizer.js +438 -0
- package/Source/DataSources/PolygonGeometryUpdater.js +591 -0
- package/Source/DataSources/PolygonGraphics.js +383 -0
- package/Source/DataSources/PolylineArrowMaterialProperty.js +110 -0
- package/Source/DataSources/PolylineDashMaterialProperty.js +174 -0
- package/Source/DataSources/PolylineGeometryUpdater.js +878 -0
- package/Source/DataSources/PolylineGlowMaterialProperty.js +152 -0
- package/Source/DataSources/PolylineGraphics.js +241 -0
- package/Source/DataSources/PolylineOutlineMaterialProperty.js +158 -0
- package/Source/DataSources/PolylineVisualizer.js +409 -0
- package/Source/DataSources/PolylineVolumeGeometryUpdater.js +306 -0
- package/Source/DataSources/PolylineVolumeGraphics.js +235 -0
- package/Source/DataSources/PositionProperty.js +131 -0
- package/Source/DataSources/PositionPropertyArray.js +192 -0
- package/Source/DataSources/Property.js +137 -0
- package/Source/DataSources/PropertyArray.js +147 -0
- package/Source/DataSources/PropertyBag.js +275 -0
- package/Source/DataSources/RectangleGeometryUpdater.js +427 -0
- package/Source/DataSources/RectangleGraphics.js +317 -0
- package/Source/DataSources/ReferenceProperty.js +371 -0
- package/Source/DataSources/Rotation.js +155 -0
- package/Source/DataSources/SampledPositionProperty.js +330 -0
- package/Source/DataSources/SampledProperty.js +855 -0
- package/Source/DataSources/ScaledPositionProperty.js +103 -0
- package/Source/DataSources/StaticGeometryColorBatch.js +570 -0
- package/Source/DataSources/StaticGeometryPerMaterialBatch.js +488 -0
- package/Source/DataSources/StaticGroundGeometryColorBatch.js +394 -0
- package/Source/DataSources/StaticGroundGeometryPerMaterialBatch.js +456 -0
- package/Source/DataSources/StaticGroundPolylinePerMaterialBatch.js +434 -0
- package/Source/DataSources/StaticOutlineGeometryBatch.js +465 -0
- package/Source/DataSources/StripeMaterialProperty.js +193 -0
- package/Source/DataSources/StripeOrientation.js +19 -0
- package/Source/DataSources/TerrainOffsetProperty.js +243 -0
- package/Source/DataSources/TimeIntervalCollectionPositionProperty.js +155 -0
- package/Source/DataSources/TimeIntervalCollectionProperty.js +136 -0
- package/Source/DataSources/VelocityOrientationProperty.js +158 -0
- package/Source/DataSources/VelocityVectorProperty.js +213 -0
- package/Source/DataSources/Visualizer.js +61 -0
- package/Source/DataSources/WallGeometryUpdater.js +275 -0
- package/Source/DataSources/WallGraphics.js +236 -0
- package/Source/DataSources/createMaterialPropertyDescriptor.js +35 -0
- package/Source/DataSources/createPropertyDescriptor.js +71 -0
- package/Source/DataSources/createRawPropertyDescriptor.js +13 -0
- package/Source/DataSources/exportKml.js +1517 -0
- package/Source/DataSources/getElement.js +26 -0
- package/Source/DataSources/heightReferenceOnEntityPropertyChanged.js +47 -0
- package/Source/Renderer/AutomaticUniforms.js +1857 -0
- package/Source/Renderer/Buffer.js +452 -0
- package/Source/Renderer/BufferUsage.js +21 -0
- package/Source/Renderer/ClearCommand.js +102 -0
- package/Source/Renderer/ComputeCommand.js +119 -0
- package/Source/Renderer/ComputeEngine.js +135 -0
- package/Source/Renderer/Context.js +1752 -0
- package/Source/Renderer/ContextLimits.js +299 -0
- package/Source/Renderer/CubeMap.js +686 -0
- package/Source/Renderer/CubeMapFace.js +415 -0
- package/Source/Renderer/DrawCommand.js +644 -0
- package/Source/Renderer/Framebuffer.js +447 -0
- package/Source/Renderer/FramebufferManager.js +489 -0
- package/Source/Renderer/MipmapHint.js +19 -0
- package/Source/Renderer/MultisampleFramebuffer.js +136 -0
- package/Source/Renderer/Pass.js +29 -0
- package/Source/Renderer/PassState.js +57 -0
- package/Source/Renderer/PixelDatatype.js +121 -0
- package/Source/Renderer/RenderState.js +967 -0
- package/Source/Renderer/Renderbuffer.js +105 -0
- package/Source/Renderer/RenderbufferFormat.js +42 -0
- package/Source/Renderer/Sampler.js +116 -0
- package/Source/Renderer/ShaderBuilder.js +597 -0
- package/Source/Renderer/ShaderCache.js +287 -0
- package/Source/Renderer/ShaderDestination.js +51 -0
- package/Source/Renderer/ShaderFunction.js +66 -0
- package/Source/Renderer/ShaderProgram.js +619 -0
- package/Source/Renderer/ShaderSource.js +524 -0
- package/Source/Renderer/ShaderStruct.js +55 -0
- package/Source/Renderer/SharedContext.js +186 -0
- package/Source/Renderer/Sync.js +104 -0
- package/Source/Renderer/Texture.js +1126 -0
- package/Source/Renderer/Texture3D.js +578 -0
- package/Source/Renderer/TextureAtlas.js +833 -0
- package/Source/Renderer/TextureCache.js +81 -0
- package/Source/Renderer/TextureMagnificationFilter.js +41 -0
- package/Source/Renderer/TextureMinificationFilter.js +94 -0
- package/Source/Renderer/TextureWrap.js +19 -0
- package/Source/Renderer/UniformState.js +1948 -0
- package/Source/Renderer/VertexArray.js +869 -0
- package/Source/Renderer/VertexArrayFacade.js +509 -0
- package/Source/Renderer/createUniform.js +422 -0
- package/Source/Renderer/createUniformArray.js +638 -0
- package/Source/Renderer/demodernizeShader.js +84 -0
- package/Source/Renderer/freezeRenderState.js +30 -0
- package/Source/Renderer/loadCubeMap.js +88 -0
- package/Source/Scene/AlphaMode.js +33 -0
- package/Source/Scene/Appearance.js +204 -0
- package/Source/Scene/ArcGisBaseMapType.js +12 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +875 -0
- package/Source/Scene/ArcGisMapService.js +80 -0
- package/Source/Scene/Atmosphere.js +149 -0
- package/Source/Scene/AttributeType.js +200 -0
- package/Source/Scene/AutoExposure.js +386 -0
- package/Source/Scene/Axis.js +116 -0
- package/Source/Scene/Azure2DImageryProvider.js +393 -0
- package/Source/Scene/B3dmParser.js +173 -0
- package/Source/Scene/BatchTable.js +636 -0
- package/Source/Scene/BatchTableHierarchy.js +504 -0
- package/Source/Scene/BatchTexture.js +574 -0
- package/Source/Scene/Billboard.js +1601 -0
- package/Source/Scene/BillboardCollection.js +2396 -0
- package/Source/Scene/BillboardLoadState.js +44 -0
- package/Source/Scene/BillboardTexture.js +397 -0
- package/Source/Scene/BingMapsImageryProvider.js +769 -0
- package/Source/Scene/BingMapsStyle.js +93 -0
- package/Source/Scene/BlendEquation.js +53 -0
- package/Source/Scene/BlendFunction.js +129 -0
- package/Source/Scene/BlendOption.js +28 -0
- package/Source/Scene/BlendingState.js +73 -0
- package/Source/Scene/BoundingVolumeSemantics.js +169 -0
- package/Source/Scene/BoxEmitter.js +74 -0
- package/Source/Scene/BrdfLutGenerator.js +75 -0
- package/Source/Scene/BufferLoader.js +141 -0
- package/Source/Scene/Camera.js +3978 -0
- package/Source/Scene/CameraEventAggregator.js +619 -0
- package/Source/Scene/CameraEventType.js +47 -0
- package/Source/Scene/CameraFlightPath.js +576 -0
- package/Source/Scene/Cesium3DContentGroup.js +44 -0
- package/Source/Scene/Cesium3DTile.js +2475 -0
- package/Source/Scene/Cesium3DTileBatchTable.js +1132 -0
- package/Source/Scene/Cesium3DTileColorBlendMode.js +52 -0
- package/Source/Scene/Cesium3DTileContent.js +411 -0
- package/Source/Scene/Cesium3DTileContentFactory.js +118 -0
- package/Source/Scene/Cesium3DTileContentState.js +12 -0
- package/Source/Scene/Cesium3DTileContentType.js +179 -0
- package/Source/Scene/Cesium3DTileFeature.js +444 -0
- package/Source/Scene/Cesium3DTileFeatureTable.js +131 -0
- package/Source/Scene/Cesium3DTileOptimizationHint.js +13 -0
- package/Source/Scene/Cesium3DTileOptimizations.js +115 -0
- package/Source/Scene/Cesium3DTilePass.js +79 -0
- package/Source/Scene/Cesium3DTilePassState.js +52 -0
- package/Source/Scene/Cesium3DTilePointFeature.js +856 -0
- package/Source/Scene/Cesium3DTileRefine.js +29 -0
- package/Source/Scene/Cesium3DTileStyle.js +1475 -0
- package/Source/Scene/Cesium3DTileStyleEngine.js +78 -0
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +760 -0
- package/Source/Scene/Cesium3DTileset.js +3932 -0
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +291 -0
- package/Source/Scene/Cesium3DTilesetCache.js +80 -0
- package/Source/Scene/Cesium3DTilesetHeatmap.js +165 -0
- package/Source/Scene/Cesium3DTilesetMetadata.js +199 -0
- package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +131 -0
- package/Source/Scene/Cesium3DTilesetSkipTraversal.js +420 -0
- package/Source/Scene/Cesium3DTilesetStatistics.js +195 -0
- package/Source/Scene/Cesium3DTilesetTraversal.js +323 -0
- package/Source/Scene/CircleEmitter.js +61 -0
- package/Source/Scene/ClassificationPrimitive.js +1387 -0
- package/Source/Scene/ClassificationType.js +35 -0
- package/Source/Scene/ClippingPlane.js +184 -0
- package/Source/Scene/ClippingPlaneCollection.js +764 -0
- package/Source/Scene/ClippingPolygon.js +300 -0
- package/Source/Scene/ClippingPolygonCollection.js +965 -0
- package/Source/Scene/CloudCollection.js +1041 -0
- package/Source/Scene/CloudType.js +33 -0
- package/Source/Scene/ColorBlendMode.js +33 -0
- package/Source/Scene/Composite3DTileContent.js +403 -0
- package/Source/Scene/ConditionsExpression.js +219 -0
- package/Source/Scene/ConeEmitter.js +61 -0
- package/Source/Scene/ContentMetadata.js +184 -0
- package/Source/Scene/CreditDisplay.js +654 -0
- package/Source/Scene/CullFace.js +33 -0
- package/Source/Scene/CumulusCloud.js +347 -0
- package/Source/Scene/DebugAppearance.js +266 -0
- package/Source/Scene/DebugCameraPrimitive.js +257 -0
- package/Source/Scene/DebugInspector.js +151 -0
- package/Source/Scene/DebugModelMatrixPrimitive.js +220 -0
- package/Source/Scene/DepthFunction.js +73 -0
- package/Source/Scene/DepthPlane.js +238 -0
- package/Source/Scene/DerivedCommand.js +708 -0
- package/Source/Scene/DeviceOrientationCameraController.js +120 -0
- package/Source/Scene/DirectionalLight.js +49 -0
- package/Source/Scene/DiscardEmptyTileImagePolicy.js +54 -0
- package/Source/Scene/DiscardMissingTileImagePolicy.js +148 -0
- package/Source/Scene/DracoLoader.js +99 -0
- package/Source/Scene/DynamicAtmosphereLightingType.js +56 -0
- package/Source/Scene/DynamicEnvironmentMapManager.js +1022 -0
- package/Source/Scene/EdgeFramebuffer.js +245 -0
- package/Source/Scene/EllipsoidPrimitive.js +496 -0
- package/Source/Scene/EllipsoidSurfaceAppearance.js +278 -0
- package/Source/Scene/Empty3DTileContent.js +164 -0
- package/Source/Scene/Expression.js +2233 -0
- package/Source/Scene/ExpressionNodeType.js +25 -0
- package/Source/Scene/Fog.js +166 -0
- package/Source/Scene/FrameRateMonitor.js +375 -0
- package/Source/Scene/FrameState.js +477 -0
- package/Source/Scene/FrustumCommands.js +29 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +826 -0
- package/Source/Scene/GaussianSplatPrimitive.js +1065 -0
- package/Source/Scene/GaussianSplatRenderResources.js +81 -0
- package/Source/Scene/GaussianSplatSorter.js +73 -0
- package/Source/Scene/GaussianSplatTextureGenerator.js +64 -0
- package/Source/Scene/Geometry3DTileContent.js +534 -0
- package/Source/Scene/GetFeatureInfoFormat.js +396 -0
- package/Source/Scene/Globe.js +1135 -0
- package/Source/Scene/GlobeDepth.js +407 -0
- package/Source/Scene/GlobeSurfaceShaderSet.js +485 -0
- package/Source/Scene/GlobeSurfaceTile.js +967 -0
- package/Source/Scene/GlobeSurfaceTileProvider.js +2910 -0
- package/Source/Scene/GlobeTranslucency.js +239 -0
- package/Source/Scene/GlobeTranslucencyFramebuffer.js +201 -0
- package/Source/Scene/GlobeTranslucencyState.js +1102 -0
- package/Source/Scene/GltfBufferViewLoader.js +242 -0
- package/Source/Scene/GltfDracoLoader.js +293 -0
- package/Source/Scene/GltfImageLoader.js +320 -0
- package/Source/Scene/GltfIndexBufferLoader.js +421 -0
- package/Source/Scene/GltfJsonLoader.js +314 -0
- package/Source/Scene/GltfLoader.js +2989 -0
- package/Source/Scene/GltfLoaderUtil.js +184 -0
- package/Source/Scene/GltfPipeline/ForEach.js +424 -0
- package/Source/Scene/GltfPipeline/addBuffer.js +30 -0
- package/Source/Scene/GltfPipeline/addDefaults.js +208 -0
- package/Source/Scene/GltfPipeline/addExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/addExtensionsUsed.js +22 -0
- package/Source/Scene/GltfPipeline/addPipelineExtras.js +36 -0
- package/Source/Scene/GltfPipeline/addToArray.js +25 -0
- package/Source/Scene/GltfPipeline/findAccessorMinMax.js +71 -0
- package/Source/Scene/GltfPipeline/forEachTextureInMaterial.js +155 -0
- package/Source/Scene/GltfPipeline/getAccessorByteStride.js +29 -0
- package/Source/Scene/GltfPipeline/getComponentReader.js +147 -0
- package/Source/Scene/GltfPipeline/moveTechniqueRenderStates.js +135 -0
- package/Source/Scene/GltfPipeline/moveTechniquesToExtension.js +145 -0
- package/Source/Scene/GltfPipeline/numberOfComponentsForType.js +29 -0
- package/Source/Scene/GltfPipeline/parseGlb.js +118 -0
- package/Source/Scene/GltfPipeline/readAccessorPacked.js +54 -0
- package/Source/Scene/GltfPipeline/removeExtension.js +64 -0
- package/Source/Scene/GltfPipeline/removeExtensionsRequired.js +24 -0
- package/Source/Scene/GltfPipeline/removeExtensionsUsed.js +26 -0
- package/Source/Scene/GltfPipeline/removePipelineExtras.js +42 -0
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +906 -0
- package/Source/Scene/GltfPipeline/updateAccessorComponentTypes.js +53 -0
- package/Source/Scene/GltfPipeline/updateVersion.js +1148 -0
- package/Source/Scene/GltfPipeline/usesExtension.js +18 -0
- package/Source/Scene/GltfSpzLoader.js +224 -0
- package/Source/Scene/GltfStructuralMetadataLoader.js +505 -0
- package/Source/Scene/GltfTextureLoader.js +399 -0
- package/Source/Scene/GltfVertexBufferLoader.js +634 -0
- package/Source/Scene/Google2DImageryProvider.js +621 -0
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +548 -0
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +589 -0
- package/Source/Scene/GridImageryProvider.js +322 -0
- package/Source/Scene/GroundPolylinePrimitive.js +890 -0
- package/Source/Scene/GroundPrimitive.js +1000 -0
- package/Source/Scene/GroupMetadata.js +203 -0
- package/Source/Scene/HeightReference.js +85 -0
- package/Source/Scene/HorizontalOrigin.js +41 -0
- package/Source/Scene/I3SDataProvider.js +860 -0
- package/Source/Scene/I3SDecoder.js +133 -0
- package/Source/Scene/I3SFeature.js +61 -0
- package/Source/Scene/I3SField.js +360 -0
- package/Source/Scene/I3SGeometry.js +477 -0
- package/Source/Scene/I3SLayer.js +460 -0
- package/Source/Scene/I3SNode.js +927 -0
- package/Source/Scene/I3SStatistics.js +94 -0
- package/Source/Scene/I3SSublayer.js +175 -0
- package/Source/Scene/I3SSymbology.js +336 -0
- package/Source/Scene/I3dmParser.js +140 -0
- package/Source/Scene/ITwinData.js +283 -0
- package/Source/Scene/ImageBasedLighting.js +463 -0
- package/Source/Scene/Imagery.js +120 -0
- package/Source/Scene/ImageryLayer.js +1747 -0
- package/Source/Scene/ImageryLayerCollection.js +645 -0
- package/Source/Scene/ImageryLayerFeatureInfo.js +111 -0
- package/Source/Scene/ImageryProvider.js +267 -0
- package/Source/Scene/ImageryState.js +14 -0
- package/Source/Scene/Implicit3DTileContent.js +1206 -0
- package/Source/Scene/ImplicitAvailabilityBitstream.js +134 -0
- package/Source/Scene/ImplicitMetadataView.js +178 -0
- package/Source/Scene/ImplicitSubdivisionScheme.js +48 -0
- package/Source/Scene/ImplicitSubtree.js +1161 -0
- package/Source/Scene/ImplicitSubtreeCache.js +127 -0
- package/Source/Scene/ImplicitSubtreeMetadata.js +191 -0
- package/Source/Scene/ImplicitTileCoordinates.js +647 -0
- package/Source/Scene/ImplicitTileset.js +269 -0
- package/Source/Scene/InstanceAttributeSemantic.js +79 -0
- package/Source/Scene/InvertClassification.js +381 -0
- package/Source/Scene/IonImageryProvider.js +346 -0
- package/Source/Scene/IonImageryProviderFactory.js +194 -0
- package/Source/Scene/IonWorldImageryStyle.js +33 -0
- package/Source/Scene/JobScheduler.js +199 -0
- package/Source/Scene/JobType.js +10 -0
- package/Source/Scene/JsonMetadataTable.js +114 -0
- package/Source/Scene/KeyframeNode.js +61 -0
- package/Source/Scene/Label.js +1618 -0
- package/Source/Scene/LabelCollection.js +1032 -0
- package/Source/Scene/LabelStyle.js +33 -0
- package/Source/Scene/Light.js +34 -0
- package/Source/Scene/MapMode2D.js +23 -0
- package/Source/Scene/MapboxImageryProvider.js +332 -0
- package/Source/Scene/MapboxStyleImageryProvider.js +342 -0
- package/Source/Scene/Material.js +1929 -0
- package/Source/Scene/MaterialAppearance.js +328 -0
- package/Source/Scene/Megatexture.js +550 -0
- package/Source/Scene/MetadataClass.js +202 -0
- package/Source/Scene/MetadataClassProperty.js +1191 -0
- package/Source/Scene/MetadataComponentType.js +469 -0
- package/Source/Scene/MetadataEntity.js +425 -0
- package/Source/Scene/MetadataEnum.js +219 -0
- package/Source/Scene/MetadataEnumValue.js +131 -0
- package/Source/Scene/MetadataPicking.js +396 -0
- package/Source/Scene/MetadataSchema.js +202 -0
- package/Source/Scene/MetadataSchemaLoader.js +135 -0
- package/Source/Scene/MetadataSemantic.js +153 -0
- package/Source/Scene/MetadataTable.js +357 -0
- package/Source/Scene/MetadataTableProperty.js +840 -0
- package/Source/Scene/MetadataType.js +220 -0
- package/Source/Scene/Model/AlphaPipelineStage.js +51 -0
- package/Source/Scene/Model/AtmospherePipelineStage.js +64 -0
- package/Source/Scene/Model/B3dmLoader.js +368 -0
- package/Source/Scene/Model/BatchTexturePipelineStage.js +71 -0
- package/Source/Scene/Model/CPUStylingPipelineStage.js +77 -0
- package/Source/Scene/Model/CartesianRectangle.js +108 -0
- package/Source/Scene/Model/ClassificationModelDrawCommand.js +534 -0
- package/Source/Scene/Model/ClassificationPipelineStage.js +132 -0
- package/Source/Scene/Model/CustomShader.js +469 -0
- package/Source/Scene/Model/CustomShaderMode.js +40 -0
- package/Source/Scene/Model/CustomShaderPipelineStage.js +667 -0
- package/Source/Scene/Model/CustomShaderTranslucencyMode.js +35 -0
- package/Source/Scene/Model/DequantizationPipelineStage.js +178 -0
- package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
- package/Source/Scene/Model/Extensions/Gpm/AnchorPointDirect.js +61 -0
- package/Source/Scene/Model/Extensions/Gpm/AnchorPointIndirect.js +77 -0
- package/Source/Scene/Model/Extensions/Gpm/CorrelationGroup.js +81 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLoader.js +248 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfGpmLocal.js +179 -0
- package/Source/Scene/Model/Extensions/Gpm/GltfMeshPrimitiveGpmLoader.js +543 -0
- package/Source/Scene/Model/Extensions/Gpm/MeshPrimitiveGpmLocal.js +28 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeMetadata.js +79 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeSource.js +75 -0
- package/Source/Scene/Model/Extensions/Gpm/PpeTexture.js +127 -0
- package/Source/Scene/Model/Extensions/Gpm/Spdcf.js +103 -0
- package/Source/Scene/Model/Extensions/Gpm/StorageType.js +30 -0
- package/Source/Scene/Model/FeatureIdPipelineStage.js +523 -0
- package/Source/Scene/Model/GeoJsonLoader.js +697 -0
- package/Source/Scene/Model/GeometryPipelineStage.js +529 -0
- package/Source/Scene/Model/I3dmLoader.js +883 -0
- package/Source/Scene/Model/ImageBasedLightingPipelineStage.js +168 -0
- package/Source/Scene/Model/ImageryConfiguration.js +26 -0
- package/Source/Scene/Model/ImageryCoverage.js +488 -0
- package/Source/Scene/Model/ImageryFlags.js +31 -0
- package/Source/Scene/Model/ImageryInput.js +60 -0
- package/Source/Scene/Model/ImageryPipelineStage.js +1046 -0
- package/Source/Scene/Model/InstancingPipelineStage.js +1056 -0
- package/Source/Scene/Model/LightingModel.js +30 -0
- package/Source/Scene/Model/LightingPipelineStage.js +73 -0
- package/Source/Scene/Model/MappedPositions.js +84 -0
- package/Source/Scene/Model/MaterialPipelineStage.js +869 -0
- package/Source/Scene/Model/MetadataPickingPipelineStage.js +96 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +657 -0
- package/Source/Scene/Model/Model.js +3340 -0
- package/Source/Scene/Model/Model3DTileContent.js +551 -0
- package/Source/Scene/Model/ModelAlphaOptions.js +26 -0
- package/Source/Scene/Model/ModelAnimation.js +421 -0
- package/Source/Scene/Model/ModelAnimationChannel.js +294 -0
- package/Source/Scene/Model/ModelAnimationCollection.js +553 -0
- package/Source/Scene/Model/ModelArticulation.js +214 -0
- package/Source/Scene/Model/ModelArticulationStage.js +261 -0
- package/Source/Scene/Model/ModelClippingPlanesPipelineStage.js +126 -0
- package/Source/Scene/Model/ModelClippingPolygonsPipelineStage.js +98 -0
- package/Source/Scene/Model/ModelColorPipelineStage.js +98 -0
- package/Source/Scene/Model/ModelDrawCommand.js +922 -0
- package/Source/Scene/Model/ModelDrawCommands.js +218 -0
- package/Source/Scene/Model/ModelFeature.js +229 -0
- package/Source/Scene/Model/ModelFeatureTable.js +316 -0
- package/Source/Scene/Model/ModelImagery.js +410 -0
- package/Source/Scene/Model/ModelImageryMapping.js +489 -0
- package/Source/Scene/Model/ModelLightingOptions.js +29 -0
- package/Source/Scene/Model/ModelMatrixUpdateStage.js +120 -0
- package/Source/Scene/Model/ModelNode.js +125 -0
- package/Source/Scene/Model/ModelPrimitiveImagery.js +972 -0
- package/Source/Scene/Model/ModelReader.js +810 -0
- package/Source/Scene/Model/ModelRenderResources.js +119 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +648 -0
- package/Source/Scene/Model/ModelRuntimePrimitive.js +380 -0
- package/Source/Scene/Model/ModelSceneGraph.js +1098 -0
- package/Source/Scene/Model/ModelSilhouettePipelineStage.js +109 -0
- package/Source/Scene/Model/ModelSkin.js +180 -0
- package/Source/Scene/Model/ModelSplitterPipelineStage.js +65 -0
- package/Source/Scene/Model/ModelStatistics.js +225 -0
- package/Source/Scene/Model/ModelType.js +94 -0
- package/Source/Scene/Model/ModelUtility.js +395 -0
- package/Source/Scene/Model/MorphTargetsPipelineStage.js +249 -0
- package/Source/Scene/Model/NodeRenderResources.js +170 -0
- package/Source/Scene/Model/NodeStatisticsPipelineStage.js +75 -0
- package/Source/Scene/Model/PickingPipelineStage.js +218 -0
- package/Source/Scene/Model/PntsLoader.js +716 -0
- package/Source/Scene/Model/PointCloudStylingPipelineStage.js +392 -0
- package/Source/Scene/Model/PrimitiveOutlineGenerator.js +689 -0
- package/Source/Scene/Model/PrimitiveOutlinePipelineStage.js +99 -0
- package/Source/Scene/Model/PrimitiveRenderResources.js +297 -0
- package/Source/Scene/Model/PrimitiveStatisticsPipelineStage.js +253 -0
- package/Source/Scene/Model/SceneMode2DPipelineStage.js +301 -0
- package/Source/Scene/Model/SelectedFeatureIdPipelineStage.js +180 -0
- package/Source/Scene/Model/SkinningPipelineStage.js +118 -0
- package/Source/Scene/Model/StyleCommandsNeeded.js +29 -0
- package/Source/Scene/Model/TextureManager.js +244 -0
- package/Source/Scene/Model/TextureUniform.js +71 -0
- package/Source/Scene/Model/TilesetPipelineStage.js +73 -0
- package/Source/Scene/Model/UniformType.js +124 -0
- package/Source/Scene/Model/VaryingType.js +61 -0
- package/Source/Scene/Model/VerticalExaggerationPipelineStage.js +58 -0
- package/Source/Scene/Model/WireframePipelineStage.js +118 -0
- package/Source/Scene/Model/pickModel.js +425 -0
- package/Source/Scene/ModelAnimationLoop.js +33 -0
- package/Source/Scene/ModelAnimationState.js +9 -0
- package/Source/Scene/ModelComponents.js +1662 -0
- package/Source/Scene/Moon.js +175 -0
- package/Source/Scene/Multiple3DTileContent.js +722 -0
- package/Source/Scene/NeverTileDiscardPolicy.js +28 -0
- package/Source/Scene/OIT.js +946 -0
- package/Source/Scene/OpenStreetMapImageryProvider.js +128 -0
- package/Source/Scene/OrderedGroundPrimitiveCollection.js +218 -0
- package/Source/Scene/Particle.js +149 -0
- package/Source/Scene/ParticleBurst.js +51 -0
- package/Source/Scene/ParticleEmitter.js +36 -0
- package/Source/Scene/ParticleSystem.js +885 -0
- package/Source/Scene/PerInstanceColorAppearance.js +296 -0
- package/Source/Scene/PerformanceDisplay.js +120 -0
- package/Source/Scene/PickDepth.js +125 -0
- package/Source/Scene/PickDepthFramebuffer.js +79 -0
- package/Source/Scene/PickFramebuffer.js +255 -0
- package/Source/Scene/PickedMetadataInfo.js +57 -0
- package/Source/Scene/Picking.js +1683 -0
- package/Source/Scene/PntsParser.js +547 -0
- package/Source/Scene/PointCloud.js +1412 -0
- package/Source/Scene/PointCloudEyeDomeLighting.js +284 -0
- package/Source/Scene/PointCloudShading.js +104 -0
- package/Source/Scene/PointPrimitive.js +690 -0
- package/Source/Scene/PointPrimitiveCollection.js +1223 -0
- package/Source/Scene/Polyline.js +431 -0
- package/Source/Scene/PolylineCollection.js +1950 -0
- package/Source/Scene/PolylineColorAppearance.js +220 -0
- package/Source/Scene/PolylineMaterialAppearance.js +231 -0
- package/Source/Scene/PostProcessStage.js +1000 -0
- package/Source/Scene/PostProcessStageCollection.js +900 -0
- package/Source/Scene/PostProcessStageComposite.js +359 -0
- package/Source/Scene/PostProcessStageLibrary.js +826 -0
- package/Source/Scene/PostProcessStageSampleMode.js +22 -0
- package/Source/Scene/PostProcessStageTextureCache.js +454 -0
- package/Source/Scene/Primitive.js +2504 -0
- package/Source/Scene/PrimitiveCollection.js +532 -0
- package/Source/Scene/PrimitiveLoadPlan.js +303 -0
- package/Source/Scene/PrimitivePipeline.js +854 -0
- package/Source/Scene/PrimitiveState.js +136 -0
- package/Source/Scene/PropertyAttribute.js +160 -0
- package/Source/Scene/PropertyAttributeProperty.js +177 -0
- package/Source/Scene/PropertyTable.js +536 -0
- package/Source/Scene/PropertyTexture.js +162 -0
- package/Source/Scene/PropertyTextureProperty.js +304 -0
- package/Source/Scene/QuadtreeOccluders.js +30 -0
- package/Source/Scene/QuadtreePrimitive.js +1575 -0
- package/Source/Scene/QuadtreeTile.js +729 -0
- package/Source/Scene/QuadtreeTileLoadState.js +39 -0
- package/Source/Scene/QuadtreeTileProvider.js +212 -0
- package/Source/Scene/ResourceCache.js +824 -0
- package/Source/Scene/ResourceCacheKey.js +601 -0
- package/Source/Scene/ResourceCacheStatistics.js +149 -0
- package/Source/Scene/ResourceLoader.js +127 -0
- package/Source/Scene/ResourceLoaderState.js +56 -0
- package/Source/Scene/SDFSettings.js +39 -0
- package/Source/Scene/Scene.js +5280 -0
- package/Source/Scene/SceneFramebuffer.js +106 -0
- package/Source/Scene/SceneMode.js +56 -0
- package/Source/Scene/SceneTransforms.js +463 -0
- package/Source/Scene/SceneTransitioner.js +1111 -0
- package/Source/Scene/ScreenSpaceCameraController.js +3098 -0
- package/Source/Scene/SensorVolumePortionToDisplay.js +69 -0
- package/Source/Scene/ShadowMap.js +1957 -0
- package/Source/Scene/ShadowMapShader.js +395 -0
- package/Source/Scene/ShadowMode.js +78 -0
- package/Source/Scene/ShadowVolumeAppearance.js +936 -0
- package/Source/Scene/SingleTileImageryProvider.js +380 -0
- package/Source/Scene/SkyAtmosphere.js +400 -0
- package/Source/Scene/SkyBox.js +289 -0
- package/Source/Scene/SpatialNode.js +377 -0
- package/Source/Scene/SpecularEnvironmentCubeMap.js +240 -0
- package/Source/Scene/SphereEmitter.js +65 -0
- package/Source/Scene/SplitDirection.js +34 -0
- package/Source/Scene/Splitter.js +49 -0
- package/Source/Scene/StencilConstants.js +37 -0
- package/Source/Scene/StencilFunction.js +73 -0
- package/Source/Scene/StencilOperation.js +73 -0
- package/Source/Scene/StructuralMetadata.js +243 -0
- package/Source/Scene/StyleExpression.js +86 -0
- package/Source/Scene/Sun.js +363 -0
- package/Source/Scene/SunLight.js +31 -0
- package/Source/Scene/SunPostProcess.js +288 -0
- package/Source/Scene/SupportedImageFormats.js +18 -0
- package/Source/Scene/Terrain.js +245 -0
- package/Source/Scene/TerrainFillMesh.js +2222 -0
- package/Source/Scene/TerrainState.js +13 -0
- package/Source/Scene/TileBoundingRegion.js +489 -0
- package/Source/Scene/TileBoundingS2Cell.js +699 -0
- package/Source/Scene/TileBoundingSphere.js +167 -0
- package/Source/Scene/TileBoundingVolume.js +68 -0
- package/Source/Scene/TileCoordinatesImageryProvider.js +269 -0
- package/Source/Scene/TileDiscardPolicy.js +34 -0
- package/Source/Scene/TileImagery.js +126 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +442 -0
- package/Source/Scene/TileMetadata.js +184 -0
- package/Source/Scene/TileOrientedBoundingBox.js +219 -0
- package/Source/Scene/TileReplacementQueue.js +119 -0
- package/Source/Scene/TileSelectionResult.js +80 -0
- package/Source/Scene/TileState.js +10 -0
- package/Source/Scene/Tileset3DTileContent.js +182 -0
- package/Source/Scene/TilesetMetadata.js +186 -0
- package/Source/Scene/TimeDynamicImagery.js +308 -0
- package/Source/Scene/TimeDynamicPointCloud.js +802 -0
- package/Source/Scene/Tonemapper.js +64 -0
- package/Source/Scene/TranslucentTileClassification.js +514 -0
- package/Source/Scene/TweenCollection.js +585 -0
- package/Source/Scene/UrlTemplateImageryProvider.js +989 -0
- package/Source/Scene/Vector3DTileBatch.js +37 -0
- package/Source/Scene/Vector3DTileClampedPolylines.js +783 -0
- package/Source/Scene/Vector3DTileContent.js +770 -0
- package/Source/Scene/Vector3DTileGeometry.js +497 -0
- package/Source/Scene/Vector3DTilePoints.js +548 -0
- package/Source/Scene/Vector3DTilePolygons.js +479 -0
- package/Source/Scene/Vector3DTilePolylines.js +679 -0
- package/Source/Scene/Vector3DTilePrimitive.js +1276 -0
- package/Source/Scene/VertexAttributeSemantic.js +305 -0
- package/Source/Scene/VerticalOrigin.js +49 -0
- package/Source/Scene/View.js +465 -0
- package/Source/Scene/ViewportQuad.js +182 -0
- package/Source/Scene/ViewshedShadowMap.js +1953 -0
- package/Source/Scene/VoxelBoundsCollection.js +494 -0
- package/Source/Scene/VoxelBoxShape.js +595 -0
- package/Source/Scene/VoxelCell.js +274 -0
- package/Source/Scene/VoxelContent.js +231 -0
- package/Source/Scene/VoxelCylinderShape.js +868 -0
- package/Source/Scene/VoxelEllipsoidShape.js +1174 -0
- package/Source/Scene/VoxelMetadataOrder.js +24 -0
- package/Source/Scene/VoxelPrimitive.js +2169 -0
- package/Source/Scene/VoxelProvider.js +234 -0
- package/Source/Scene/VoxelRenderResources.js +259 -0
- package/Source/Scene/VoxelShape.js +179 -0
- package/Source/Scene/VoxelShapeType.js +105 -0
- package/Source/Scene/VoxelTraversal.js +1264 -0
- package/Source/Scene/WebMapServiceImageryProvider.js +649 -0
- package/Source/Scene/WebMapTileServiceImageryProvider.js +575 -0
- package/Source/Scene/buildVoxelDrawCommands.js +177 -0
- package/Source/Scene/computeFlyToLocationForRectangle.js +74 -0
- package/Source/Scene/createBillboardPointCallback.js +70 -0
- package/Source/Scene/createElevationBandMaterial.js +580 -0
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +116 -0
- package/Source/Scene/createOsmBuildingsAsync.js +79 -0
- package/Source/Scene/createTangentSpaceDebugPrimitive.js +114 -0
- package/Source/Scene/createWorldImageryAsync.js +39 -0
- package/Source/Scene/findContentMetadata.js +51 -0
- package/Source/Scene/findGroupMetadata.js +39 -0
- package/Source/Scene/findTileMetadata.js +53 -0
- package/Source/Scene/getBinaryAccessor.js +56 -0
- package/Source/Scene/getClipAndStyleCode.js +34 -0
- package/Source/Scene/getClippingFunction.js +154 -0
- package/Source/Scene/getMeshPrimitives.js +72 -0
- package/Source/Scene/getMetadataClassProperty.js +43 -0
- package/Source/Scene/getMetadataProperty.js +48 -0
- package/Source/Scene/hasExtension.js +19 -0
- package/Source/Scene/parseBatchTable.js +448 -0
- package/Source/Scene/parseFeatureMetadataLegacy.js +139 -0
- package/Source/Scene/parseStructuralMetadata.js +102 -0
- package/Source/Scene/preprocess3DTileContent.js +102 -0
- package/Source/Scene/processVoxelProperties.js +398 -0
- package/Source/Shaders/AdjustTranslucentFS.glsl +27 -0
- package/Source/Shaders/AdjustTranslucentFS.js +29 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.glsl +29 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceFS.js +31 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.glsl +26 -0
- package/Source/Shaders/Appearances/AllMaterialAppearanceVS.js +28 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.glsl +23 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceFS.js +25 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.glsl +17 -0
- package/Source/Shaders/Appearances/BasicMaterialAppearanceVS.js +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.glsl +33 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceFS.js +35 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.glsl +19 -0
- package/Source/Shaders/Appearances/EllipsoidSurfaceAppearanceVS.js +21 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.glsl +24 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceFS.js +26 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/PerInstanceColorAppearanceVS.js +22 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.glsl +6 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceFS.js +8 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.glsl +15 -0
- package/Source/Shaders/Appearances/PerInstanceFlatColorAppearanceVS.js +17 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.glsl +28 -0
- package/Source/Shaders/Appearances/PolylineColorAppearanceVS.js +30 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.glsl +33 -0
- package/Source/Shaders/Appearances/PolylineMaterialAppearanceVS.js +35 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.glsl +25 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceFS.js +27 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.glsl +20 -0
- package/Source/Shaders/Appearances/TexturedMaterialAppearanceVS.js +22 -0
- package/Source/Shaders/AtmosphereCommon.glsl +187 -0
- package/Source/Shaders/AtmosphereCommon.js +189 -0
- package/Source/Shaders/BillboardCollectionFS.glsl +261 -0
- package/Source/Shaders/BillboardCollectionFS.js +262 -0
- package/Source/Shaders/BillboardCollectionVS.glsl +445 -0
- package/Source/Shaders/BillboardCollectionVS.js +447 -0
- package/Source/Shaders/BrdfLutGeneratorFS.glsl +100 -0
- package/Source/Shaders/BrdfLutGeneratorFS.js +102 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/degreesPerRadian.js +18 -0
- package/Source/Shaders/Builtin/Constants/depthRange.glsl +14 -0
- package/Source/Shaders/Builtin/Constants/depthRange.js +16 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon1.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon2.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon3.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon4.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon5.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon6.js +9 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/epsilon7.js +9 -0
- package/Source/Shaders/Builtin/Constants/infinity.glsl +7 -0
- package/Source/Shaders/Builtin/Constants/infinity.js +9 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/oneOverTwoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passCompute.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCompute.js +11 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passEnvironment.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passGlobe.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOpaque.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTerrainClassification.js +11 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +11 -0
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passVoxels.js +11 -0
- package/Source/Shaders/Builtin/Constants/pi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/pi.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverFour.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverSix.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverThree.js +18 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/piOverTwo.js +18 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/radiansPerDegree.js +18 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode2D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneMode3D.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeColumbusView.js +13 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.glsl +11 -0
- package/Source/Shaders/Builtin/Constants/sceneModeMorphing.js +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.glsl +13 -0
- package/Source/Shaders/Builtin/Constants/solarRadius.js +15 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/threePiOver2.js +18 -0
- package/Source/Shaders/Builtin/Constants/twoPi.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/twoPi.js +18 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.glsl +16 -0
- package/Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js +18 -0
- package/Source/Shaders/Builtin/CzmBuiltins.js +280 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/HSBToRGB.js +26 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/HSLToRGB.js +33 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSB.js +29 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.glsl +34 -0
- package/Source/Shaders/Builtin/Functions/RGBToHSL.js +36 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/RGBToXYZ.js +32 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/XYZToRGB.js +32 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/acesTonemapping.js +18 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/alphaWeight.js +13 -0
- package/Source/Shaders/Builtin/Functions/antialias.glsl +39 -0
- package/Source/Shaders/Builtin/Functions/antialias.js +41 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/applyHSBShift.js +34 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/approximateSphericalCoordinates.js +20 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/approximateTanh.js +12 -0
- package/Source/Shaders/Builtin/Functions/backFacing.glsl +13 -0
- package/Source/Shaders/Builtin/Functions/backFacing.js +15 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.glsl +71 -0
- package/Source/Shaders/Builtin/Functions/branchFreeTernary.js +73 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.glsl +8 -0
- package/Source/Shaders/Builtin/Functions/cascadeColor.js +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.glsl +7 -0
- package/Source/Shaders/Builtin/Functions/cascadeDistance.js +9 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeMatrix.js +12 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/cascadeWeights.js +12 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/clipPolygons.js +39 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +14 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.glsl +88 -0
- package/Source/Shaders/Builtin/Functions/computeAtmosphereColor.js +90 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/computeGroundAtmosphereScattering.js +32 -0
- package/Source/Shaders/Builtin/Functions/computePosition.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/computePosition.js +24 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.glsl +149 -0
- package/Source/Shaders/Builtin/Functions/computeScattering.js +151 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.glsl +211 -0
- package/Source/Shaders/Builtin/Functions/cosineAndSine.js +213 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.glsl +17 -0
- package/Source/Shaders/Builtin/Functions/decompressTextureCoordinates.js +19 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.glsl +47 -0
- package/Source/Shaders/Builtin/Functions/depthClamp.js +49 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.glsl +33 -0
- package/Source/Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates.js +35 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidContainsPoint.js +14 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.glsl +10 -0
- package/Source/Shaders/Builtin/Functions/ellipsoidTextureCoordinates.js +12 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/equalsEpsilon.js +38 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/eyeOffset.js +22 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/eyeToWindowCoordinates.js +34 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.glsl +55 -0
- package/Source/Shaders/Builtin/Functions/fastApproximateAtan.js +57 -0
- package/Source/Shaders/Builtin/Functions/fog.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/fog.js +40 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/gammaCorrect.js +24 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/geodeticSurfaceNormal.js +18 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/getDefaultMaterial.js +29 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getDynamicAtmosphereLightDirection.js +24 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/getLambertDiffuse.js +24 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/getSpecular.js +31 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.glsl +37 -0
- package/Source/Shaders/Builtin/Functions/getWaterNoise.js +39 -0
- package/Source/Shaders/Builtin/Functions/hue.glsl +30 -0
- package/Source/Shaders/Builtin/Functions/hue.js +32 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.glsl +12 -0
- package/Source/Shaders/Builtin/Functions/inverseGamma.js +14 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isEmpty.js +21 -0
- package/Source/Shaders/Builtin/Functions/isFull.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/isFull.js +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/latitudeToWebMercatorFraction.js +23 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/lineDistance.js +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/linearToSrgb.js +18 -0
- package/Source/Shaders/Builtin/Functions/luminance.glsl +20 -0
- package/Source/Shaders/Builtin/Functions/luminance.js +22 -0
- package/Source/Shaders/Builtin/Functions/maximumComponent.glsl +21 -0
- package/Source/Shaders/Builtin/Functions/maximumComponent.js +23 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.glsl +61 -0
- package/Source/Shaders/Builtin/Functions/metersPerPixel.js +63 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +40 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/multiplyWithColorBalance.js +20 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.glsl +26 -0
- package/Source/Shaders/Builtin/Functions/nearFarScalar.js +28 -0
- package/Source/Shaders/Builtin/Functions/octDecode.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/octDecode.js +85 -0
- package/Source/Shaders/Builtin/Functions/packDepth.glsl +18 -0
- package/Source/Shaders/Builtin/Functions/packDepth.js +20 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.glsl +164 -0
- package/Source/Shaders/Builtin/Functions/pbrLighting.js +166 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.glsl +23 -0
- package/Source/Shaders/Builtin/Functions/pbrNeutralTonemapping.js +25 -0
- package/Source/Shaders/Builtin/Functions/phong.glsl +63 -0
- package/Source/Shaders/Builtin/Functions/phong.js +65 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.glsl +28 -0
- package/Source/Shaders/Builtin/Functions/planeDistance.js +30 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.glsl +19 -0
- package/Source/Shaders/Builtin/Functions/pointAlongRay.js +21 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.glsl +83 -0
- package/Source/Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval.js +85 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/raySphereIntersectionInterval.js +38 -0
- package/Source/Shaders/Builtin/Functions/readDepth.glsl +4 -0
- package/Source/Shaders/Builtin/Functions/readDepth.js +6 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/readNonPerspective.js +33 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.glsl +11 -0
- package/Source/Shaders/Builtin/Functions/reverseLogDepth.js +13 -0
- package/Source/Shaders/Builtin/Functions/round.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/round.js +24 -0
- package/Source/Shaders/Builtin/Functions/saturation.glsl +22 -0
- package/Source/Shaders/Builtin/Functions/saturation.js +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/shadowDepthCompare.js +26 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.glsl +66 -0
- package/Source/Shaders/Builtin/Functions/shadowVisibility.js +68 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.glsl +29 -0
- package/Source/Shaders/Builtin/Functions/signNotZero.js +31 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.glsl +44 -0
- package/Source/Shaders/Builtin/Functions/sphericalHarmonics.js +46 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/srgbToLinear.js +18 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.glsl +25 -0
- package/Source/Shaders/Builtin/Functions/tangentToEyeSpaceMatrix.js +27 -0
- package/Source/Shaders/Builtin/Functions/textureCube.glsl +36 -0
- package/Source/Shaders/Builtin/Functions/textureCube.js +37 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.glsl +15 -0
- package/Source/Shaders/Builtin/Functions/transformPlane.js +17 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.glsl +45 -0
- package/Source/Shaders/Builtin/Functions/translateRelativeToEye.js +47 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.glsl +27 -0
- package/Source/Shaders/Builtin/Functions/translucentPhong.js +29 -0
- package/Source/Shaders/Builtin/Functions/transpose.glsl +45 -0
- package/Source/Shaders/Builtin/Functions/transpose.js +47 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.glsl +14 -0
- package/Source/Shaders/Builtin/Functions/unpackClippingExtents.js +15 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.glsl +16 -0
- package/Source/Shaders/Builtin/Functions/unpackDepth.js +18 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/unpackFloat.js +26 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.glsl +31 -0
- package/Source/Shaders/Builtin/Functions/unpackUint.js +33 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.glsl +38 -0
- package/Source/Shaders/Builtin/Functions/valueTransform.js +40 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.glsl +64 -0
- package/Source/Shaders/Builtin/Functions/vertexLogDepth.js +66 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.glsl +110 -0
- package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +112 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.glsl +24 -0
- package/Source/Shaders/Builtin/Functions/writeDepthClamp.js +26 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.glsl +79 -0
- package/Source/Shaders/Builtin/Functions/writeLogDepth.js +81 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.glsl +32 -0
- package/Source/Shaders/Builtin/Functions/writeNonPerspective.js +34 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.glsl +9 -0
- package/Source/Shaders/Builtin/Structs/depthRangeStruct.js +11 -0
- package/Source/Shaders/Builtin/Structs/material.glsl +22 -0
- package/Source/Shaders/Builtin/Structs/material.js +24 -0
- package/Source/Shaders/Builtin/Structs/materialInput.glsl +30 -0
- package/Source/Shaders/Builtin/Structs/materialInput.js +32 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.glsl +45 -0
- package/Source/Shaders/Builtin/Structs/modelMaterial.js +47 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.glsl +16 -0
- package/Source/Shaders/Builtin/Structs/modelVertexOutput.js +18 -0
- package/Source/Shaders/Builtin/Structs/ray.glsl +11 -0
- package/Source/Shaders/Builtin/Structs/ray.js +13 -0
- package/Source/Shaders/Builtin/Structs/raySegment.glsl +27 -0
- package/Source/Shaders/Builtin/Structs/raySegment.js +29 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.glsl +15 -0
- package/Source/Shaders/Builtin/Structs/shadowParameters.js +17 -0
- package/Source/Shaders/CloudCollectionFS.glsl +263 -0
- package/Source/Shaders/CloudCollectionFS.js +265 -0
- package/Source/Shaders/CloudCollectionVS.glsl +48 -0
- package/Source/Shaders/CloudCollectionVS.js +50 -0
- package/Source/Shaders/CloudNoiseFS.glsl +92 -0
- package/Source/Shaders/CloudNoiseFS.js +94 -0
- package/Source/Shaders/CloudNoiseVS.glsl +18 -0
- package/Source/Shaders/CloudNoiseVS.js +20 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.glsl +12 -0
- package/Source/Shaders/CompareAndPackTranslucentDepth.js +14 -0
- package/Source/Shaders/CompositeOITFS.glsl +31 -0
- package/Source/Shaders/CompositeOITFS.js +33 -0
- package/Source/Shaders/ComputeIrradianceFS.glsl +103 -0
- package/Source/Shaders/ComputeIrradianceFS.js +105 -0
- package/Source/Shaders/ComputeRadianceMapFS.glsl +107 -0
- package/Source/Shaders/ComputeRadianceMapFS.js +109 -0
- package/Source/Shaders/ConvolveSpecularMapFS.glsl +70 -0
- package/Source/Shaders/ConvolveSpecularMapFS.js +72 -0
- package/Source/Shaders/ConvolveSpecularMapVS.glsl +24 -0
- package/Source/Shaders/ConvolveSpecularMapVS.js +26 -0
- package/Source/Shaders/DepthPlaneFS.glsl +36 -0
- package/Source/Shaders/DepthPlaneFS.js +38 -0
- package/Source/Shaders/DepthPlaneVS.glsl +11 -0
- package/Source/Shaders/DepthPlaneVS.js +13 -0
- package/Source/Shaders/EllipsoidFS.glsl +104 -0
- package/Source/Shaders/EllipsoidFS.js +106 -0
- package/Source/Shaders/EllipsoidVS.glsl +28 -0
- package/Source/Shaders/EllipsoidVS.js +30 -0
- package/Source/Shaders/FXAA3_11.glsl +650 -0
- package/Source/Shaders/FXAA3_11.js +680 -0
- package/Source/Shaders/GlobeFS.glsl +692 -0
- package/Source/Shaders/GlobeFS.js +694 -0
- package/Source/Shaders/GlobeVS.glsl +286 -0
- package/Source/Shaders/GlobeVS.js +288 -0
- package/Source/Shaders/GroundAtmosphere.glsl +18 -0
- package/Source/Shaders/GroundAtmosphere.js +20 -0
- package/Source/Shaders/Materials/AspectRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/AspectRampMaterial.js +13 -0
- package/Source/Shaders/Materials/BumpMapMaterial.glsl +29 -0
- package/Source/Shaders/Materials/BumpMapMaterial.js +31 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.glsl +29 -0
- package/Source/Shaders/Materials/CheckerboardMaterial.js +31 -0
- package/Source/Shaders/Materials/DotMaterial.glsl +18 -0
- package/Source/Shaders/Materials/DotMaterial.js +20 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.glsl +74 -0
- package/Source/Shaders/Materials/ElevationBandMaterial.js +76 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.glsl +26 -0
- package/Source/Shaders/Materials/ElevationContourMaterial.js +28 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.glsl +14 -0
- package/Source/Shaders/Materials/ElevationRampMaterial.js +16 -0
- package/Source/Shaders/Materials/FadeMaterial.glsl +37 -0
- package/Source/Shaders/Materials/FadeMaterial.js +39 -0
- package/Source/Shaders/Materials/GridMaterial.glsl +57 -0
- package/Source/Shaders/Materials/GridMaterial.js +59 -0
- package/Source/Shaders/Materials/NormalMapMaterial.glsl +19 -0
- package/Source/Shaders/Materials/NormalMapMaterial.js +21 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.glsl +63 -0
- package/Source/Shaders/Materials/PolylineArrowMaterial.js +65 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.glsl +39 -0
- package/Source/Shaders/Materials/PolylineDashMaterial.js +41 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.glsl +25 -0
- package/Source/Shaders/Materials/PolylineGlowMaterial.js +27 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.glsl +29 -0
- package/Source/Shaders/Materials/PolylineOutlineMaterial.js +31 -0
- package/Source/Shaders/Materials/RimLightingMaterial.glsl +21 -0
- package/Source/Shaders/Materials/RimLightingMaterial.js +23 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.glsl +11 -0
- package/Source/Shaders/Materials/SlopeRampMaterial.js +13 -0
- package/Source/Shaders/Materials/StripeMaterial.glsl +24 -0
- package/Source/Shaders/Materials/StripeMaterial.js +26 -0
- package/Source/Shaders/Materials/Water.glsl +58 -0
- package/Source/Shaders/Materials/Water.js +60 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.glsl +15 -0
- package/Source/Shaders/Materials/WaterMaskMaterial.js +17 -0
- package/Source/Shaders/Model/AtmosphereStageFS.glsl +108 -0
- package/Source/Shaders/Model/AtmosphereStageFS.js +110 -0
- package/Source/Shaders/Model/AtmosphereStageVS.glsl +12 -0
- package/Source/Shaders/Model/AtmosphereStageVS.js +14 -0
- package/Source/Shaders/Model/CPUStylingStageFS.glsl +49 -0
- package/Source/Shaders/Model/CPUStylingStageFS.js +51 -0
- package/Source/Shaders/Model/CPUStylingStageVS.glsl +30 -0
- package/Source/Shaders/Model/CPUStylingStageVS.js +32 -0
- package/Source/Shaders/Model/CustomShaderStageFS.glsl +18 -0
- package/Source/Shaders/Model/CustomShaderStageFS.js +20 -0
- package/Source/Shaders/Model/CustomShaderStageVS.glsl +19 -0
- package/Source/Shaders/Model/CustomShaderStageVS.js +21 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.glsl +58 -0
- package/Source/Shaders/Model/EdgeDetectionStageFS.js +60 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.glsl +83 -0
- package/Source/Shaders/Model/EdgeVisibilityStageFS.js +85 -0
- package/Source/Shaders/Model/FeatureIdStageFS.glsl +4 -0
- package/Source/Shaders/Model/FeatureIdStageFS.js +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.glsl +6 -0
- package/Source/Shaders/Model/FeatureIdStageVS.js +8 -0
- package/Source/Shaders/Model/GeometryStageFS.glsl +25 -0
- package/Source/Shaders/Model/GeometryStageFS.js +27 -0
- package/Source/Shaders/Model/GeometryStageVS.glsl +42 -0
- package/Source/Shaders/Model/GeometryStageVS.js +44 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.glsl +101 -0
- package/Source/Shaders/Model/ImageBasedLightingStageFS.js +103 -0
- package/Source/Shaders/Model/InstancingStageCommon.glsl +67 -0
- package/Source/Shaders/Model/InstancingStageCommon.js +69 -0
- package/Source/Shaders/Model/InstancingStageVS.glsl +18 -0
- package/Source/Shaders/Model/InstancingStageVS.js +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.glsl +20 -0
- package/Source/Shaders/Model/LegacyInstancingStageVS.js +22 -0
- package/Source/Shaders/Model/LightingStageFS.glsl +120 -0
- package/Source/Shaders/Model/LightingStageFS.js +122 -0
- package/Source/Shaders/Model/MaterialStageFS.glsl +497 -0
- package/Source/Shaders/Model/MaterialStageFS.js +499 -0
- package/Source/Shaders/Model/MetadataStageFS.glsl +9 -0
- package/Source/Shaders/Model/MetadataStageFS.js +11 -0
- package/Source/Shaders/Model/MetadataStageVS.glsl +10 -0
- package/Source/Shaders/Model/MetadataStageVS.js +12 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.glsl +88 -0
- package/Source/Shaders/Model/ModelClippingPlanesStageFS.js +90 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.glsl +6 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageFS.js +8 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.glsl +27 -0
- package/Source/Shaders/Model/ModelClippingPolygonsStageVS.js +29 -0
- package/Source/Shaders/Model/ModelColorStageFS.glsl +7 -0
- package/Source/Shaders/Model/ModelColorStageFS.js +9 -0
- package/Source/Shaders/Model/ModelFS.glsl +133 -0
- package/Source/Shaders/Model/ModelFS.js +135 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.glsl +5 -0
- package/Source/Shaders/Model/ModelSilhouetteStageFS.js +6 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.glsl +10 -0
- package/Source/Shaders/Model/ModelSilhouetteStageVS.js +12 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.glsl +9 -0
- package/Source/Shaders/Model/ModelSplitterStageFS.js +11 -0
- package/Source/Shaders/Model/ModelVS.glsl +161 -0
- package/Source/Shaders/Model/ModelVS.js +163 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.glsl +15 -0
- package/Source/Shaders/Model/MorphTargetsStageVS.js +16 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.glsl +45 -0
- package/Source/Shaders/Model/PointCloudStylingStageVS.js +47 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +15 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +17 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.glsl +3 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageVS.js +5 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.glsl +51 -0
- package/Source/Shaders/Model/SelectedFeatureIdStageCommon.js +53 -0
- package/Source/Shaders/Model/SkinningStageVS.glsl +18 -0
- package/Source/Shaders/Model/SkinningStageVS.js +19 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.glsl +39 -0
- package/Source/Shaders/Model/VerticalExaggerationStageVS.js +41 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.glsl +47 -0
- package/Source/Shaders/PointPrimitiveCollectionFS.js +49 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.glsl +185 -0
- package/Source/Shaders/PointPrimitiveCollectionVS.js +187 -0
- package/Source/Shaders/PolygonSignedDistanceFS.glsl +100 -0
- package/Source/Shaders/PolygonSignedDistanceFS.js +101 -0
- package/Source/Shaders/PolylineCommon.glsl +176 -0
- package/Source/Shaders/PolylineCommon.js +178 -0
- package/Source/Shaders/PolylineFS.glsl +25 -0
- package/Source/Shaders/PolylineFS.js +27 -0
- package/Source/Shaders/PolylineShadowVolumeFS.glsl +86 -0
- package/Source/Shaders/PolylineShadowVolumeFS.js +88 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.glsl +45 -0
- package/Source/Shaders/PolylineShadowVolumeMorphFS.js +47 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.glsl +177 -0
- package/Source/Shaders/PolylineShadowVolumeMorphVS.js +179 -0
- package/Source/Shaders/PolylineShadowVolumeVS.glsl +168 -0
- package/Source/Shaders/PolylineShadowVolumeVS.js +170 -0
- package/Source/Shaders/PolylineVS.glsl +103 -0
- package/Source/Shaders/PolylineVS.js +105 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.glsl +25 -0
- package/Source/Shaders/PostProcessStages/AcesTonemappingStage.js +27 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.glsl +17 -0
- package/Source/Shaders/PostProcessStages/AdditiveBlend.js +19 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +144 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +146 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +11 -0
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +13 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.glsl +19 -0
- package/Source/Shaders/PostProcessStages/BlackAndWhite.js +21 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.glsl +20 -0
- package/Source/Shaders/PostProcessStages/BloomComposite.js +22 -0
- package/Source/Shaders/PostProcessStages/BrightPass.glsl +30 -0
- package/Source/Shaders/PostProcessStages/BrightPass.js +32 -0
- package/Source/Shaders/PostProcessStages/Brightness.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Brightness.js +13 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.glsl +31 -0
- package/Source/Shaders/PostProcessStages/CompositeTranslucentClassification.js +33 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.glsl +17 -0
- package/Source/Shaders/PostProcessStages/ContrastBias.js +19 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.glsl +39 -0
- package/Source/Shaders/PostProcessStages/DepthOfField.js +41 -0
- package/Source/Shaders/PostProcessStages/DepthView.glsl +9 -0
- package/Source/Shaders/PostProcessStages/DepthView.js +11 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.glsl +14 -0
- package/Source/Shaders/PostProcessStages/DepthViewPacked.js +16 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.glsl +60 -0
- package/Source/Shaders/PostProcessStages/EdgeDetection.js +62 -0
- package/Source/Shaders/PostProcessStages/FXAA.glsl +21 -0
- package/Source/Shaders/PostProcessStages/FXAA.js +23 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.glsl +40 -0
- package/Source/Shaders/PostProcessStages/FilmicTonemapping.js +42 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.glsl +47 -0
- package/Source/Shaders/PostProcessStages/GaussianBlur1D.js +49 -0
- package/Source/Shaders/PostProcessStages/LensFlare.glsl +153 -0
- package/Source/Shaders/PostProcessStages/LensFlare.js +155 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.glsl +28 -0
- package/Source/Shaders/PostProcessStages/ModifiedReinhardTonemapping.js +30 -0
- package/Source/Shaders/PostProcessStages/NightVision.glsl +16 -0
- package/Source/Shaders/PostProcessStages/NightVision.js +18 -0
- package/Source/Shaders/PostProcessStages/PassThrough.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThrough.js +10 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.glsl +8 -0
- package/Source/Shaders/PostProcessStages/PassThroughDepth.js +10 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.glsl +25 -0
- package/Source/Shaders/PostProcessStages/PbrNeutralTonemapping.js +27 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.glsl +61 -0
- package/Source/Shaders/PostProcessStages/PointCloudEyeDomeLighting.js +63 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.glsl +27 -0
- package/Source/Shaders/PostProcessStages/ReinhardTonemapping.js +29 -0
- package/Source/Shaders/PostProcessStages/Silhouette.glsl +11 -0
- package/Source/Shaders/PostProcessStages/Silhouette.js +13 -0
- package/Source/Shaders/PrimitiveGaussianSplatFS.glsl +18 -0
- package/Source/Shaders/PrimitiveGaussianSplatFS.js +20 -0
- package/Source/Shaders/PrimitiveGaussianSplatVS.glsl +189 -0
- package/Source/Shaders/PrimitiveGaussianSplatVS.js +190 -0
- package/Source/Shaders/ReprojectWebMercatorFS.glsl +8 -0
- package/Source/Shaders/ReprojectWebMercatorFS.js +10 -0
- package/Source/Shaders/ReprojectWebMercatorVS.glsl +12 -0
- package/Source/Shaders/ReprojectWebMercatorVS.js +14 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +153 -0
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +155 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.glsl +101 -0
- package/Source/Shaders/ShadowVolumeAppearanceVS.js +103 -0
- package/Source/Shaders/ShadowVolumeFS.glsl +13 -0
- package/Source/Shaders/ShadowVolumeFS.js +15 -0
- package/Source/Shaders/SkyAtmosphereCommon.glsl +81 -0
- package/Source/Shaders/SkyAtmosphereCommon.js +83 -0
- package/Source/Shaders/SkyAtmosphereFS.glsl +59 -0
- package/Source/Shaders/SkyAtmosphereFS.js +61 -0
- package/Source/Shaders/SkyAtmosphereVS.glsl +32 -0
- package/Source/Shaders/SkyAtmosphereVS.js +34 -0
- package/Source/Shaders/SkyBoxFS.glsl +9 -0
- package/Source/Shaders/SkyBoxFS.js +11 -0
- package/Source/Shaders/SkyBoxVS.glsl +9 -0
- package/Source/Shaders/SkyBoxVS.js +11 -0
- package/Source/Shaders/SunFS.glsl +9 -0
- package/Source/Shaders/SunFS.js +11 -0
- package/Source/Shaders/SunTextureFS.glsl +55 -0
- package/Source/Shaders/SunTextureFS.js +57 -0
- package/Source/Shaders/SunVS.glsl +28 -0
- package/Source/Shaders/SunVS.js +30 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.glsl +48 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesFS.js +50 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.glsl +85 -0
- package/Source/Shaders/Vector3DTileClampedPolylinesVS.js +87 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.glsl +22 -0
- package/Source/Shaders/Vector3DTilePolylinesVS.js +24 -0
- package/Source/Shaders/VectorTileVS.glsl +9 -0
- package/Source/Shaders/VectorTileVS.js +11 -0
- package/Source/Shaders/ViewportQuadFS.glsl +16 -0
- package/Source/Shaders/ViewportQuadFS.js +18 -0
- package/Source/Shaders/ViewportQuadVS.glsl +10 -0
- package/Source/Shaders/ViewportQuadVS.js +12 -0
- package/Source/Shaders/Voxels/IntersectBox.glsl +34 -0
- package/Source/Shaders/Voxels/IntersectBox.js +36 -0
- package/Source/Shaders/Voxels/IntersectCylinder.glsl +142 -0
- package/Source/Shaders/Voxels/IntersectCylinder.js +144 -0
- package/Source/Shaders/Voxels/IntersectDepth.glsl +27 -0
- package/Source/Shaders/Voxels/IntersectDepth.js +29 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +330 -0
- package/Source/Shaders/Voxels/IntersectEllipsoid.js +332 -0
- package/Source/Shaders/Voxels/IntersectLongitude.glsl +114 -0
- package/Source/Shaders/Voxels/IntersectLongitude.js +116 -0
- package/Source/Shaders/Voxels/IntersectPlane.glsl +80 -0
- package/Source/Shaders/Voxels/IntersectPlane.js +82 -0
- package/Source/Shaders/Voxels/Intersection.glsl +50 -0
- package/Source/Shaders/Voxels/Intersection.js +52 -0
- package/Source/Shaders/Voxels/IntersectionUtils.glsl +167 -0
- package/Source/Shaders/Voxels/IntersectionUtils.js +169 -0
- package/Source/Shaders/Voxels/Megatexture.glsl +123 -0
- package/Source/Shaders/Voxels/Megatexture.js +125 -0
- package/Source/Shaders/Voxels/Octree.glsl +257 -0
- package/Source/Shaders/Voxels/Octree.js +259 -0
- package/Source/Shaders/Voxels/VoxelFS.glsl +267 -0
- package/Source/Shaders/Voxels/VoxelFS.js +269 -0
- package/Source/Shaders/Voxels/VoxelUtils.glsl +12 -0
- package/Source/Shaders/Voxels/VoxelUtils.js +14 -0
- package/Source/Shaders/Voxels/VoxelVS.glsl +11 -0
- package/Source/Shaders/Voxels/VoxelVS.js +13 -0
- package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +30 -0
- package/Source/Shaders/Voxels/convertLocalToBoxUv.js +32 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +97 -0
- package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +99 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +193 -0
- package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +195 -0
- package/Source/ThirdParty/Workers/basis_transcoder.js +21 -0
- package/Source/ThirdParty/Workers/package.json +1 -0
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -0
- package/Source/ThirdParty/basis_transcoder.wasm +0 -0
- package/Source/ThirdParty/draco_decoder.wasm +0 -0
- package/Source/ThirdParty/google-earth-dbroot-parser.js +8337 -0
- package/Source/ThirdParty/wasm_splats_bg.wasm +0 -0
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Widget/CesiumWidget.css +119 -0
- package/Source/Widget/CesiumWidget.js +1606 -0
- package/Source/Widget/lighter.css +14 -0
- package/Source/Workers/combineGeometry.js +13 -0
- package/Source/Workers/createBoxGeometry.js +10 -0
- package/Source/Workers/createBoxOutlineGeometry.js +10 -0
- package/Source/Workers/createCircleGeometry.js +18 -0
- package/Source/Workers/createCircleOutlineGeometry.js +18 -0
- package/Source/Workers/createCoplanarPolygonGeometry.js +10 -0
- package/Source/Workers/createCoplanarPolygonOutlineGeometry.js +15 -0
- package/Source/Workers/createCorridorGeometry.js +12 -0
- package/Source/Workers/createCorridorOutlineGeometry.js +17 -0
- package/Source/Workers/createCylinderGeometry.js +10 -0
- package/Source/Workers/createCylinderOutlineGeometry.js +10 -0
- package/Source/Workers/createEllipseGeometry.js +14 -0
- package/Source/Workers/createEllipseOutlineGeometry.js +14 -0
- package/Source/Workers/createEllipsoidGeometry.js +10 -0
- package/Source/Workers/createEllipsoidOutlineGeometry.js +13 -0
- package/Source/Workers/createFrustumGeometry.js +10 -0
- package/Source/Workers/createFrustumOutlineGeometry.js +10 -0
- package/Source/Workers/createGeometry.js +78 -0
- package/Source/Workers/createGroundPolylineGeometry.js +16 -0
- package/Source/Workers/createPlaneGeometry.js +10 -0
- package/Source/Workers/createPlaneOutlineGeometry.js +10 -0
- package/Source/Workers/createPolygonGeometry.js +12 -0
- package/Source/Workers/createPolygonOutlineGeometry.js +12 -0
- package/Source/Workers/createPolylineGeometry.js +12 -0
- package/Source/Workers/createPolylineVolumeGeometry.js +17 -0
- package/Source/Workers/createPolylineVolumeOutlineGeometry.js +22 -0
- package/Source/Workers/createRectangleGeometry.js +14 -0
- package/Source/Workers/createRectangleOutlineGeometry.js +17 -0
- package/Source/Workers/createSimplePolylineGeometry.js +17 -0
- package/Source/Workers/createSphereGeometry.js +10 -0
- package/Source/Workers/createSphereOutlineGeometry.js +10 -0
- package/Source/Workers/createTaskProcessorWorker.js +113 -0
- package/Source/Workers/createVectorTileClampedPolylines.js +541 -0
- package/Source/Workers/createVectorTileGeometries.js +414 -0
- package/Source/Workers/createVectorTilePoints.js +81 -0
- package/Source/Workers/createVectorTilePolygons.js +412 -0
- package/Source/Workers/createVectorTilePolylines.js +210 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +651 -0
- package/Source/Workers/createVerticesFromHeightmap.js +53 -0
- package/Source/Workers/createVerticesFromQuantizedTerrainMesh.js +549 -0
- package/Source/Workers/createWallGeometry.js +12 -0
- package/Source/Workers/createWallOutlineGeometry.js +12 -0
- package/Source/Workers/decodeDraco.js +383 -0
- package/Source/Workers/decodeGoogleEarthEnterprisePacket.js +268 -0
- package/Source/Workers/decodeI3S.js +1652 -0
- package/Source/Workers/gaussianSplatSorter.js +34 -0
- package/Source/Workers/gaussianSplatTextureGenerator.js +39 -0
- package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
- package/Source/Workers/transcodeKTX2.js +308 -0
- package/Source/Workers/transferTypedArrayTest.js +16 -0
- package/Source/Workers/upsampleQuantizedTerrainMesh.js +681 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +46026 -0
- package/index.js +1227 -0
- package/package.json +79 -0
|
@@ -0,0 +1,4249 @@
|
|
|
1
|
+
import ArcType from "../Core/ArcType.js";
|
|
2
|
+
import AssociativeArray from "../Core/AssociativeArray.js";
|
|
3
|
+
import BoundingRectangle from "../Core/BoundingRectangle.js";
|
|
4
|
+
import buildModuleUrl from "../Core/buildModuleUrl.js";
|
|
5
|
+
import Cartesian2 from "../Core/Cartesian2.js";
|
|
6
|
+
import Cartesian3 from "../Core/Cartesian3.js";
|
|
7
|
+
import Cartographic from "../Core/Cartographic.js";
|
|
8
|
+
import ClockRange from "../Core/ClockRange.js";
|
|
9
|
+
import ClockStep from "../Core/ClockStep.js";
|
|
10
|
+
import clone from "../Core/clone.js";
|
|
11
|
+
import Color from "../Core/Color.js";
|
|
12
|
+
import createGuid from "../Core/createGuid.js";
|
|
13
|
+
import Credit from "../Core/Credit.js";
|
|
14
|
+
import Frozen from "../Core/Frozen.js";
|
|
15
|
+
import defer from "../Core/defer.js";
|
|
16
|
+
import defined from "../Core/defined.js";
|
|
17
|
+
import DeveloperError from "../Core/DeveloperError.js";
|
|
18
|
+
import Ellipsoid from "../Core/Ellipsoid.js";
|
|
19
|
+
import Event from "../Core/Event.js";
|
|
20
|
+
import getExtensionFromUri from "../Core/getExtensionFromUri.js";
|
|
21
|
+
import getFilenameFromUri from "../Core/getFilenameFromUri.js";
|
|
22
|
+
import getTimestamp from "../Core/getTimestamp.js";
|
|
23
|
+
import HeadingPitchRange from "../Core/HeadingPitchRange.js";
|
|
24
|
+
import HeadingPitchRoll from "../Core/HeadingPitchRoll.js";
|
|
25
|
+
import Iso8601 from "../Core/Iso8601.js";
|
|
26
|
+
import JulianDate from "../Core/JulianDate.js";
|
|
27
|
+
import CesiumMath from "../Core/Math.js";
|
|
28
|
+
import NearFarScalar from "../Core/NearFarScalar.js";
|
|
29
|
+
import objectToQuery from "../Core/objectToQuery.js";
|
|
30
|
+
import oneTimeWarning from "../Core/oneTimeWarning.js";
|
|
31
|
+
import PinBuilder from "../Core/PinBuilder.js";
|
|
32
|
+
import PolygonHierarchy from "../Core/PolygonHierarchy.js";
|
|
33
|
+
import queryToObject from "../Core/queryToObject.js";
|
|
34
|
+
import Rectangle from "../Core/Rectangle.js";
|
|
35
|
+
import Resource from "../Core/Resource.js";
|
|
36
|
+
import RuntimeError from "../Core/RuntimeError.js";
|
|
37
|
+
import TimeInterval from "../Core/TimeInterval.js";
|
|
38
|
+
import TimeIntervalCollection from "../Core/TimeIntervalCollection.js";
|
|
39
|
+
import HeightReference from "../Scene/HeightReference.js";
|
|
40
|
+
import HorizontalOrigin from "../Scene/HorizontalOrigin.js";
|
|
41
|
+
import LabelStyle from "../Scene/LabelStyle.js";
|
|
42
|
+
import SceneMode from "../Scene/SceneMode.js";
|
|
43
|
+
import Autolinker from "autolinker";
|
|
44
|
+
import Uri from "urijs";
|
|
45
|
+
import {
|
|
46
|
+
configure,
|
|
47
|
+
BlobReader,
|
|
48
|
+
Data64URIWriter,
|
|
49
|
+
TextWriter,
|
|
50
|
+
ZipReader,
|
|
51
|
+
} from "@zip.js/zip.js/lib/zip-core.js";
|
|
52
|
+
import getElement from "./getElement.js";
|
|
53
|
+
import BillboardGraphics from "./BillboardGraphics.js";
|
|
54
|
+
import CompositePositionProperty from "./CompositePositionProperty.js";
|
|
55
|
+
import DataSource from "./DataSource.js";
|
|
56
|
+
import DataSourceClock from "./DataSourceClock.js";
|
|
57
|
+
import Entity from "./Entity.js";
|
|
58
|
+
import EntityCluster from "./EntityCluster.js";
|
|
59
|
+
import EntityCollection from "./EntityCollection.js";
|
|
60
|
+
import KmlCamera from "./KmlCamera.js";
|
|
61
|
+
import KmlLookAt from "./KmlLookAt.js";
|
|
62
|
+
import KmlTour from "./KmlTour.js";
|
|
63
|
+
import KmlTourFlyTo from "./KmlTourFlyTo.js";
|
|
64
|
+
import KmlTourWait from "./KmlTourWait.js";
|
|
65
|
+
import LabelGraphics from "./LabelGraphics.js";
|
|
66
|
+
import PathGraphics from "./PathGraphics.js";
|
|
67
|
+
import PolygonGraphics from "./PolygonGraphics.js";
|
|
68
|
+
import PolylineGraphics from "./PolylineGraphics.js";
|
|
69
|
+
import PositionPropertyArray from "./PositionPropertyArray.js";
|
|
70
|
+
import RectangleGraphics from "./RectangleGraphics.js";
|
|
71
|
+
import ReferenceProperty from "./ReferenceProperty.js";
|
|
72
|
+
import SampledPositionProperty from "./SampledPositionProperty.js";
|
|
73
|
+
import ScaledPositionProperty from "./ScaledPositionProperty.js";
|
|
74
|
+
import TimeIntervalCollectionProperty from "./TimeIntervalCollectionProperty.js";
|
|
75
|
+
import WallGraphics from "./WallGraphics.js";
|
|
76
|
+
|
|
77
|
+
//This is by no means an exhaustive list of MIME types.
|
|
78
|
+
//The purpose of this list is to be able to accurately identify content embedded
|
|
79
|
+
//in KMZ files. Eventually, we can make this configurable by the end user so they can add
|
|
80
|
+
//there own content types if they have KMZ files that require it.
|
|
81
|
+
const MimeTypes = {
|
|
82
|
+
avi: "video/x-msvideo",
|
|
83
|
+
bmp: "image/bmp",
|
|
84
|
+
bz2: "application/x-bzip2",
|
|
85
|
+
chm: "application/vnd.ms-htmlhelp",
|
|
86
|
+
css: "text/css",
|
|
87
|
+
csv: "text/csv",
|
|
88
|
+
doc: "application/msword",
|
|
89
|
+
dvi: "application/x-dvi",
|
|
90
|
+
eps: "application/postscript",
|
|
91
|
+
flv: "video/x-flv",
|
|
92
|
+
gif: "image/gif",
|
|
93
|
+
gz: "application/x-gzip",
|
|
94
|
+
htm: "text/html",
|
|
95
|
+
html: "text/html",
|
|
96
|
+
ico: "image/vnd.microsoft.icon",
|
|
97
|
+
jnlp: "application/x-java-jnlp-file",
|
|
98
|
+
jpeg: "image/jpeg",
|
|
99
|
+
jpg: "image/jpeg",
|
|
100
|
+
m3u: "audio/x-mpegurl",
|
|
101
|
+
m4v: "video/mp4",
|
|
102
|
+
mathml: "application/mathml+xml",
|
|
103
|
+
mid: "audio/midi",
|
|
104
|
+
midi: "audio/midi",
|
|
105
|
+
mov: "video/quicktime",
|
|
106
|
+
mp3: "audio/mpeg",
|
|
107
|
+
mp4: "video/mp4",
|
|
108
|
+
mp4v: "video/mp4",
|
|
109
|
+
mpeg: "video/mpeg",
|
|
110
|
+
mpg: "video/mpeg",
|
|
111
|
+
odp: "application/vnd.oasis.opendocument.presentation",
|
|
112
|
+
ods: "application/vnd.oasis.opendocument.spreadsheet",
|
|
113
|
+
odt: "application/vnd.oasis.opendocument.text",
|
|
114
|
+
ogg: "application/ogg",
|
|
115
|
+
pdf: "application/pdf",
|
|
116
|
+
png: "image/png",
|
|
117
|
+
pps: "application/vnd.ms-powerpoint",
|
|
118
|
+
ppt: "application/vnd.ms-powerpoint",
|
|
119
|
+
ps: "application/postscript",
|
|
120
|
+
qt: "video/quicktime",
|
|
121
|
+
rdf: "application/rdf+xml",
|
|
122
|
+
rss: "application/rss+xml",
|
|
123
|
+
rtf: "application/rtf",
|
|
124
|
+
svg: "image/svg+xml",
|
|
125
|
+
swf: "application/x-shockwave-flash",
|
|
126
|
+
text: "text/plain",
|
|
127
|
+
tif: "image/tiff",
|
|
128
|
+
tiff: "image/tiff",
|
|
129
|
+
txt: "text/plain",
|
|
130
|
+
wav: "audio/x-wav",
|
|
131
|
+
wma: "audio/x-ms-wma",
|
|
132
|
+
wmv: "video/x-ms-wmv",
|
|
133
|
+
xml: "application/xml",
|
|
134
|
+
zip: "application/zip",
|
|
135
|
+
|
|
136
|
+
detectFromFilename: function (filename) {
|
|
137
|
+
let ext = filename.toLowerCase();
|
|
138
|
+
ext = getExtensionFromUri(ext);
|
|
139
|
+
return MimeTypes[ext];
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
let parser;
|
|
144
|
+
if (typeof DOMParser !== "undefined") {
|
|
145
|
+
parser = new DOMParser();
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const autolinker = new Autolinker({
|
|
149
|
+
stripPrefix: false,
|
|
150
|
+
email: false,
|
|
151
|
+
replaceFn: function (match) {
|
|
152
|
+
//Prevent matching of non-explicit urls.
|
|
153
|
+
//i.e. foo.id won't match but http://foo.id will
|
|
154
|
+
return match.urlMatchType === "scheme" || match.urlMatchType === "www";
|
|
155
|
+
},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const BILLBOARD_SIZE = 32;
|
|
159
|
+
|
|
160
|
+
const BILLBOARD_NEAR_DISTANCE = 2414016;
|
|
161
|
+
const BILLBOARD_NEAR_RATIO = 1.0;
|
|
162
|
+
const BILLBOARD_FAR_DISTANCE = 1.6093e7;
|
|
163
|
+
const BILLBOARD_FAR_RATIO = 0.1;
|
|
164
|
+
|
|
165
|
+
const kmlNamespaces = [
|
|
166
|
+
null,
|
|
167
|
+
undefined,
|
|
168
|
+
"http://www.opengis.net/kml/2.2",
|
|
169
|
+
"http://earth.google.com/kml/2.2",
|
|
170
|
+
"http://earth.google.com/kml/2.1",
|
|
171
|
+
"http://earth.google.com/kml/2.0",
|
|
172
|
+
];
|
|
173
|
+
const gxNamespaces = ["http://www.google.com/kml/ext/2.2"];
|
|
174
|
+
const atomNamespaces = ["http://www.w3.org/2005/Atom"];
|
|
175
|
+
const namespaces = {
|
|
176
|
+
kml: kmlNamespaces,
|
|
177
|
+
gx: gxNamespaces,
|
|
178
|
+
atom: atomNamespaces,
|
|
179
|
+
kmlgx: kmlNamespaces.concat(gxNamespaces),
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
// Ensure Specs/Data/KML/unsupported.kml is kept up to date with these supported types
|
|
183
|
+
const featureTypes = {
|
|
184
|
+
Document: processDocument,
|
|
185
|
+
Folder: processFolder,
|
|
186
|
+
Placemark: processPlacemark,
|
|
187
|
+
NetworkLink: processNetworkLink,
|
|
188
|
+
GroundOverlay: processGroundOverlay,
|
|
189
|
+
PhotoOverlay: processUnsupportedFeature,
|
|
190
|
+
ScreenOverlay: processScreenOverlay,
|
|
191
|
+
Tour: processTour,
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
function DeferredLoading(dataSource) {
|
|
195
|
+
this._dataSource = dataSource;
|
|
196
|
+
this._deferred = defer();
|
|
197
|
+
this._stack = [];
|
|
198
|
+
this._promises = [];
|
|
199
|
+
this._timeoutSet = false;
|
|
200
|
+
this._used = false;
|
|
201
|
+
|
|
202
|
+
this._started = 0;
|
|
203
|
+
this._timeThreshold = 1000; // Initial load is 1 second
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
Object.defineProperties(DeferredLoading.prototype, {
|
|
207
|
+
dataSource: {
|
|
208
|
+
get: function () {
|
|
209
|
+
return this._dataSource;
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
DeferredLoading.prototype.addNodes = function (nodes, processingData) {
|
|
215
|
+
this._stack.push({
|
|
216
|
+
nodes: nodes,
|
|
217
|
+
index: 0,
|
|
218
|
+
processingData: processingData,
|
|
219
|
+
});
|
|
220
|
+
this._used = true;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
DeferredLoading.prototype.addPromise = function (promise) {
|
|
224
|
+
this._promises.push(promise);
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
DeferredLoading.prototype.wait = function () {
|
|
228
|
+
// Case where we had a non-document/folder as the root
|
|
229
|
+
const deferred = this._deferred;
|
|
230
|
+
if (!this._used) {
|
|
231
|
+
deferred.resolve();
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
return Promise.all([deferred.promise, Promise.all(this._promises)]);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
DeferredLoading.prototype.process = function () {
|
|
238
|
+
const isFirstCall = this._stack.length === 1;
|
|
239
|
+
if (isFirstCall) {
|
|
240
|
+
this._started = KmlDataSource._getTimestamp();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return this._process(isFirstCall);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
DeferredLoading.prototype._giveUpTime = function () {
|
|
247
|
+
if (this._timeoutSet) {
|
|
248
|
+
// Timeout was already set so just return
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
this._timeoutSet = true;
|
|
253
|
+
this._timeThreshold = 50; // After the first load lower threshold to 0.5 seconds
|
|
254
|
+
const that = this;
|
|
255
|
+
setTimeout(function () {
|
|
256
|
+
that._timeoutSet = false;
|
|
257
|
+
that._started = KmlDataSource._getTimestamp();
|
|
258
|
+
that._process(true);
|
|
259
|
+
}, 0);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
DeferredLoading.prototype._nextNode = function () {
|
|
263
|
+
const stack = this._stack;
|
|
264
|
+
const top = stack[stack.length - 1];
|
|
265
|
+
const index = top.index;
|
|
266
|
+
const nodes = top.nodes;
|
|
267
|
+
if (index === nodes.length) {
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
++top.index;
|
|
271
|
+
|
|
272
|
+
return nodes[index];
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
DeferredLoading.prototype._pop = function () {
|
|
276
|
+
const stack = this._stack;
|
|
277
|
+
stack.pop();
|
|
278
|
+
|
|
279
|
+
// Return false if we are done
|
|
280
|
+
if (stack.length === 0) {
|
|
281
|
+
this._deferred.resolve();
|
|
282
|
+
return false;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
return true;
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
DeferredLoading.prototype._process = function (isFirstCall) {
|
|
289
|
+
const dataSource = this.dataSource;
|
|
290
|
+
const processingData = this._stack[this._stack.length - 1].processingData;
|
|
291
|
+
|
|
292
|
+
let child = this._nextNode();
|
|
293
|
+
while (defined(child)) {
|
|
294
|
+
const featureProcessor = featureTypes[child.localName];
|
|
295
|
+
if (
|
|
296
|
+
defined(featureProcessor) &&
|
|
297
|
+
(namespaces.kml.indexOf(child.namespaceURI) !== -1 ||
|
|
298
|
+
namespaces.gx.indexOf(child.namespaceURI) !== -1)
|
|
299
|
+
) {
|
|
300
|
+
featureProcessor(dataSource, child, processingData, this);
|
|
301
|
+
|
|
302
|
+
// Give up time and continue loading later
|
|
303
|
+
if (
|
|
304
|
+
this._timeoutSet ||
|
|
305
|
+
KmlDataSource._getTimestamp() > this._started + this._timeThreshold
|
|
306
|
+
) {
|
|
307
|
+
this._giveUpTime();
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
child = this._nextNode();
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// If we are a recursive call from a subfolder, just return so the parent folder can continue processing
|
|
316
|
+
// If we aren't then make another call to processNodes because there is stuff still left in the queue
|
|
317
|
+
if (this._pop() && isFirstCall) {
|
|
318
|
+
this._process(true);
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
function isZipFile(blob) {
|
|
323
|
+
const magicBlob = blob.slice(0, Math.min(4, blob.size));
|
|
324
|
+
const deferred = defer();
|
|
325
|
+
const reader = new FileReader();
|
|
326
|
+
reader.addEventListener("load", function () {
|
|
327
|
+
deferred.resolve(
|
|
328
|
+
new DataView(reader.result).getUint32(0, false) === 0x504b0304,
|
|
329
|
+
);
|
|
330
|
+
});
|
|
331
|
+
reader.addEventListener("error", function () {
|
|
332
|
+
deferred.reject(reader.error);
|
|
333
|
+
});
|
|
334
|
+
reader.readAsArrayBuffer(magicBlob);
|
|
335
|
+
return deferred.promise;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function readBlobAsText(blob) {
|
|
339
|
+
const deferred = defer();
|
|
340
|
+
const reader = new FileReader();
|
|
341
|
+
reader.addEventListener("load", function () {
|
|
342
|
+
deferred.resolve(reader.result);
|
|
343
|
+
});
|
|
344
|
+
reader.addEventListener("error", function () {
|
|
345
|
+
deferred.reject(reader.error);
|
|
346
|
+
});
|
|
347
|
+
reader.readAsText(blob);
|
|
348
|
+
return deferred.promise;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function insertNamespaces(text) {
|
|
352
|
+
const namespaceMap = {
|
|
353
|
+
xsi: "http://www.w3.org/2001/XMLSchema-instance",
|
|
354
|
+
};
|
|
355
|
+
let firstPart, lastPart, reg, declaration;
|
|
356
|
+
|
|
357
|
+
for (const key in namespaceMap) {
|
|
358
|
+
if (namespaceMap.hasOwnProperty(key)) {
|
|
359
|
+
reg = RegExp(`[< ]${key}:`);
|
|
360
|
+
declaration = `xmlns:${key}=`;
|
|
361
|
+
if (reg.test(text) && text.indexOf(declaration) === -1) {
|
|
362
|
+
if (!defined(firstPart)) {
|
|
363
|
+
firstPart = text.substr(0, text.indexOf("<kml") + 4);
|
|
364
|
+
lastPart = text.substr(firstPart.length);
|
|
365
|
+
}
|
|
366
|
+
firstPart += ` ${declaration}"${namespaceMap[key]}"`;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if (defined(firstPart)) {
|
|
372
|
+
text = firstPart + lastPart;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return text;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function removeDuplicateNamespaces(text) {
|
|
379
|
+
let index = text.indexOf("xmlns:");
|
|
380
|
+
const endDeclaration = text.indexOf(">", index);
|
|
381
|
+
let namespace, startIndex, endIndex;
|
|
382
|
+
|
|
383
|
+
while (index !== -1 && index < endDeclaration) {
|
|
384
|
+
namespace = text.slice(index, text.indexOf('"', index));
|
|
385
|
+
startIndex = index;
|
|
386
|
+
index = text.indexOf(namespace, index + 1);
|
|
387
|
+
if (index !== -1) {
|
|
388
|
+
endIndex = text.indexOf('"', text.indexOf('"', index) + 1);
|
|
389
|
+
text = text.slice(0, index - 1) + text.slice(endIndex + 1, text.length);
|
|
390
|
+
index = text.indexOf("xmlns:", startIndex - 1);
|
|
391
|
+
} else {
|
|
392
|
+
index = text.indexOf("xmlns:", startIndex + 1);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return text;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
async function loadXmlFromZip(entry, uriResolver) {
|
|
400
|
+
let text = await entry.getData(new TextWriter());
|
|
401
|
+
text = insertNamespaces(text);
|
|
402
|
+
text = removeDuplicateNamespaces(text);
|
|
403
|
+
uriResolver.kml = parser.parseFromString(text, "application/xml");
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
async function loadDataUriFromZip(entry, uriResolver) {
|
|
407
|
+
const mimeType =
|
|
408
|
+
MimeTypes.detectFromFilename(entry.filename) ?? "application/octet-stream";
|
|
409
|
+
const dataUri = await entry.getData(new Data64URIWriter(mimeType));
|
|
410
|
+
uriResolver[entry.filename] = dataUri;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function embedDataUris(div, elementType, attributeName, uriResolver) {
|
|
414
|
+
const keys = uriResolver.keys;
|
|
415
|
+
const baseUri = new Uri(".");
|
|
416
|
+
const elements = div.querySelectorAll(elementType);
|
|
417
|
+
for (let i = 0; i < elements.length; i++) {
|
|
418
|
+
const element = elements[i];
|
|
419
|
+
const value = element.getAttribute(attributeName);
|
|
420
|
+
if (defined(value)) {
|
|
421
|
+
const relativeUri = new Uri(value);
|
|
422
|
+
const uri = relativeUri.absoluteTo(baseUri).toString();
|
|
423
|
+
const index = keys.indexOf(uri);
|
|
424
|
+
if (index !== -1) {
|
|
425
|
+
const key = keys[index];
|
|
426
|
+
element.setAttribute(attributeName, uriResolver[key]);
|
|
427
|
+
if (elementType === "a" && element.getAttribute("download") === null) {
|
|
428
|
+
element.setAttribute("download", key);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function applyBasePath(div, elementType, attributeName, sourceResource) {
|
|
436
|
+
const elements = div.querySelectorAll(elementType);
|
|
437
|
+
for (let i = 0; i < elements.length; i++) {
|
|
438
|
+
const element = elements[i];
|
|
439
|
+
const value = element.getAttribute(attributeName);
|
|
440
|
+
const resource = resolveHref(value, sourceResource);
|
|
441
|
+
if (defined(resource)) {
|
|
442
|
+
element.setAttribute(attributeName, resource.url);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// an optional context is passed to allow for some malformed kmls (those with multiple geometries with same ids) to still parse
|
|
448
|
+
// correctly, as they do in Google Earth.
|
|
449
|
+
function createEntity(node, entityCollection, context) {
|
|
450
|
+
let id = queryStringAttribute(node, "id");
|
|
451
|
+
id = defined(id) && id.length !== 0 ? id : createGuid();
|
|
452
|
+
if (defined(context)) {
|
|
453
|
+
id = context + id;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
// If we have a duplicate ID just generate one.
|
|
457
|
+
// This isn't valid KML but Google Earth handles this case.
|
|
458
|
+
let entity = entityCollection.getById(id);
|
|
459
|
+
if (defined(entity)) {
|
|
460
|
+
id = createGuid();
|
|
461
|
+
if (defined(context)) {
|
|
462
|
+
id = context + id;
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
entity = entityCollection.add(new Entity({ id: id }));
|
|
467
|
+
if (!defined(entity.kml)) {
|
|
468
|
+
entity.addProperty("kml");
|
|
469
|
+
entity.kml = new KmlFeatureData();
|
|
470
|
+
}
|
|
471
|
+
return entity;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
function isExtrudable(altitudeMode, gxAltitudeMode) {
|
|
475
|
+
return (
|
|
476
|
+
altitudeMode === "absolute" ||
|
|
477
|
+
altitudeMode === "relativeToGround" ||
|
|
478
|
+
gxAltitudeMode === "relativeToSeaFloor"
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function readCoordinate(value, ellipsoid) {
|
|
483
|
+
//Google Earth treats empty or missing coordinates as 0.
|
|
484
|
+
if (!defined(value)) {
|
|
485
|
+
return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
const digits = value.match(/[^\s,\n]+/g);
|
|
489
|
+
if (!defined(digits)) {
|
|
490
|
+
return Cartesian3.fromDegrees(0, 0, 0, ellipsoid);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
let longitude = parseFloat(digits[0]);
|
|
494
|
+
let latitude = parseFloat(digits[1]);
|
|
495
|
+
let height = parseFloat(digits[2]);
|
|
496
|
+
|
|
497
|
+
longitude = isNaN(longitude) ? 0.0 : longitude;
|
|
498
|
+
latitude = isNaN(latitude) ? 0.0 : latitude;
|
|
499
|
+
height = isNaN(height) ? 0.0 : height;
|
|
500
|
+
|
|
501
|
+
return Cartesian3.fromDegrees(longitude, latitude, height, ellipsoid);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
function readCoordinates(element, ellipsoid) {
|
|
505
|
+
if (!defined(element)) {
|
|
506
|
+
return undefined;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
const tuples = element.textContent.match(/[^\s\n]+/g);
|
|
510
|
+
if (!defined(tuples)) {
|
|
511
|
+
return undefined;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
const length = tuples.length;
|
|
515
|
+
const result = new Array(length);
|
|
516
|
+
let resultIndex = 0;
|
|
517
|
+
for (let i = 0; i < length; i++) {
|
|
518
|
+
result[resultIndex++] = readCoordinate(tuples[i], ellipsoid);
|
|
519
|
+
}
|
|
520
|
+
return result;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
function queryNumericAttribute(node, attributeName) {
|
|
524
|
+
if (!defined(node)) {
|
|
525
|
+
return undefined;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
const value = node.getAttribute(attributeName);
|
|
529
|
+
if (value !== null) {
|
|
530
|
+
const result = parseFloat(value);
|
|
531
|
+
return !isNaN(result) ? result : undefined;
|
|
532
|
+
}
|
|
533
|
+
return undefined;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
function queryStringAttribute(node, attributeName) {
|
|
537
|
+
if (!defined(node)) {
|
|
538
|
+
return undefined;
|
|
539
|
+
}
|
|
540
|
+
const value = node.getAttribute(attributeName);
|
|
541
|
+
return value !== null ? value : undefined;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
function queryFirstNode(node, tagName, namespace) {
|
|
545
|
+
if (!defined(node)) {
|
|
546
|
+
return undefined;
|
|
547
|
+
}
|
|
548
|
+
const childNodes = node.childNodes;
|
|
549
|
+
const length = childNodes.length;
|
|
550
|
+
for (let q = 0; q < length; q++) {
|
|
551
|
+
const child = childNodes[q];
|
|
552
|
+
if (
|
|
553
|
+
child.localName === tagName &&
|
|
554
|
+
namespace.indexOf(child.namespaceURI) !== -1
|
|
555
|
+
) {
|
|
556
|
+
return child;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
return undefined;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
function queryNodes(node, tagName, namespace) {
|
|
563
|
+
if (!defined(node)) {
|
|
564
|
+
return undefined;
|
|
565
|
+
}
|
|
566
|
+
const result = [];
|
|
567
|
+
const childNodes = node.getElementsByTagNameNS("*", tagName);
|
|
568
|
+
const length = childNodes.length;
|
|
569
|
+
for (let q = 0; q < length; q++) {
|
|
570
|
+
const child = childNodes[q];
|
|
571
|
+
if (
|
|
572
|
+
child.localName === tagName &&
|
|
573
|
+
namespace.indexOf(child.namespaceURI) !== -1
|
|
574
|
+
) {
|
|
575
|
+
result.push(child);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
return result;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function queryChildNodes(node, tagName, namespace) {
|
|
582
|
+
if (!defined(node)) {
|
|
583
|
+
return [];
|
|
584
|
+
}
|
|
585
|
+
const result = [];
|
|
586
|
+
const childNodes = node.childNodes;
|
|
587
|
+
const length = childNodes.length;
|
|
588
|
+
for (let q = 0; q < length; q++) {
|
|
589
|
+
const child = childNodes[q];
|
|
590
|
+
if (
|
|
591
|
+
child.localName === tagName &&
|
|
592
|
+
namespace.indexOf(child.namespaceURI) !== -1
|
|
593
|
+
) {
|
|
594
|
+
result.push(child);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
return result;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function queryNumericValue(node, tagName, namespace) {
|
|
601
|
+
const resultNode = queryFirstNode(node, tagName, namespace);
|
|
602
|
+
if (defined(resultNode)) {
|
|
603
|
+
const result = parseFloat(resultNode.textContent);
|
|
604
|
+
return !isNaN(result) ? result : undefined;
|
|
605
|
+
}
|
|
606
|
+
return undefined;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
function queryStringValue(node, tagName, namespace) {
|
|
610
|
+
const result = queryFirstNode(node, tagName, namespace);
|
|
611
|
+
if (defined(result)) {
|
|
612
|
+
return result.textContent.trim();
|
|
613
|
+
}
|
|
614
|
+
return undefined;
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
function queryBooleanValue(node, tagName, namespace) {
|
|
618
|
+
const result = queryFirstNode(node, tagName, namespace);
|
|
619
|
+
if (defined(result)) {
|
|
620
|
+
const value = result.textContent.trim();
|
|
621
|
+
return value === "1" || /^true$/i.test(value);
|
|
622
|
+
}
|
|
623
|
+
return undefined;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function resolveHref(href, sourceResource, uriResolver) {
|
|
627
|
+
if (!defined(href)) {
|
|
628
|
+
return undefined;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
let resource;
|
|
632
|
+
if (defined(uriResolver)) {
|
|
633
|
+
// To resolve issues with KML sources defined in Windows style paths.
|
|
634
|
+
href = href.replace(/\\/g, "/");
|
|
635
|
+
let blob = uriResolver[href];
|
|
636
|
+
if (defined(blob)) {
|
|
637
|
+
resource = new Resource({
|
|
638
|
+
url: blob,
|
|
639
|
+
});
|
|
640
|
+
} else {
|
|
641
|
+
// Needed for multiple levels of KML files in a KMZ
|
|
642
|
+
const baseUri = new Uri(sourceResource.getUrlComponent());
|
|
643
|
+
const uri = new Uri(href);
|
|
644
|
+
blob = uriResolver[uri.absoluteTo(baseUri)];
|
|
645
|
+
if (defined(blob)) {
|
|
646
|
+
resource = new Resource({
|
|
647
|
+
url: blob,
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
if (!defined(resource)) {
|
|
654
|
+
resource = sourceResource.getDerivedResource({
|
|
655
|
+
url: href,
|
|
656
|
+
});
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return resource;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
const colorOptions = {
|
|
663
|
+
maximumRed: undefined,
|
|
664
|
+
red: undefined,
|
|
665
|
+
maximumGreen: undefined,
|
|
666
|
+
green: undefined,
|
|
667
|
+
maximumBlue: undefined,
|
|
668
|
+
blue: undefined,
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
function parseColorString(value, isRandom) {
|
|
672
|
+
if (!defined(value) || /^\s*$/gm.test(value)) {
|
|
673
|
+
return undefined;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
if (value[0] === "#") {
|
|
677
|
+
value = value.substring(1);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
const alpha = parseInt(value.substring(0, 2), 16) / 255.0;
|
|
681
|
+
const blue = parseInt(value.substring(2, 4), 16) / 255.0;
|
|
682
|
+
const green = parseInt(value.substring(4, 6), 16) / 255.0;
|
|
683
|
+
const red = parseInt(value.substring(6, 8), 16) / 255.0;
|
|
684
|
+
|
|
685
|
+
if (!isRandom) {
|
|
686
|
+
return new Color(red, green, blue, alpha);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
if (red > 0) {
|
|
690
|
+
colorOptions.maximumRed = red;
|
|
691
|
+
colorOptions.red = undefined;
|
|
692
|
+
} else {
|
|
693
|
+
colorOptions.maximumRed = undefined;
|
|
694
|
+
colorOptions.red = 0;
|
|
695
|
+
}
|
|
696
|
+
if (green > 0) {
|
|
697
|
+
colorOptions.maximumGreen = green;
|
|
698
|
+
colorOptions.green = undefined;
|
|
699
|
+
} else {
|
|
700
|
+
colorOptions.maximumGreen = undefined;
|
|
701
|
+
colorOptions.green = 0;
|
|
702
|
+
}
|
|
703
|
+
if (blue > 0) {
|
|
704
|
+
colorOptions.maximumBlue = blue;
|
|
705
|
+
colorOptions.blue = undefined;
|
|
706
|
+
} else {
|
|
707
|
+
colorOptions.maximumBlue = undefined;
|
|
708
|
+
colorOptions.blue = 0;
|
|
709
|
+
}
|
|
710
|
+
colorOptions.alpha = alpha;
|
|
711
|
+
return Color.fromRandom(colorOptions);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
function queryColorValue(node, tagName, namespace) {
|
|
715
|
+
const value = queryStringValue(node, tagName, namespace);
|
|
716
|
+
if (!defined(value)) {
|
|
717
|
+
return undefined;
|
|
718
|
+
}
|
|
719
|
+
return parseColorString(
|
|
720
|
+
value,
|
|
721
|
+
queryStringValue(node, "colorMode", namespace) === "random",
|
|
722
|
+
);
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
function processTimeStamp(featureNode) {
|
|
726
|
+
const node = queryFirstNode(featureNode, "TimeStamp", namespaces.kmlgx);
|
|
727
|
+
const whenString = queryStringValue(node, "when", namespaces.kmlgx);
|
|
728
|
+
|
|
729
|
+
if (!defined(node) || !defined(whenString) || whenString.length === 0) {
|
|
730
|
+
return undefined;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
//According to the KML spec, a TimeStamp represents a "single moment in time"
|
|
734
|
+
//However, since Cesium animates much differently than Google Earth, that doesn't
|
|
735
|
+
//Make much sense here. Instead, we use the TimeStamp as the moment the feature
|
|
736
|
+
//comes into existence. This works much better and gives a similar feel to
|
|
737
|
+
//GE's experience.
|
|
738
|
+
const when = JulianDate.fromIso8601(whenString);
|
|
739
|
+
const result = new TimeIntervalCollection();
|
|
740
|
+
result.addInterval(
|
|
741
|
+
new TimeInterval({
|
|
742
|
+
start: when,
|
|
743
|
+
stop: Iso8601.MAXIMUM_VALUE,
|
|
744
|
+
}),
|
|
745
|
+
);
|
|
746
|
+
return result;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function processTimeSpan(featureNode) {
|
|
750
|
+
const node = queryFirstNode(featureNode, "TimeSpan", namespaces.kmlgx);
|
|
751
|
+
if (!defined(node)) {
|
|
752
|
+
return undefined;
|
|
753
|
+
}
|
|
754
|
+
let result;
|
|
755
|
+
|
|
756
|
+
const beginNode = queryFirstNode(node, "begin", namespaces.kmlgx);
|
|
757
|
+
let beginDate = defined(beginNode)
|
|
758
|
+
? JulianDate.fromIso8601(beginNode.textContent)
|
|
759
|
+
: undefined;
|
|
760
|
+
|
|
761
|
+
const endNode = queryFirstNode(node, "end", namespaces.kmlgx);
|
|
762
|
+
let endDate = defined(endNode)
|
|
763
|
+
? JulianDate.fromIso8601(endNode.textContent)
|
|
764
|
+
: undefined;
|
|
765
|
+
|
|
766
|
+
if (defined(beginDate) && defined(endDate)) {
|
|
767
|
+
if (JulianDate.lessThan(endDate, beginDate)) {
|
|
768
|
+
const tmp = beginDate;
|
|
769
|
+
beginDate = endDate;
|
|
770
|
+
endDate = tmp;
|
|
771
|
+
}
|
|
772
|
+
result = new TimeIntervalCollection();
|
|
773
|
+
result.addInterval(
|
|
774
|
+
new TimeInterval({
|
|
775
|
+
start: beginDate,
|
|
776
|
+
stop: endDate,
|
|
777
|
+
}),
|
|
778
|
+
);
|
|
779
|
+
} else if (defined(beginDate)) {
|
|
780
|
+
result = new TimeIntervalCollection();
|
|
781
|
+
result.addInterval(
|
|
782
|
+
new TimeInterval({
|
|
783
|
+
start: beginDate,
|
|
784
|
+
stop: Iso8601.MAXIMUM_VALUE,
|
|
785
|
+
}),
|
|
786
|
+
);
|
|
787
|
+
} else if (defined(endDate)) {
|
|
788
|
+
result = new TimeIntervalCollection();
|
|
789
|
+
result.addInterval(
|
|
790
|
+
new TimeInterval({
|
|
791
|
+
start: Iso8601.MINIMUM_VALUE,
|
|
792
|
+
stop: endDate,
|
|
793
|
+
}),
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return result;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function createDefaultBillboard() {
|
|
801
|
+
const billboard = new BillboardGraphics();
|
|
802
|
+
billboard.width = BILLBOARD_SIZE;
|
|
803
|
+
billboard.height = BILLBOARD_SIZE;
|
|
804
|
+
billboard.scaleByDistance = new NearFarScalar(
|
|
805
|
+
BILLBOARD_NEAR_DISTANCE,
|
|
806
|
+
BILLBOARD_NEAR_RATIO,
|
|
807
|
+
BILLBOARD_FAR_DISTANCE,
|
|
808
|
+
BILLBOARD_FAR_RATIO,
|
|
809
|
+
);
|
|
810
|
+
billboard.pixelOffsetScaleByDistance = new NearFarScalar(
|
|
811
|
+
BILLBOARD_NEAR_DISTANCE,
|
|
812
|
+
BILLBOARD_NEAR_RATIO,
|
|
813
|
+
BILLBOARD_FAR_DISTANCE,
|
|
814
|
+
BILLBOARD_FAR_RATIO,
|
|
815
|
+
);
|
|
816
|
+
return billboard;
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
function createDefaultPolygon() {
|
|
820
|
+
const polygon = new PolygonGraphics();
|
|
821
|
+
polygon.outline = true;
|
|
822
|
+
polygon.outlineColor = Color.WHITE;
|
|
823
|
+
return polygon;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function createDefaultLabel() {
|
|
827
|
+
const label = new LabelGraphics();
|
|
828
|
+
label.translucencyByDistance = new NearFarScalar(3000000, 1.0, 5000000, 0.0);
|
|
829
|
+
label.pixelOffset = new Cartesian2(17, 0);
|
|
830
|
+
label.horizontalOrigin = HorizontalOrigin.LEFT;
|
|
831
|
+
label.font = "16px sans-serif";
|
|
832
|
+
label.style = LabelStyle.FILL_AND_OUTLINE;
|
|
833
|
+
return label;
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
function getIconHref(
|
|
837
|
+
iconNode,
|
|
838
|
+
dataSource,
|
|
839
|
+
sourceResource,
|
|
840
|
+
uriResolver,
|
|
841
|
+
canRefresh,
|
|
842
|
+
) {
|
|
843
|
+
let href = queryStringValue(iconNode, "href", namespaces.kml);
|
|
844
|
+
if (!defined(href) || href.length === 0) {
|
|
845
|
+
return undefined;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
if (href.indexOf("root://icons/palette-") === 0) {
|
|
849
|
+
const palette = href.charAt(21);
|
|
850
|
+
|
|
851
|
+
// Get the icon number
|
|
852
|
+
let x = queryNumericValue(iconNode, "x", namespaces.gx) ?? 0;
|
|
853
|
+
let y = queryNumericValue(iconNode, "y", namespaces.gx) ?? 0;
|
|
854
|
+
x = Math.min(x / 32, 7);
|
|
855
|
+
y = 7 - Math.min(y / 32, 7);
|
|
856
|
+
const iconNum = 8 * y + x;
|
|
857
|
+
|
|
858
|
+
href = `https://maps.google.com/mapfiles/kml/pal${palette}/icon${iconNum}.png`;
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
const hrefResource = resolveHref(href, sourceResource, uriResolver);
|
|
862
|
+
|
|
863
|
+
if (canRefresh) {
|
|
864
|
+
const refreshMode = queryStringValue(
|
|
865
|
+
iconNode,
|
|
866
|
+
"refreshMode",
|
|
867
|
+
namespaces.kml,
|
|
868
|
+
);
|
|
869
|
+
const viewRefreshMode = queryStringValue(
|
|
870
|
+
iconNode,
|
|
871
|
+
"viewRefreshMode",
|
|
872
|
+
namespaces.kml,
|
|
873
|
+
);
|
|
874
|
+
if (refreshMode === "onInterval" || refreshMode === "onExpire") {
|
|
875
|
+
oneTimeWarning(
|
|
876
|
+
`kml-refreshMode-${refreshMode}`,
|
|
877
|
+
`KML - Unsupported Icon refreshMode: ${refreshMode}`,
|
|
878
|
+
);
|
|
879
|
+
} else if (viewRefreshMode === "onStop" || viewRefreshMode === "onRegion") {
|
|
880
|
+
oneTimeWarning(
|
|
881
|
+
`kml-refreshMode-${viewRefreshMode}`,
|
|
882
|
+
`KML - Unsupported Icon viewRefreshMode: ${viewRefreshMode}`,
|
|
883
|
+
);
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
const viewBoundScale =
|
|
887
|
+
queryStringValue(iconNode, "viewBoundScale", namespaces.kml) ?? 1.0;
|
|
888
|
+
const defaultViewFormat =
|
|
889
|
+
viewRefreshMode === "onStop"
|
|
890
|
+
? "BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]"
|
|
891
|
+
: "";
|
|
892
|
+
const viewFormat =
|
|
893
|
+
queryStringValue(iconNode, "viewFormat", namespaces.kml) ??
|
|
894
|
+
defaultViewFormat;
|
|
895
|
+
const httpQuery = queryStringValue(iconNode, "httpQuery", namespaces.kml);
|
|
896
|
+
if (defined(viewFormat)) {
|
|
897
|
+
hrefResource.setQueryParameters(queryToObject(cleanupString(viewFormat)));
|
|
898
|
+
}
|
|
899
|
+
if (defined(httpQuery)) {
|
|
900
|
+
hrefResource.setQueryParameters(queryToObject(cleanupString(httpQuery)));
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
904
|
+
processNetworkLinkQueryString(
|
|
905
|
+
hrefResource,
|
|
906
|
+
dataSource.camera,
|
|
907
|
+
dataSource.canvas,
|
|
908
|
+
viewBoundScale,
|
|
909
|
+
dataSource._lastCameraView.bbox,
|
|
910
|
+
ellipsoid,
|
|
911
|
+
);
|
|
912
|
+
|
|
913
|
+
return hrefResource;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
return hrefResource;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
function processBillboardIcon(
|
|
920
|
+
dataSource,
|
|
921
|
+
node,
|
|
922
|
+
targetEntity,
|
|
923
|
+
sourceResource,
|
|
924
|
+
uriResolver,
|
|
925
|
+
) {
|
|
926
|
+
let scale = queryNumericValue(node, "scale", namespaces.kml);
|
|
927
|
+
const heading = queryNumericValue(node, "heading", namespaces.kml);
|
|
928
|
+
const color = queryColorValue(node, "color", namespaces.kml);
|
|
929
|
+
|
|
930
|
+
const iconNode = queryFirstNode(node, "Icon", namespaces.kml);
|
|
931
|
+
let icon = getIconHref(
|
|
932
|
+
iconNode,
|
|
933
|
+
dataSource,
|
|
934
|
+
sourceResource,
|
|
935
|
+
uriResolver,
|
|
936
|
+
false,
|
|
937
|
+
);
|
|
938
|
+
|
|
939
|
+
// If icon tags are present but blank, we do not want to show an icon
|
|
940
|
+
if (defined(iconNode) && !defined(icon)) {
|
|
941
|
+
icon = false;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
const x = queryNumericValue(iconNode, "x", namespaces.gx);
|
|
945
|
+
const y = queryNumericValue(iconNode, "y", namespaces.gx);
|
|
946
|
+
const w = queryNumericValue(iconNode, "w", namespaces.gx);
|
|
947
|
+
const h = queryNumericValue(iconNode, "h", namespaces.gx);
|
|
948
|
+
|
|
949
|
+
const hotSpotNode = queryFirstNode(node, "hotSpot", namespaces.kml);
|
|
950
|
+
const hotSpotX = queryNumericAttribute(hotSpotNode, "x");
|
|
951
|
+
const hotSpotY = queryNumericAttribute(hotSpotNode, "y");
|
|
952
|
+
const hotSpotXUnit = queryStringAttribute(hotSpotNode, "xunits");
|
|
953
|
+
const hotSpotYUnit = queryStringAttribute(hotSpotNode, "yunits");
|
|
954
|
+
|
|
955
|
+
let billboard = targetEntity.billboard;
|
|
956
|
+
if (!defined(billboard)) {
|
|
957
|
+
billboard = createDefaultBillboard();
|
|
958
|
+
targetEntity.billboard = billboard;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
billboard.image = icon;
|
|
962
|
+
billboard.scale = scale;
|
|
963
|
+
billboard.color = color;
|
|
964
|
+
|
|
965
|
+
if (defined(x) || defined(y) || defined(w) || defined(h)) {
|
|
966
|
+
billboard.imageSubRegion = new BoundingRectangle(x, y, w, h);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
//GE treats a heading of zero as no heading
|
|
970
|
+
//You can still point north using a 360 degree angle (or any multiple of 360)
|
|
971
|
+
if (defined(heading) && heading !== 0) {
|
|
972
|
+
billboard.rotation = CesiumMath.toRadians(-heading);
|
|
973
|
+
billboard.alignedAxis = Cartesian3.UNIT_Z;
|
|
974
|
+
}
|
|
975
|
+
|
|
976
|
+
//Hotpot is the KML equivalent of pixel offset
|
|
977
|
+
//The hotspot origin is the lower left, but we leave
|
|
978
|
+
//our billboard origin at the center and simply
|
|
979
|
+
//modify the pixel offset to take this into account
|
|
980
|
+
scale = scale ?? 1.0;
|
|
981
|
+
|
|
982
|
+
let xOffset;
|
|
983
|
+
let yOffset;
|
|
984
|
+
if (defined(hotSpotX)) {
|
|
985
|
+
if (hotSpotXUnit === "pixels") {
|
|
986
|
+
xOffset = -hotSpotX * scale;
|
|
987
|
+
} else if (hotSpotXUnit === "insetPixels") {
|
|
988
|
+
xOffset = (hotSpotX - BILLBOARD_SIZE) * scale;
|
|
989
|
+
} else if (hotSpotXUnit === "fraction") {
|
|
990
|
+
xOffset = -hotSpotX * BILLBOARD_SIZE * scale;
|
|
991
|
+
}
|
|
992
|
+
xOffset += BILLBOARD_SIZE * 0.5 * scale;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
if (defined(hotSpotY)) {
|
|
996
|
+
if (hotSpotYUnit === "pixels") {
|
|
997
|
+
yOffset = hotSpotY * scale;
|
|
998
|
+
} else if (hotSpotYUnit === "insetPixels") {
|
|
999
|
+
yOffset = (-hotSpotY + BILLBOARD_SIZE) * scale;
|
|
1000
|
+
} else if (hotSpotYUnit === "fraction") {
|
|
1001
|
+
yOffset = hotSpotY * BILLBOARD_SIZE * scale;
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
yOffset -= BILLBOARD_SIZE * 0.5 * scale;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (defined(xOffset) || defined(yOffset)) {
|
|
1008
|
+
billboard.pixelOffset = new Cartesian2(xOffset, yOffset);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
function applyStyle(
|
|
1013
|
+
dataSource,
|
|
1014
|
+
styleNode,
|
|
1015
|
+
targetEntity,
|
|
1016
|
+
sourceResource,
|
|
1017
|
+
uriResolver,
|
|
1018
|
+
) {
|
|
1019
|
+
for (let i = 0, len = styleNode.childNodes.length; i < len; i++) {
|
|
1020
|
+
const node = styleNode.childNodes.item(i);
|
|
1021
|
+
if (node.localName === "IconStyle") {
|
|
1022
|
+
processBillboardIcon(
|
|
1023
|
+
dataSource,
|
|
1024
|
+
node,
|
|
1025
|
+
targetEntity,
|
|
1026
|
+
sourceResource,
|
|
1027
|
+
uriResolver,
|
|
1028
|
+
);
|
|
1029
|
+
} else if (node.localName === "LabelStyle") {
|
|
1030
|
+
let label = targetEntity.label;
|
|
1031
|
+
if (!defined(label)) {
|
|
1032
|
+
label = createDefaultLabel();
|
|
1033
|
+
targetEntity.label = label;
|
|
1034
|
+
}
|
|
1035
|
+
label.scale =
|
|
1036
|
+
queryNumericValue(node, "scale", namespaces.kml) ?? label.scale;
|
|
1037
|
+
label.fillColor =
|
|
1038
|
+
queryColorValue(node, "color", namespaces.kml) ?? label.fillColor;
|
|
1039
|
+
label.text = targetEntity.name;
|
|
1040
|
+
} else if (node.localName === "LineStyle") {
|
|
1041
|
+
let polyline = targetEntity.polyline;
|
|
1042
|
+
if (!defined(polyline)) {
|
|
1043
|
+
polyline = new PolylineGraphics();
|
|
1044
|
+
targetEntity.polyline = polyline;
|
|
1045
|
+
}
|
|
1046
|
+
polyline.width = queryNumericValue(node, "width", namespaces.kml);
|
|
1047
|
+
polyline.material = queryColorValue(node, "color", namespaces.kml);
|
|
1048
|
+
if (defined(queryColorValue(node, "outerColor", namespaces.gx))) {
|
|
1049
|
+
oneTimeWarning(
|
|
1050
|
+
"kml-gx:outerColor",
|
|
1051
|
+
"KML - gx:outerColor is not supported in a LineStyle",
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1054
|
+
if (defined(queryNumericValue(node, "outerWidth", namespaces.gx))) {
|
|
1055
|
+
oneTimeWarning(
|
|
1056
|
+
"kml-gx:outerWidth",
|
|
1057
|
+
"KML - gx:outerWidth is not supported in a LineStyle",
|
|
1058
|
+
);
|
|
1059
|
+
}
|
|
1060
|
+
if (defined(queryNumericValue(node, "physicalWidth", namespaces.gx))) {
|
|
1061
|
+
oneTimeWarning(
|
|
1062
|
+
"kml-gx:physicalWidth",
|
|
1063
|
+
"KML - gx:physicalWidth is not supported in a LineStyle",
|
|
1064
|
+
);
|
|
1065
|
+
}
|
|
1066
|
+
if (defined(queryBooleanValue(node, "labelVisibility", namespaces.gx))) {
|
|
1067
|
+
oneTimeWarning(
|
|
1068
|
+
"kml-gx:labelVisibility",
|
|
1069
|
+
"KML - gx:labelVisibility is not supported in a LineStyle",
|
|
1070
|
+
);
|
|
1071
|
+
}
|
|
1072
|
+
} else if (node.localName === "PolyStyle") {
|
|
1073
|
+
let polygon = targetEntity.polygon;
|
|
1074
|
+
if (!defined(polygon)) {
|
|
1075
|
+
polygon = createDefaultPolygon();
|
|
1076
|
+
targetEntity.polygon = polygon;
|
|
1077
|
+
}
|
|
1078
|
+
polygon.material =
|
|
1079
|
+
queryColorValue(node, "color", namespaces.kml) ?? polygon.material;
|
|
1080
|
+
polygon.fill =
|
|
1081
|
+
queryBooleanValue(node, "fill", namespaces.kml) ?? polygon.fill;
|
|
1082
|
+
polygon.outline =
|
|
1083
|
+
queryBooleanValue(node, "outline", namespaces.kml) ?? polygon.outline;
|
|
1084
|
+
} else if (node.localName === "BalloonStyle") {
|
|
1085
|
+
const bgColor =
|
|
1086
|
+
parseColorString(queryStringValue(node, "bgColor", namespaces.kml)) ??
|
|
1087
|
+
Color.WHITE;
|
|
1088
|
+
const textColor =
|
|
1089
|
+
parseColorString(queryStringValue(node, "textColor", namespaces.kml)) ??
|
|
1090
|
+
Color.BLACK;
|
|
1091
|
+
const text = queryStringValue(node, "text", namespaces.kml);
|
|
1092
|
+
|
|
1093
|
+
//This is purely an internal property used in style processing,
|
|
1094
|
+
//it never ends up on the final entity.
|
|
1095
|
+
targetEntity.addProperty("balloonStyle");
|
|
1096
|
+
targetEntity.balloonStyle = {
|
|
1097
|
+
bgColor: bgColor,
|
|
1098
|
+
textColor: textColor,
|
|
1099
|
+
text: text,
|
|
1100
|
+
};
|
|
1101
|
+
} else if (node.localName === "ListStyle") {
|
|
1102
|
+
const listItemType = queryStringValue(
|
|
1103
|
+
node,
|
|
1104
|
+
"listItemType",
|
|
1105
|
+
namespaces.kml,
|
|
1106
|
+
);
|
|
1107
|
+
if (listItemType === "radioFolder" || listItemType === "checkOffOnly") {
|
|
1108
|
+
oneTimeWarning(
|
|
1109
|
+
`kml-listStyle-${listItemType}`,
|
|
1110
|
+
`KML - Unsupported ListStyle with listItemType: ${listItemType}`,
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
//Processes and merges any inline styles for the provided node into the provided entity.
|
|
1118
|
+
function computeFinalStyle(
|
|
1119
|
+
dataSource,
|
|
1120
|
+
placeMark,
|
|
1121
|
+
styleCollection,
|
|
1122
|
+
sourceResource,
|
|
1123
|
+
uriResolver,
|
|
1124
|
+
) {
|
|
1125
|
+
const result = new Entity();
|
|
1126
|
+
let styleEntity;
|
|
1127
|
+
|
|
1128
|
+
//Google earth seems to always use the last inline Style/StyleMap only
|
|
1129
|
+
let styleIndex = -1;
|
|
1130
|
+
const childNodes = placeMark.childNodes;
|
|
1131
|
+
const length = childNodes.length;
|
|
1132
|
+
for (let q = 0; q < length; q++) {
|
|
1133
|
+
const child = childNodes[q];
|
|
1134
|
+
if (child.localName === "Style" || child.localName === "StyleMap") {
|
|
1135
|
+
styleIndex = q;
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
if (styleIndex !== -1) {
|
|
1140
|
+
const inlineStyleNode = childNodes[styleIndex];
|
|
1141
|
+
if (inlineStyleNode.localName === "Style") {
|
|
1142
|
+
applyStyle(
|
|
1143
|
+
dataSource,
|
|
1144
|
+
inlineStyleNode,
|
|
1145
|
+
result,
|
|
1146
|
+
sourceResource,
|
|
1147
|
+
uriResolver,
|
|
1148
|
+
);
|
|
1149
|
+
} else {
|
|
1150
|
+
// StyleMap
|
|
1151
|
+
const pairs = queryChildNodes(inlineStyleNode, "Pair", namespaces.kml);
|
|
1152
|
+
for (let p = 0; p < pairs.length; p++) {
|
|
1153
|
+
const pair = pairs[p];
|
|
1154
|
+
const key = queryStringValue(pair, "key", namespaces.kml);
|
|
1155
|
+
if (key === "normal") {
|
|
1156
|
+
const styleUrl = queryStringValue(pair, "styleUrl", namespaces.kml);
|
|
1157
|
+
if (defined(styleUrl)) {
|
|
1158
|
+
styleEntity = styleCollection.getById(styleUrl);
|
|
1159
|
+
if (!defined(styleEntity)) {
|
|
1160
|
+
styleEntity = styleCollection.getById(`#${styleUrl}`);
|
|
1161
|
+
}
|
|
1162
|
+
if (defined(styleEntity)) {
|
|
1163
|
+
result.merge(styleEntity);
|
|
1164
|
+
}
|
|
1165
|
+
} else {
|
|
1166
|
+
const node = queryFirstNode(pair, "Style", namespaces.kml);
|
|
1167
|
+
applyStyle(dataSource, node, result, sourceResource, uriResolver);
|
|
1168
|
+
}
|
|
1169
|
+
} else {
|
|
1170
|
+
oneTimeWarning(
|
|
1171
|
+
`kml-styleMap-${key}`,
|
|
1172
|
+
`KML - Unsupported StyleMap key: ${key}`,
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
//Google earth seems to always use the first external style only.
|
|
1180
|
+
const externalStyle = queryStringValue(placeMark, "styleUrl", namespaces.kml);
|
|
1181
|
+
if (defined(externalStyle)) {
|
|
1182
|
+
let id = externalStyle;
|
|
1183
|
+
if (externalStyle[0] !== "#" && externalStyle.indexOf("#") !== -1) {
|
|
1184
|
+
const tokens = externalStyle.split("#");
|
|
1185
|
+
const uri = tokens[0];
|
|
1186
|
+
const resource = sourceResource.getDerivedResource({
|
|
1187
|
+
url: uri,
|
|
1188
|
+
});
|
|
1189
|
+
|
|
1190
|
+
id = `${resource.getUrlComponent()}#${tokens[1]}`;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
styleEntity = styleCollection.getById(id);
|
|
1194
|
+
if (!defined(styleEntity)) {
|
|
1195
|
+
styleEntity = styleCollection.getById(`#${id}`);
|
|
1196
|
+
}
|
|
1197
|
+
if (defined(styleEntity)) {
|
|
1198
|
+
result.merge(styleEntity);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
return result;
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
//Asynchronously processes an external style file.
|
|
1206
|
+
function processExternalStyles(dataSource, resource, styleCollection) {
|
|
1207
|
+
return resource.fetchXML().then(function (styleKml) {
|
|
1208
|
+
return processStyles(dataSource, styleKml, styleCollection, resource, true);
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
//Processes all shared and external styles and stores
|
|
1213
|
+
//their id into the provided styleCollection.
|
|
1214
|
+
//Returns an array of promises that will resolve when
|
|
1215
|
+
//each style is loaded.
|
|
1216
|
+
function processStyles(
|
|
1217
|
+
dataSource,
|
|
1218
|
+
kml,
|
|
1219
|
+
styleCollection,
|
|
1220
|
+
sourceResource,
|
|
1221
|
+
isExternal,
|
|
1222
|
+
uriResolver,
|
|
1223
|
+
) {
|
|
1224
|
+
let i;
|
|
1225
|
+
let id;
|
|
1226
|
+
let styleEntity;
|
|
1227
|
+
|
|
1228
|
+
let node;
|
|
1229
|
+
const styleNodes = queryNodes(kml, "Style", namespaces.kml);
|
|
1230
|
+
if (defined(styleNodes)) {
|
|
1231
|
+
const styleNodesLength = styleNodes.length;
|
|
1232
|
+
for (i = 0; i < styleNodesLength; i++) {
|
|
1233
|
+
node = styleNodes[i];
|
|
1234
|
+
id = queryStringAttribute(node, "id");
|
|
1235
|
+
if (defined(id)) {
|
|
1236
|
+
id = `#${id}`;
|
|
1237
|
+
if (isExternal && defined(sourceResource)) {
|
|
1238
|
+
id = sourceResource.getUrlComponent() + id;
|
|
1239
|
+
}
|
|
1240
|
+
if (!defined(styleCollection.getById(id))) {
|
|
1241
|
+
styleEntity = new Entity({
|
|
1242
|
+
id: id,
|
|
1243
|
+
});
|
|
1244
|
+
styleCollection.add(styleEntity);
|
|
1245
|
+
applyStyle(
|
|
1246
|
+
dataSource,
|
|
1247
|
+
node,
|
|
1248
|
+
styleEntity,
|
|
1249
|
+
sourceResource,
|
|
1250
|
+
uriResolver,
|
|
1251
|
+
);
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
const styleMaps = queryNodes(kml, "StyleMap", namespaces.kml);
|
|
1258
|
+
if (defined(styleMaps)) {
|
|
1259
|
+
const styleMapsLength = styleMaps.length;
|
|
1260
|
+
for (i = 0; i < styleMapsLength; i++) {
|
|
1261
|
+
const styleMap = styleMaps[i];
|
|
1262
|
+
id = queryStringAttribute(styleMap, "id");
|
|
1263
|
+
if (defined(id)) {
|
|
1264
|
+
const pairs = queryChildNodes(styleMap, "Pair", namespaces.kml);
|
|
1265
|
+
for (let p = 0; p < pairs.length; p++) {
|
|
1266
|
+
const pair = pairs[p];
|
|
1267
|
+
const key = queryStringValue(pair, "key", namespaces.kml);
|
|
1268
|
+
if (key === "normal") {
|
|
1269
|
+
id = `#${id}`;
|
|
1270
|
+
if (isExternal && defined(sourceResource)) {
|
|
1271
|
+
id = sourceResource.getUrlComponent() + id;
|
|
1272
|
+
}
|
|
1273
|
+
if (!defined(styleCollection.getById(id))) {
|
|
1274
|
+
styleEntity = styleCollection.getOrCreateEntity(id);
|
|
1275
|
+
|
|
1276
|
+
let styleUrl = queryStringValue(pair, "styleUrl", namespaces.kml);
|
|
1277
|
+
if (defined(styleUrl)) {
|
|
1278
|
+
if (styleUrl[0] !== "#") {
|
|
1279
|
+
styleUrl = `#${styleUrl}`;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
if (isExternal && defined(sourceResource)) {
|
|
1283
|
+
styleUrl = sourceResource.getUrlComponent() + styleUrl;
|
|
1284
|
+
}
|
|
1285
|
+
const base = styleCollection.getById(styleUrl);
|
|
1286
|
+
|
|
1287
|
+
if (defined(base)) {
|
|
1288
|
+
styleEntity.merge(base);
|
|
1289
|
+
}
|
|
1290
|
+
} else {
|
|
1291
|
+
node = queryFirstNode(pair, "Style", namespaces.kml);
|
|
1292
|
+
applyStyle(
|
|
1293
|
+
dataSource,
|
|
1294
|
+
node,
|
|
1295
|
+
styleEntity,
|
|
1296
|
+
sourceResource,
|
|
1297
|
+
uriResolver,
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
1300
|
+
}
|
|
1301
|
+
} else {
|
|
1302
|
+
oneTimeWarning(
|
|
1303
|
+
`kml-styleMap-${key}`,
|
|
1304
|
+
`KML - Unsupported StyleMap key: ${key}`,
|
|
1305
|
+
);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
const promises = [];
|
|
1313
|
+
const styleUrlNodes = kml.getElementsByTagName("styleUrl");
|
|
1314
|
+
const styleUrlNodesLength = styleUrlNodes.length;
|
|
1315
|
+
for (i = 0; i < styleUrlNodesLength; i++) {
|
|
1316
|
+
const styleReference = styleUrlNodes[i].textContent;
|
|
1317
|
+
if (styleReference[0] !== "#") {
|
|
1318
|
+
//According to the spec, all local styles should start with a #
|
|
1319
|
+
//and everything else is an external style that has a # seperating
|
|
1320
|
+
//the URL of the document and the style. However, Google Earth
|
|
1321
|
+
//also accepts styleUrls without a # as meaning a local style.
|
|
1322
|
+
const tokens = styleReference.split("#");
|
|
1323
|
+
if (tokens.length === 2) {
|
|
1324
|
+
const uri = tokens[0];
|
|
1325
|
+
const resource = sourceResource.getDerivedResource({
|
|
1326
|
+
url: uri,
|
|
1327
|
+
});
|
|
1328
|
+
|
|
1329
|
+
promises.push(
|
|
1330
|
+
processExternalStyles(dataSource, resource, styleCollection),
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
return promises;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
function createDropLine(entityCollection, entity, styleEntity) {
|
|
1340
|
+
const entityPosition = new ReferenceProperty(entityCollection, entity.id, [
|
|
1341
|
+
"position",
|
|
1342
|
+
]);
|
|
1343
|
+
const surfacePosition = new ScaledPositionProperty(entity.position);
|
|
1344
|
+
entity.polyline = defined(styleEntity.polyline)
|
|
1345
|
+
? styleEntity.polyline.clone()
|
|
1346
|
+
: new PolylineGraphics();
|
|
1347
|
+
entity.polyline.positions = new PositionPropertyArray([
|
|
1348
|
+
entityPosition,
|
|
1349
|
+
surfacePosition,
|
|
1350
|
+
]);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
function heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode) {
|
|
1354
|
+
if (
|
|
1355
|
+
(!defined(altitudeMode) && !defined(gxAltitudeMode)) ||
|
|
1356
|
+
altitudeMode === "clampToGround"
|
|
1357
|
+
) {
|
|
1358
|
+
return HeightReference.CLAMP_TO_GROUND;
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
if (altitudeMode === "relativeToGround") {
|
|
1362
|
+
return HeightReference.RELATIVE_TO_GROUND;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
if (altitudeMode === "absolute") {
|
|
1366
|
+
return HeightReference.NONE;
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
if (gxAltitudeMode === "clampToSeaFloor") {
|
|
1370
|
+
oneTimeWarning(
|
|
1371
|
+
"kml-gx:altitudeMode-clampToSeaFloor",
|
|
1372
|
+
"KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround.",
|
|
1373
|
+
);
|
|
1374
|
+
return HeightReference.CLAMP_TO_GROUND;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
if (gxAltitudeMode === "relativeToSeaFloor") {
|
|
1378
|
+
oneTimeWarning(
|
|
1379
|
+
"kml-gx:altitudeMode-relativeToSeaFloor",
|
|
1380
|
+
"KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround.",
|
|
1381
|
+
);
|
|
1382
|
+
return HeightReference.RELATIVE_TO_GROUND;
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
if (defined(altitudeMode)) {
|
|
1386
|
+
oneTimeWarning(
|
|
1387
|
+
"kml-altitudeMode-unknown",
|
|
1388
|
+
`KML - Unknown <kml:altitudeMode>:${altitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`,
|
|
1389
|
+
);
|
|
1390
|
+
} else {
|
|
1391
|
+
oneTimeWarning(
|
|
1392
|
+
"kml-gx:altitudeMode-unknown",
|
|
1393
|
+
`KML - Unknown <gx:altitudeMode>:${gxAltitudeMode}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`,
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
// Clamp to ground is the default
|
|
1398
|
+
return HeightReference.CLAMP_TO_GROUND;
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
function createPositionPropertyFromAltitudeMode(
|
|
1402
|
+
property,
|
|
1403
|
+
altitudeMode,
|
|
1404
|
+
gxAltitudeMode,
|
|
1405
|
+
) {
|
|
1406
|
+
if (
|
|
1407
|
+
gxAltitudeMode === "relativeToSeaFloor" ||
|
|
1408
|
+
altitudeMode === "absolute" ||
|
|
1409
|
+
altitudeMode === "relativeToGround"
|
|
1410
|
+
) {
|
|
1411
|
+
//Just return the ellipsoid referenced property until we support MSL
|
|
1412
|
+
return property;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
if (
|
|
1416
|
+
(defined(altitudeMode) && altitudeMode !== "clampToGround") || //
|
|
1417
|
+
(defined(gxAltitudeMode) && gxAltitudeMode !== "clampToSeaFloor")
|
|
1418
|
+
) {
|
|
1419
|
+
oneTimeWarning(
|
|
1420
|
+
"kml-altitudeMode-unknown",
|
|
1421
|
+
`KML - Unknown altitudeMode: ${altitudeMode ?? gxAltitudeMode}`,
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
// Clamp to ground is the default
|
|
1426
|
+
return new ScaledPositionProperty(property);
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
function createPositionPropertyArrayFromAltitudeMode(
|
|
1430
|
+
properties,
|
|
1431
|
+
altitudeMode,
|
|
1432
|
+
gxAltitudeMode,
|
|
1433
|
+
ellipsoid,
|
|
1434
|
+
) {
|
|
1435
|
+
if (!defined(properties)) {
|
|
1436
|
+
return undefined;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
if (
|
|
1440
|
+
gxAltitudeMode === "relativeToSeaFloor" ||
|
|
1441
|
+
altitudeMode === "absolute" ||
|
|
1442
|
+
altitudeMode === "relativeToGround"
|
|
1443
|
+
) {
|
|
1444
|
+
//Just return the ellipsoid referenced property until we support MSL
|
|
1445
|
+
return properties;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
if (
|
|
1449
|
+
(defined(altitudeMode) && altitudeMode !== "clampToGround") || //
|
|
1450
|
+
(defined(gxAltitudeMode) && gxAltitudeMode !== "clampToSeaFloor")
|
|
1451
|
+
) {
|
|
1452
|
+
oneTimeWarning(
|
|
1453
|
+
"kml-altitudeMode-unknown",
|
|
1454
|
+
`KML - Unknown altitudeMode: ${altitudeMode ?? gxAltitudeMode}`,
|
|
1455
|
+
);
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
// Clamp to ground is the default
|
|
1459
|
+
const propertiesLength = properties.length;
|
|
1460
|
+
for (let i = 0; i < propertiesLength; i++) {
|
|
1461
|
+
const property = properties[i];
|
|
1462
|
+
ellipsoid.scaleToGeodeticSurface(property, property);
|
|
1463
|
+
}
|
|
1464
|
+
return properties;
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
function processPositionGraphics(
|
|
1468
|
+
dataSource,
|
|
1469
|
+
entity,
|
|
1470
|
+
styleEntity,
|
|
1471
|
+
heightReference,
|
|
1472
|
+
) {
|
|
1473
|
+
let label = entity.label;
|
|
1474
|
+
if (!defined(label)) {
|
|
1475
|
+
label = defined(styleEntity.label)
|
|
1476
|
+
? styleEntity.label.clone()
|
|
1477
|
+
: createDefaultLabel();
|
|
1478
|
+
entity.label = label;
|
|
1479
|
+
}
|
|
1480
|
+
label.text = entity.name;
|
|
1481
|
+
|
|
1482
|
+
let billboard = entity.billboard;
|
|
1483
|
+
if (!defined(billboard)) {
|
|
1484
|
+
billboard = defined(styleEntity.billboard)
|
|
1485
|
+
? styleEntity.billboard.clone()
|
|
1486
|
+
: createDefaultBillboard();
|
|
1487
|
+
entity.billboard = billboard;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
if (!defined(billboard.image)) {
|
|
1491
|
+
billboard.image = dataSource._pinBuilder.fromColor(Color.YELLOW, 64);
|
|
1492
|
+
|
|
1493
|
+
// If there were empty <Icon> tags in the KML, then billboard.image was set to false above
|
|
1494
|
+
// However, in this case, the false value would have been converted to a property afterwards
|
|
1495
|
+
// Thus, we check if billboard.image is defined with value of false
|
|
1496
|
+
} else if (!billboard.image.getValue()) {
|
|
1497
|
+
billboard.image = undefined;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
let scale = 1.0;
|
|
1501
|
+
if (defined(billboard.scale)) {
|
|
1502
|
+
scale = billboard.scale.getValue();
|
|
1503
|
+
if (scale !== 0) {
|
|
1504
|
+
label.pixelOffset = new Cartesian2(scale * 16 + 1, 0);
|
|
1505
|
+
} else {
|
|
1506
|
+
//Minor tweaks to better match Google Earth.
|
|
1507
|
+
label.pixelOffset = undefined;
|
|
1508
|
+
label.horizontalOrigin = undefined;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
if (defined(heightReference) && dataSource._clampToGround) {
|
|
1513
|
+
billboard.heightReference = heightReference;
|
|
1514
|
+
label.heightReference = heightReference;
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
function processPathGraphics(entity, styleEntity) {
|
|
1519
|
+
let path = entity.path;
|
|
1520
|
+
if (!defined(path)) {
|
|
1521
|
+
path = new PathGraphics();
|
|
1522
|
+
path.leadTime = 0;
|
|
1523
|
+
entity.path = path;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
const polyline = styleEntity.polyline;
|
|
1527
|
+
if (defined(polyline)) {
|
|
1528
|
+
path.material = polyline.material;
|
|
1529
|
+
path.width = polyline.width;
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
function processPoint(
|
|
1534
|
+
dataSource,
|
|
1535
|
+
entityCollection,
|
|
1536
|
+
geometryNode,
|
|
1537
|
+
entity,
|
|
1538
|
+
styleEntity,
|
|
1539
|
+
) {
|
|
1540
|
+
const coordinatesString = queryStringValue(
|
|
1541
|
+
geometryNode,
|
|
1542
|
+
"coordinates",
|
|
1543
|
+
namespaces.kml,
|
|
1544
|
+
);
|
|
1545
|
+
const altitudeMode = queryStringValue(
|
|
1546
|
+
geometryNode,
|
|
1547
|
+
"altitudeMode",
|
|
1548
|
+
namespaces.kml,
|
|
1549
|
+
);
|
|
1550
|
+
const gxAltitudeMode = queryStringValue(
|
|
1551
|
+
geometryNode,
|
|
1552
|
+
"altitudeMode",
|
|
1553
|
+
namespaces.gx,
|
|
1554
|
+
);
|
|
1555
|
+
const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml);
|
|
1556
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
1557
|
+
const position = readCoordinate(coordinatesString, ellipsoid);
|
|
1558
|
+
|
|
1559
|
+
entity.position = position;
|
|
1560
|
+
processPositionGraphics(
|
|
1561
|
+
dataSource,
|
|
1562
|
+
entity,
|
|
1563
|
+
styleEntity,
|
|
1564
|
+
heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode),
|
|
1565
|
+
);
|
|
1566
|
+
|
|
1567
|
+
if (extrude && isExtrudable(altitudeMode, gxAltitudeMode)) {
|
|
1568
|
+
createDropLine(entityCollection, entity, styleEntity);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
return true;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
function processLineStringOrLinearRing(
|
|
1575
|
+
dataSource,
|
|
1576
|
+
entityCollection,
|
|
1577
|
+
geometryNode,
|
|
1578
|
+
entity,
|
|
1579
|
+
styleEntity,
|
|
1580
|
+
) {
|
|
1581
|
+
const coordinatesNode = queryFirstNode(
|
|
1582
|
+
geometryNode,
|
|
1583
|
+
"coordinates",
|
|
1584
|
+
namespaces.kml,
|
|
1585
|
+
);
|
|
1586
|
+
const altitudeMode = queryStringValue(
|
|
1587
|
+
geometryNode,
|
|
1588
|
+
"altitudeMode",
|
|
1589
|
+
namespaces.kml,
|
|
1590
|
+
);
|
|
1591
|
+
const gxAltitudeMode = queryStringValue(
|
|
1592
|
+
geometryNode,
|
|
1593
|
+
"altitudeMode",
|
|
1594
|
+
namespaces.gx,
|
|
1595
|
+
);
|
|
1596
|
+
const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml);
|
|
1597
|
+
const tessellate = queryBooleanValue(
|
|
1598
|
+
geometryNode,
|
|
1599
|
+
"tessellate",
|
|
1600
|
+
namespaces.kml,
|
|
1601
|
+
);
|
|
1602
|
+
const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
|
|
1603
|
+
const zIndex = queryNumericValue(geometryNode, "drawOrder", namespaces.gx);
|
|
1604
|
+
|
|
1605
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
1606
|
+
const coordinates = readCoordinates(coordinatesNode, ellipsoid);
|
|
1607
|
+
let polyline = styleEntity.polyline;
|
|
1608
|
+
if (canExtrude && extrude) {
|
|
1609
|
+
const wall = new WallGraphics();
|
|
1610
|
+
entity.wall = wall;
|
|
1611
|
+
wall.positions = coordinates;
|
|
1612
|
+
const polygon = styleEntity.polygon;
|
|
1613
|
+
|
|
1614
|
+
if (defined(polygon)) {
|
|
1615
|
+
wall.fill = polygon.fill;
|
|
1616
|
+
wall.material = polygon.material;
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
//Always outline walls so they show up in 2D.
|
|
1620
|
+
wall.outline = true;
|
|
1621
|
+
if (defined(polyline)) {
|
|
1622
|
+
wall.outlineColor = defined(polyline.material)
|
|
1623
|
+
? polyline.material.color
|
|
1624
|
+
: Color.WHITE;
|
|
1625
|
+
wall.outlineWidth = polyline.width;
|
|
1626
|
+
} else if (defined(polygon)) {
|
|
1627
|
+
wall.outlineColor = defined(polygon.material)
|
|
1628
|
+
? polygon.material.color
|
|
1629
|
+
: Color.WHITE;
|
|
1630
|
+
}
|
|
1631
|
+
} else if (dataSource._clampToGround && !canExtrude && tessellate) {
|
|
1632
|
+
const polylineGraphics = new PolylineGraphics();
|
|
1633
|
+
polylineGraphics.clampToGround = true;
|
|
1634
|
+
entity.polyline = polylineGraphics;
|
|
1635
|
+
polylineGraphics.positions = coordinates;
|
|
1636
|
+
if (defined(polyline)) {
|
|
1637
|
+
polylineGraphics.material = defined(polyline.material)
|
|
1638
|
+
? polyline.material.color.getValue(Iso8601.MINIMUM_VALUE)
|
|
1639
|
+
: Color.WHITE;
|
|
1640
|
+
polylineGraphics.width = polyline.width ?? 1.0;
|
|
1641
|
+
} else {
|
|
1642
|
+
polylineGraphics.material = Color.WHITE;
|
|
1643
|
+
polylineGraphics.width = 1.0;
|
|
1644
|
+
}
|
|
1645
|
+
polylineGraphics.zIndex = zIndex;
|
|
1646
|
+
} else {
|
|
1647
|
+
if (defined(zIndex)) {
|
|
1648
|
+
oneTimeWarning(
|
|
1649
|
+
"kml-gx:drawOrder",
|
|
1650
|
+
"KML - gx:drawOrder is not supported in LineStrings when clampToGround is false",
|
|
1651
|
+
);
|
|
1652
|
+
}
|
|
1653
|
+
if (dataSource._clampToGround && !tessellate) {
|
|
1654
|
+
oneTimeWarning(
|
|
1655
|
+
"kml-line-tesselate",
|
|
1656
|
+
"Ignoring clampToGround for KML lines without the tessellate flag.",
|
|
1657
|
+
);
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
polyline = defined(polyline) ? polyline.clone() : new PolylineGraphics();
|
|
1661
|
+
entity.polyline = polyline;
|
|
1662
|
+
polyline.positions = createPositionPropertyArrayFromAltitudeMode(
|
|
1663
|
+
coordinates,
|
|
1664
|
+
altitudeMode,
|
|
1665
|
+
gxAltitudeMode,
|
|
1666
|
+
ellipsoid,
|
|
1667
|
+
);
|
|
1668
|
+
if (!tessellate || canExtrude) {
|
|
1669
|
+
polyline.arcType = ArcType.NONE;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
return true;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
function processPolygon(
|
|
1677
|
+
dataSource,
|
|
1678
|
+
entityCollection,
|
|
1679
|
+
geometryNode,
|
|
1680
|
+
entity,
|
|
1681
|
+
styleEntity,
|
|
1682
|
+
) {
|
|
1683
|
+
const outerBoundaryIsNode = queryFirstNode(
|
|
1684
|
+
geometryNode,
|
|
1685
|
+
"outerBoundaryIs",
|
|
1686
|
+
namespaces.kml,
|
|
1687
|
+
);
|
|
1688
|
+
let linearRingNode = queryFirstNode(
|
|
1689
|
+
outerBoundaryIsNode,
|
|
1690
|
+
"LinearRing",
|
|
1691
|
+
namespaces.kml,
|
|
1692
|
+
);
|
|
1693
|
+
let coordinatesNode = queryFirstNode(
|
|
1694
|
+
linearRingNode,
|
|
1695
|
+
"coordinates",
|
|
1696
|
+
namespaces.kml,
|
|
1697
|
+
);
|
|
1698
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
1699
|
+
let coordinates = readCoordinates(coordinatesNode, ellipsoid);
|
|
1700
|
+
const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml);
|
|
1701
|
+
const altitudeMode = queryStringValue(
|
|
1702
|
+
geometryNode,
|
|
1703
|
+
"altitudeMode",
|
|
1704
|
+
namespaces.kml,
|
|
1705
|
+
);
|
|
1706
|
+
const gxAltitudeMode = queryStringValue(
|
|
1707
|
+
geometryNode,
|
|
1708
|
+
"altitudeMode",
|
|
1709
|
+
namespaces.gx,
|
|
1710
|
+
);
|
|
1711
|
+
const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
|
|
1712
|
+
|
|
1713
|
+
const polygon = defined(styleEntity.polygon)
|
|
1714
|
+
? styleEntity.polygon.clone()
|
|
1715
|
+
: createDefaultPolygon();
|
|
1716
|
+
|
|
1717
|
+
const polyline = styleEntity.polyline;
|
|
1718
|
+
if (defined(polyline)) {
|
|
1719
|
+
polygon.outlineColor = defined(polyline.material)
|
|
1720
|
+
? polyline.material.color
|
|
1721
|
+
: Color.WHITE;
|
|
1722
|
+
polygon.outlineWidth = polyline.width;
|
|
1723
|
+
}
|
|
1724
|
+
entity.polygon = polygon;
|
|
1725
|
+
|
|
1726
|
+
if (canExtrude) {
|
|
1727
|
+
polygon.perPositionHeight = true;
|
|
1728
|
+
polygon.extrudedHeight = extrude ? 0 : undefined;
|
|
1729
|
+
} else if (!dataSource._clampToGround) {
|
|
1730
|
+
polygon.height = 0;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
if (defined(coordinates)) {
|
|
1734
|
+
const hierarchy = new PolygonHierarchy(coordinates);
|
|
1735
|
+
const innerBoundaryIsNodes = queryChildNodes(
|
|
1736
|
+
geometryNode,
|
|
1737
|
+
"innerBoundaryIs",
|
|
1738
|
+
namespaces.kml,
|
|
1739
|
+
);
|
|
1740
|
+
for (let j = 0; j < innerBoundaryIsNodes.length; j++) {
|
|
1741
|
+
linearRingNode = queryChildNodes(
|
|
1742
|
+
innerBoundaryIsNodes[j],
|
|
1743
|
+
"LinearRing",
|
|
1744
|
+
namespaces.kml,
|
|
1745
|
+
);
|
|
1746
|
+
for (let k = 0; k < linearRingNode.length; k++) {
|
|
1747
|
+
coordinatesNode = queryFirstNode(
|
|
1748
|
+
linearRingNode[k],
|
|
1749
|
+
"coordinates",
|
|
1750
|
+
namespaces.kml,
|
|
1751
|
+
);
|
|
1752
|
+
coordinates = readCoordinates(coordinatesNode, ellipsoid);
|
|
1753
|
+
if (defined(coordinates)) {
|
|
1754
|
+
hierarchy.holes.push(new PolygonHierarchy(coordinates));
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
polygon.hierarchy = hierarchy;
|
|
1759
|
+
}
|
|
1760
|
+
|
|
1761
|
+
return true;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1764
|
+
function processTrack(
|
|
1765
|
+
dataSource,
|
|
1766
|
+
entityCollection,
|
|
1767
|
+
geometryNode,
|
|
1768
|
+
entity,
|
|
1769
|
+
styleEntity,
|
|
1770
|
+
) {
|
|
1771
|
+
const altitudeMode = queryStringValue(
|
|
1772
|
+
geometryNode,
|
|
1773
|
+
"altitudeMode",
|
|
1774
|
+
namespaces.kml,
|
|
1775
|
+
);
|
|
1776
|
+
const gxAltitudeMode = queryStringValue(
|
|
1777
|
+
geometryNode,
|
|
1778
|
+
"altitudeMode",
|
|
1779
|
+
namespaces.gx,
|
|
1780
|
+
);
|
|
1781
|
+
const coordNodes = queryChildNodes(geometryNode, "coord", namespaces.gx);
|
|
1782
|
+
const angleNodes = queryChildNodes(geometryNode, "angles", namespaces.gx);
|
|
1783
|
+
const timeNodes = queryChildNodes(geometryNode, "when", namespaces.kml);
|
|
1784
|
+
const extrude = queryBooleanValue(geometryNode, "extrude", namespaces.kml);
|
|
1785
|
+
const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
|
|
1786
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
1787
|
+
|
|
1788
|
+
if (angleNodes.length > 0) {
|
|
1789
|
+
oneTimeWarning(
|
|
1790
|
+
"kml-gx:angles",
|
|
1791
|
+
"KML - gx:angles are not supported in gx:Tracks",
|
|
1792
|
+
);
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
const length = Math.min(coordNodes.length, timeNodes.length);
|
|
1796
|
+
const coordinates = [];
|
|
1797
|
+
const times = [];
|
|
1798
|
+
for (let i = 0; i < length; i++) {
|
|
1799
|
+
const position = readCoordinate(coordNodes[i].textContent, ellipsoid);
|
|
1800
|
+
coordinates.push(position);
|
|
1801
|
+
times.push(JulianDate.fromIso8601(timeNodes[i].textContent));
|
|
1802
|
+
}
|
|
1803
|
+
const property = new SampledPositionProperty();
|
|
1804
|
+
property.addSamples(times, coordinates);
|
|
1805
|
+
entity.position = property;
|
|
1806
|
+
processPositionGraphics(
|
|
1807
|
+
dataSource,
|
|
1808
|
+
entity,
|
|
1809
|
+
styleEntity,
|
|
1810
|
+
heightReferenceFromAltitudeMode(altitudeMode, gxAltitudeMode),
|
|
1811
|
+
);
|
|
1812
|
+
processPathGraphics(entity, styleEntity);
|
|
1813
|
+
|
|
1814
|
+
entity.availability = new TimeIntervalCollection();
|
|
1815
|
+
|
|
1816
|
+
if (timeNodes.length > 0) {
|
|
1817
|
+
entity.availability.addInterval(
|
|
1818
|
+
new TimeInterval({
|
|
1819
|
+
start: times[0],
|
|
1820
|
+
stop: times[times.length - 1],
|
|
1821
|
+
}),
|
|
1822
|
+
);
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
if (canExtrude && extrude) {
|
|
1826
|
+
createDropLine(entityCollection, entity, styleEntity);
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
return true;
|
|
1830
|
+
}
|
|
1831
|
+
|
|
1832
|
+
function addToMultiTrack(
|
|
1833
|
+
times,
|
|
1834
|
+
positions,
|
|
1835
|
+
composite,
|
|
1836
|
+
availability,
|
|
1837
|
+
dropShowProperty,
|
|
1838
|
+
extrude,
|
|
1839
|
+
altitudeMode,
|
|
1840
|
+
gxAltitudeMode,
|
|
1841
|
+
includeEndPoints,
|
|
1842
|
+
) {
|
|
1843
|
+
const start = times[0];
|
|
1844
|
+
const stop = times[times.length - 1];
|
|
1845
|
+
|
|
1846
|
+
const data = new SampledPositionProperty();
|
|
1847
|
+
data.addSamples(times, positions);
|
|
1848
|
+
|
|
1849
|
+
composite.intervals.addInterval(
|
|
1850
|
+
new TimeInterval({
|
|
1851
|
+
start: start,
|
|
1852
|
+
stop: stop,
|
|
1853
|
+
isStartIncluded: includeEndPoints,
|
|
1854
|
+
isStopIncluded: includeEndPoints,
|
|
1855
|
+
data: createPositionPropertyFromAltitudeMode(
|
|
1856
|
+
data,
|
|
1857
|
+
altitudeMode,
|
|
1858
|
+
gxAltitudeMode,
|
|
1859
|
+
),
|
|
1860
|
+
}),
|
|
1861
|
+
);
|
|
1862
|
+
availability.addInterval(
|
|
1863
|
+
new TimeInterval({
|
|
1864
|
+
start: start,
|
|
1865
|
+
stop: stop,
|
|
1866
|
+
isStartIncluded: includeEndPoints,
|
|
1867
|
+
isStopIncluded: includeEndPoints,
|
|
1868
|
+
}),
|
|
1869
|
+
);
|
|
1870
|
+
dropShowProperty.intervals.addInterval(
|
|
1871
|
+
new TimeInterval({
|
|
1872
|
+
start: start,
|
|
1873
|
+
stop: stop,
|
|
1874
|
+
isStartIncluded: includeEndPoints,
|
|
1875
|
+
isStopIncluded: includeEndPoints,
|
|
1876
|
+
data: extrude,
|
|
1877
|
+
}),
|
|
1878
|
+
);
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
function processMultiTrack(
|
|
1882
|
+
dataSource,
|
|
1883
|
+
entityCollection,
|
|
1884
|
+
geometryNode,
|
|
1885
|
+
entity,
|
|
1886
|
+
styleEntity,
|
|
1887
|
+
) {
|
|
1888
|
+
// Multitrack options do not work in GE as detailed in the spec,
|
|
1889
|
+
// rather than altitudeMode being at the MultiTrack level,
|
|
1890
|
+
// GE just defers all settings to the underlying track.
|
|
1891
|
+
|
|
1892
|
+
const interpolate = queryBooleanValue(
|
|
1893
|
+
geometryNode,
|
|
1894
|
+
"interpolate",
|
|
1895
|
+
namespaces.gx,
|
|
1896
|
+
);
|
|
1897
|
+
const trackNodes = queryChildNodes(geometryNode, "Track", namespaces.gx);
|
|
1898
|
+
|
|
1899
|
+
let times;
|
|
1900
|
+
let lastStop;
|
|
1901
|
+
let lastStopPosition;
|
|
1902
|
+
let needDropLine = false;
|
|
1903
|
+
const dropShowProperty = new TimeIntervalCollectionProperty();
|
|
1904
|
+
const availability = new TimeIntervalCollection();
|
|
1905
|
+
const composite = new CompositePositionProperty();
|
|
1906
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
1907
|
+
for (let i = 0, len = trackNodes.length; i < len; i++) {
|
|
1908
|
+
const trackNode = trackNodes[i];
|
|
1909
|
+
const timeNodes = queryChildNodes(trackNode, "when", namespaces.kml);
|
|
1910
|
+
const coordNodes = queryChildNodes(trackNode, "coord", namespaces.gx);
|
|
1911
|
+
const altitudeMode = queryStringValue(
|
|
1912
|
+
trackNode,
|
|
1913
|
+
"altitudeMode",
|
|
1914
|
+
namespaces.kml,
|
|
1915
|
+
);
|
|
1916
|
+
const gxAltitudeMode = queryStringValue(
|
|
1917
|
+
trackNode,
|
|
1918
|
+
"altitudeMode",
|
|
1919
|
+
namespaces.gx,
|
|
1920
|
+
);
|
|
1921
|
+
const canExtrude = isExtrudable(altitudeMode, gxAltitudeMode);
|
|
1922
|
+
const extrude = queryBooleanValue(trackNode, "extrude", namespaces.kml);
|
|
1923
|
+
|
|
1924
|
+
const length = Math.min(coordNodes.length, timeNodes.length);
|
|
1925
|
+
|
|
1926
|
+
const positions = [];
|
|
1927
|
+
times = [];
|
|
1928
|
+
for (let x = 0; x < length; x++) {
|
|
1929
|
+
const position = readCoordinate(coordNodes[x].textContent, ellipsoid);
|
|
1930
|
+
positions.push(position);
|
|
1931
|
+
times.push(JulianDate.fromIso8601(timeNodes[x].textContent));
|
|
1932
|
+
}
|
|
1933
|
+
|
|
1934
|
+
if (interpolate) {
|
|
1935
|
+
//If we are interpolating, then we need to fill in the end of
|
|
1936
|
+
//the last track and the beginning of this one with a sampled
|
|
1937
|
+
//property. From testing in Google Earth, this property
|
|
1938
|
+
//is never extruded and always absolute.
|
|
1939
|
+
if (defined(lastStop)) {
|
|
1940
|
+
addToMultiTrack(
|
|
1941
|
+
[lastStop, times[0]],
|
|
1942
|
+
[lastStopPosition, positions[0]],
|
|
1943
|
+
composite,
|
|
1944
|
+
availability,
|
|
1945
|
+
dropShowProperty,
|
|
1946
|
+
false,
|
|
1947
|
+
"absolute",
|
|
1948
|
+
undefined,
|
|
1949
|
+
false,
|
|
1950
|
+
);
|
|
1951
|
+
}
|
|
1952
|
+
lastStop = times[length - 1];
|
|
1953
|
+
lastStopPosition = positions[positions.length - 1];
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
addToMultiTrack(
|
|
1957
|
+
times,
|
|
1958
|
+
positions,
|
|
1959
|
+
composite,
|
|
1960
|
+
availability,
|
|
1961
|
+
dropShowProperty,
|
|
1962
|
+
canExtrude && extrude,
|
|
1963
|
+
altitudeMode,
|
|
1964
|
+
gxAltitudeMode,
|
|
1965
|
+
true,
|
|
1966
|
+
);
|
|
1967
|
+
needDropLine = needDropLine || (canExtrude && extrude);
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
entity.availability = availability;
|
|
1971
|
+
entity.position = composite;
|
|
1972
|
+
processPositionGraphics(dataSource, entity, styleEntity);
|
|
1973
|
+
processPathGraphics(entity, styleEntity);
|
|
1974
|
+
if (needDropLine) {
|
|
1975
|
+
createDropLine(entityCollection, entity, styleEntity);
|
|
1976
|
+
entity.polyline.show = dropShowProperty;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
return true;
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
const geometryTypes = {
|
|
1983
|
+
Point: processPoint,
|
|
1984
|
+
LineString: processLineStringOrLinearRing,
|
|
1985
|
+
LinearRing: processLineStringOrLinearRing,
|
|
1986
|
+
Polygon: processPolygon,
|
|
1987
|
+
Track: processTrack,
|
|
1988
|
+
MultiTrack: processMultiTrack,
|
|
1989
|
+
MultiGeometry: processMultiGeometry,
|
|
1990
|
+
Model: processUnsupportedGeometry,
|
|
1991
|
+
};
|
|
1992
|
+
|
|
1993
|
+
function processMultiGeometry(
|
|
1994
|
+
dataSource,
|
|
1995
|
+
entityCollection,
|
|
1996
|
+
geometryNode,
|
|
1997
|
+
entity,
|
|
1998
|
+
styleEntity,
|
|
1999
|
+
context,
|
|
2000
|
+
) {
|
|
2001
|
+
const childNodes = geometryNode.childNodes;
|
|
2002
|
+
let hasGeometry = false;
|
|
2003
|
+
for (let i = 0, len = childNodes.length; i < len; i++) {
|
|
2004
|
+
const childNode = childNodes.item(i);
|
|
2005
|
+
const geometryProcessor = geometryTypes[childNode.localName];
|
|
2006
|
+
if (defined(geometryProcessor)) {
|
|
2007
|
+
const childEntity = createEntity(childNode, entityCollection, context);
|
|
2008
|
+
childEntity.parent = entity;
|
|
2009
|
+
childEntity.name = entity.name;
|
|
2010
|
+
childEntity.availability = entity.availability;
|
|
2011
|
+
childEntity.description = entity.description;
|
|
2012
|
+
childEntity.kml = entity.kml;
|
|
2013
|
+
if (
|
|
2014
|
+
geometryProcessor(
|
|
2015
|
+
dataSource,
|
|
2016
|
+
entityCollection,
|
|
2017
|
+
childNode,
|
|
2018
|
+
childEntity,
|
|
2019
|
+
styleEntity,
|
|
2020
|
+
)
|
|
2021
|
+
) {
|
|
2022
|
+
hasGeometry = true;
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
|
|
2027
|
+
return hasGeometry;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
function processUnsupportedGeometry(
|
|
2031
|
+
dataSource,
|
|
2032
|
+
entityCollection,
|
|
2033
|
+
geometryNode,
|
|
2034
|
+
entity,
|
|
2035
|
+
styleEntity,
|
|
2036
|
+
) {
|
|
2037
|
+
oneTimeWarning(
|
|
2038
|
+
"kml-unsupportedGeometry",
|
|
2039
|
+
`KML - Unsupported geometry: ${geometryNode.localName}`,
|
|
2040
|
+
);
|
|
2041
|
+
return false;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
function processExtendedData(node, entity) {
|
|
2045
|
+
const extendedDataNode = queryFirstNode(node, "ExtendedData", namespaces.kml);
|
|
2046
|
+
|
|
2047
|
+
if (!defined(extendedDataNode)) {
|
|
2048
|
+
return undefined;
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
if (defined(queryFirstNode(extendedDataNode, "SchemaData", namespaces.kml))) {
|
|
2052
|
+
oneTimeWarning("kml-schemaData", "KML - SchemaData is unsupported");
|
|
2053
|
+
}
|
|
2054
|
+
if (defined(queryStringAttribute(extendedDataNode, "xmlns:prefix"))) {
|
|
2055
|
+
oneTimeWarning(
|
|
2056
|
+
"kml-extendedData",
|
|
2057
|
+
"KML - ExtendedData with xmlns:prefix is unsupported",
|
|
2058
|
+
);
|
|
2059
|
+
}
|
|
2060
|
+
|
|
2061
|
+
const result = {};
|
|
2062
|
+
const dataNodes = queryChildNodes(extendedDataNode, "Data", namespaces.kml);
|
|
2063
|
+
if (defined(dataNodes)) {
|
|
2064
|
+
const length = dataNodes.length;
|
|
2065
|
+
for (let i = 0; i < length; i++) {
|
|
2066
|
+
const dataNode = dataNodes[i];
|
|
2067
|
+
const name = queryStringAttribute(dataNode, "name");
|
|
2068
|
+
if (defined(name)) {
|
|
2069
|
+
result[name] = {
|
|
2070
|
+
displayName: queryStringValue(
|
|
2071
|
+
dataNode,
|
|
2072
|
+
"displayName",
|
|
2073
|
+
namespaces.kml,
|
|
2074
|
+
),
|
|
2075
|
+
value: queryStringValue(dataNode, "value", namespaces.kml),
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
}
|
|
2080
|
+
entity.kml.extendedData = result;
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
let scratchDiv;
|
|
2084
|
+
if (typeof document !== "undefined") {
|
|
2085
|
+
scratchDiv = document.createElement("div");
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
function processDescription(
|
|
2089
|
+
node,
|
|
2090
|
+
entity,
|
|
2091
|
+
styleEntity,
|
|
2092
|
+
uriResolver,
|
|
2093
|
+
sourceResource,
|
|
2094
|
+
) {
|
|
2095
|
+
let i;
|
|
2096
|
+
let key;
|
|
2097
|
+
let keys;
|
|
2098
|
+
|
|
2099
|
+
const kmlData = entity.kml;
|
|
2100
|
+
const extendedData = kmlData.extendedData;
|
|
2101
|
+
const description = queryStringValue(node, "description", namespaces.kml);
|
|
2102
|
+
|
|
2103
|
+
const balloonStyle = entity.balloonStyle ?? styleEntity.balloonStyle;
|
|
2104
|
+
|
|
2105
|
+
let background = Color.WHITE;
|
|
2106
|
+
let foreground = Color.BLACK;
|
|
2107
|
+
let text = description;
|
|
2108
|
+
|
|
2109
|
+
if (defined(balloonStyle)) {
|
|
2110
|
+
background = balloonStyle.bgColor ?? Color.WHITE;
|
|
2111
|
+
foreground = balloonStyle.textColor ?? Color.BLACK;
|
|
2112
|
+
text = balloonStyle.text ?? description;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
let value;
|
|
2116
|
+
if (defined(text)) {
|
|
2117
|
+
text = text.replace("$[name]", entity.name ?? "");
|
|
2118
|
+
text = text.replace("$[description]", description ?? "");
|
|
2119
|
+
text = text.replace("$[address]", kmlData.address ?? "");
|
|
2120
|
+
text = text.replace("$[Snippet]", kmlData.snippet ?? "");
|
|
2121
|
+
text = text.replace("$[id]", entity.id);
|
|
2122
|
+
|
|
2123
|
+
//While not explicitly defined by the OGC spec, in Google Earth
|
|
2124
|
+
//The appearance of geDirections adds the directions to/from links
|
|
2125
|
+
//We simply replace this string with nothing.
|
|
2126
|
+
text = text.replace("$[geDirections]", "");
|
|
2127
|
+
|
|
2128
|
+
if (defined(extendedData)) {
|
|
2129
|
+
const matches = text.match(/\$\[.+?\]/g);
|
|
2130
|
+
if (matches !== null) {
|
|
2131
|
+
for (i = 0; i < matches.length; i++) {
|
|
2132
|
+
const token = matches[i];
|
|
2133
|
+
let propertyName = token.substr(2, token.length - 3);
|
|
2134
|
+
const isDisplayName = /\/displayName$/.test(propertyName);
|
|
2135
|
+
propertyName = propertyName.replace(/\/displayName$/, "");
|
|
2136
|
+
|
|
2137
|
+
value = extendedData[propertyName];
|
|
2138
|
+
if (defined(value)) {
|
|
2139
|
+
value = isDisplayName ? value.displayName : value.value;
|
|
2140
|
+
}
|
|
2141
|
+
if (defined(value)) {
|
|
2142
|
+
text = text.replace(token, value ?? "");
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
} else if (defined(extendedData)) {
|
|
2148
|
+
//If no description exists, build a table out of the extended data
|
|
2149
|
+
keys = Object.keys(extendedData);
|
|
2150
|
+
if (keys.length > 0) {
|
|
2151
|
+
text =
|
|
2152
|
+
'<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>';
|
|
2153
|
+
for (i = 0; i < keys.length; i++) {
|
|
2154
|
+
key = keys[i];
|
|
2155
|
+
value = extendedData[key];
|
|
2156
|
+
text += `<tr><th>${value.displayName ?? key}</th><td>${value.value ?? ""}</td></tr>`;
|
|
2157
|
+
}
|
|
2158
|
+
text += "</tbody></table>";
|
|
2159
|
+
}
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
if (!defined(text)) {
|
|
2163
|
+
//No description
|
|
2164
|
+
return;
|
|
2165
|
+
}
|
|
2166
|
+
|
|
2167
|
+
//Turns non-explicit links into clickable links.
|
|
2168
|
+
text = autolinker.link(text);
|
|
2169
|
+
|
|
2170
|
+
//Use a temporary div to manipulate the links
|
|
2171
|
+
//so that they open in a new window.
|
|
2172
|
+
scratchDiv.innerHTML = text;
|
|
2173
|
+
const links = scratchDiv.querySelectorAll("a");
|
|
2174
|
+
for (i = 0; i < links.length; i++) {
|
|
2175
|
+
links[i].setAttribute("target", "_blank");
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
//Rewrite any KMZ embedded urls
|
|
2179
|
+
if (defined(uriResolver) && uriResolver.keys.length > 1) {
|
|
2180
|
+
embedDataUris(scratchDiv, "a", "href", uriResolver);
|
|
2181
|
+
embedDataUris(scratchDiv, "link", "href", uriResolver);
|
|
2182
|
+
embedDataUris(scratchDiv, "area", "href", uriResolver);
|
|
2183
|
+
embedDataUris(scratchDiv, "img", "src", uriResolver);
|
|
2184
|
+
embedDataUris(scratchDiv, "iframe", "src", uriResolver);
|
|
2185
|
+
embedDataUris(scratchDiv, "video", "src", uriResolver);
|
|
2186
|
+
embedDataUris(scratchDiv, "audio", "src", uriResolver);
|
|
2187
|
+
embedDataUris(scratchDiv, "source", "src", uriResolver);
|
|
2188
|
+
embedDataUris(scratchDiv, "track", "src", uriResolver);
|
|
2189
|
+
embedDataUris(scratchDiv, "input", "src", uriResolver);
|
|
2190
|
+
embedDataUris(scratchDiv, "embed", "src", uriResolver);
|
|
2191
|
+
embedDataUris(scratchDiv, "script", "src", uriResolver);
|
|
2192
|
+
embedDataUris(scratchDiv, "video", "poster", uriResolver);
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
//Make relative urls absolute using the sourceResource
|
|
2196
|
+
applyBasePath(scratchDiv, "a", "href", sourceResource);
|
|
2197
|
+
applyBasePath(scratchDiv, "link", "href", sourceResource);
|
|
2198
|
+
applyBasePath(scratchDiv, "area", "href", sourceResource);
|
|
2199
|
+
applyBasePath(scratchDiv, "img", "src", sourceResource);
|
|
2200
|
+
applyBasePath(scratchDiv, "iframe", "src", sourceResource);
|
|
2201
|
+
applyBasePath(scratchDiv, "video", "src", sourceResource);
|
|
2202
|
+
applyBasePath(scratchDiv, "audio", "src", sourceResource);
|
|
2203
|
+
applyBasePath(scratchDiv, "source", "src", sourceResource);
|
|
2204
|
+
applyBasePath(scratchDiv, "track", "src", sourceResource);
|
|
2205
|
+
applyBasePath(scratchDiv, "input", "src", sourceResource);
|
|
2206
|
+
applyBasePath(scratchDiv, "embed", "src", sourceResource);
|
|
2207
|
+
applyBasePath(scratchDiv, "script", "src", sourceResource);
|
|
2208
|
+
applyBasePath(scratchDiv, "video", "poster", sourceResource);
|
|
2209
|
+
|
|
2210
|
+
let tmp = '<div class="cesium-infoBox-description-lighter" style="';
|
|
2211
|
+
tmp += "overflow:auto;";
|
|
2212
|
+
tmp += "word-wrap:break-word;";
|
|
2213
|
+
tmp += `background-color:${background.toCssColorString()};`;
|
|
2214
|
+
tmp += `color:${foreground.toCssColorString()};`;
|
|
2215
|
+
tmp += '">';
|
|
2216
|
+
tmp += `${scratchDiv.innerHTML}</div>`;
|
|
2217
|
+
scratchDiv.innerHTML = "";
|
|
2218
|
+
|
|
2219
|
+
//Set the final HTML as the description.
|
|
2220
|
+
entity.description = tmp;
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
function processFeature(dataSource, featureNode, processingData) {
|
|
2224
|
+
const entityCollection = processingData.entityCollection;
|
|
2225
|
+
const parent = processingData.parentEntity;
|
|
2226
|
+
const sourceResource = processingData.sourceResource;
|
|
2227
|
+
const uriResolver = processingData.uriResolver;
|
|
2228
|
+
|
|
2229
|
+
const entity = createEntity(
|
|
2230
|
+
featureNode,
|
|
2231
|
+
entityCollection,
|
|
2232
|
+
processingData.context,
|
|
2233
|
+
);
|
|
2234
|
+
const kmlData = entity.kml;
|
|
2235
|
+
const styleEntity = computeFinalStyle(
|
|
2236
|
+
dataSource,
|
|
2237
|
+
featureNode,
|
|
2238
|
+
processingData.styleCollection,
|
|
2239
|
+
sourceResource,
|
|
2240
|
+
uriResolver,
|
|
2241
|
+
);
|
|
2242
|
+
|
|
2243
|
+
const name = queryStringValue(featureNode, "name", namespaces.kml);
|
|
2244
|
+
entity.name = name;
|
|
2245
|
+
entity.parent = parent;
|
|
2246
|
+
|
|
2247
|
+
let availability = processTimeSpan(featureNode);
|
|
2248
|
+
if (!defined(availability)) {
|
|
2249
|
+
availability = processTimeStamp(featureNode);
|
|
2250
|
+
}
|
|
2251
|
+
entity.availability = availability;
|
|
2252
|
+
|
|
2253
|
+
mergeAvailabilityWithParent(entity);
|
|
2254
|
+
|
|
2255
|
+
// Per KML spec "A Feature is visible only if it and all its ancestors are visible."
|
|
2256
|
+
function ancestryIsVisible(parentEntity) {
|
|
2257
|
+
if (!parentEntity) {
|
|
2258
|
+
return true;
|
|
2259
|
+
}
|
|
2260
|
+
return parentEntity.show && ancestryIsVisible(parentEntity.parent);
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
const visibility = queryBooleanValue(
|
|
2264
|
+
featureNode,
|
|
2265
|
+
"visibility",
|
|
2266
|
+
namespaces.kml,
|
|
2267
|
+
);
|
|
2268
|
+
entity.show = ancestryIsVisible(parent) && (visibility ?? true);
|
|
2269
|
+
//const open = queryBooleanValue(featureNode, 'open', namespaces.kml);
|
|
2270
|
+
|
|
2271
|
+
const authorNode = queryFirstNode(featureNode, "author", namespaces.atom);
|
|
2272
|
+
const author = kmlData.author;
|
|
2273
|
+
author.name = queryStringValue(authorNode, "name", namespaces.atom);
|
|
2274
|
+
author.uri = queryStringValue(authorNode, "uri", namespaces.atom);
|
|
2275
|
+
author.email = queryStringValue(authorNode, "email", namespaces.atom);
|
|
2276
|
+
|
|
2277
|
+
const linkNode = queryFirstNode(featureNode, "link", namespaces.atom);
|
|
2278
|
+
const link = kmlData.link;
|
|
2279
|
+
link.href = queryStringAttribute(linkNode, "href");
|
|
2280
|
+
link.hreflang = queryStringAttribute(linkNode, "hreflang");
|
|
2281
|
+
link.rel = queryStringAttribute(linkNode, "rel");
|
|
2282
|
+
link.type = queryStringAttribute(linkNode, "type");
|
|
2283
|
+
link.title = queryStringAttribute(linkNode, "title");
|
|
2284
|
+
link.length = queryStringAttribute(linkNode, "length");
|
|
2285
|
+
|
|
2286
|
+
kmlData.address = queryStringValue(featureNode, "address", namespaces.kml);
|
|
2287
|
+
kmlData.phoneNumber = queryStringValue(
|
|
2288
|
+
featureNode,
|
|
2289
|
+
"phoneNumber",
|
|
2290
|
+
namespaces.kml,
|
|
2291
|
+
);
|
|
2292
|
+
kmlData.snippet = queryStringValue(featureNode, "Snippet", namespaces.kml);
|
|
2293
|
+
|
|
2294
|
+
processExtendedData(featureNode, entity);
|
|
2295
|
+
processDescription(
|
|
2296
|
+
featureNode,
|
|
2297
|
+
entity,
|
|
2298
|
+
styleEntity,
|
|
2299
|
+
uriResolver,
|
|
2300
|
+
sourceResource,
|
|
2301
|
+
);
|
|
2302
|
+
|
|
2303
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
2304
|
+
processLookAt(featureNode, entity, ellipsoid);
|
|
2305
|
+
processCamera(featureNode, entity, ellipsoid);
|
|
2306
|
+
|
|
2307
|
+
if (defined(queryFirstNode(featureNode, "Region", namespaces.kml))) {
|
|
2308
|
+
oneTimeWarning("kml-region", "KML - Placemark Regions are unsupported");
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
return {
|
|
2312
|
+
entity: entity,
|
|
2313
|
+
styleEntity: styleEntity,
|
|
2314
|
+
};
|
|
2315
|
+
}
|
|
2316
|
+
|
|
2317
|
+
function processDocument(dataSource, node, processingData, deferredLoading) {
|
|
2318
|
+
deferredLoading.addNodes(node.childNodes, processingData);
|
|
2319
|
+
deferredLoading.process();
|
|
2320
|
+
}
|
|
2321
|
+
|
|
2322
|
+
function processFolder(dataSource, node, processingData, deferredLoading) {
|
|
2323
|
+
const r = processFeature(dataSource, node, processingData);
|
|
2324
|
+
const newProcessingData = clone(processingData);
|
|
2325
|
+
newProcessingData.parentEntity = r.entity;
|
|
2326
|
+
processDocument(dataSource, node, newProcessingData, deferredLoading);
|
|
2327
|
+
}
|
|
2328
|
+
|
|
2329
|
+
function processPlacemark(
|
|
2330
|
+
dataSource,
|
|
2331
|
+
placemark,
|
|
2332
|
+
processingData,
|
|
2333
|
+
deferredLoading,
|
|
2334
|
+
) {
|
|
2335
|
+
const r = processFeature(dataSource, placemark, processingData);
|
|
2336
|
+
const entity = r.entity;
|
|
2337
|
+
const styleEntity = r.styleEntity;
|
|
2338
|
+
|
|
2339
|
+
let hasGeometry = false;
|
|
2340
|
+
const childNodes = placemark.childNodes;
|
|
2341
|
+
for (let i = 0, len = childNodes.length; i < len && !hasGeometry; i++) {
|
|
2342
|
+
const childNode = childNodes.item(i);
|
|
2343
|
+
const geometryProcessor = geometryTypes[childNode.localName];
|
|
2344
|
+
if (defined(geometryProcessor)) {
|
|
2345
|
+
// pass the placemark entity id as a context for case of defining multiple child entities together to handle case
|
|
2346
|
+
// where some malformed kmls reuse the same id across placemarks, which works in GE, but is not technically to spec.
|
|
2347
|
+
geometryProcessor(
|
|
2348
|
+
dataSource,
|
|
2349
|
+
processingData.entityCollection,
|
|
2350
|
+
childNode,
|
|
2351
|
+
entity,
|
|
2352
|
+
styleEntity,
|
|
2353
|
+
entity.id,
|
|
2354
|
+
);
|
|
2355
|
+
hasGeometry = true;
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
|
|
2359
|
+
if (!hasGeometry) {
|
|
2360
|
+
entity.merge(styleEntity);
|
|
2361
|
+
processPositionGraphics(dataSource, entity, styleEntity);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
const playlistNodeProcessors = {
|
|
2366
|
+
FlyTo: processTourFlyTo,
|
|
2367
|
+
Wait: processTourWait,
|
|
2368
|
+
SoundCue: processTourUnsupportedNode,
|
|
2369
|
+
AnimatedUpdate: processTourUnsupportedNode,
|
|
2370
|
+
TourControl: processTourUnsupportedNode,
|
|
2371
|
+
};
|
|
2372
|
+
|
|
2373
|
+
function processTour(dataSource, node, processingData, deferredLoading) {
|
|
2374
|
+
const name = queryStringValue(node, "name", namespaces.kml);
|
|
2375
|
+
const id = queryStringAttribute(node, "id");
|
|
2376
|
+
const tour = new KmlTour(name, id);
|
|
2377
|
+
|
|
2378
|
+
const playlistNode = queryFirstNode(node, "Playlist", namespaces.gx);
|
|
2379
|
+
if (playlistNode) {
|
|
2380
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
2381
|
+
const childNodes = playlistNode.childNodes;
|
|
2382
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
2383
|
+
const entryNode = childNodes[i];
|
|
2384
|
+
if (entryNode.localName) {
|
|
2385
|
+
const playlistNodeProcessor =
|
|
2386
|
+
playlistNodeProcessors[entryNode.localName];
|
|
2387
|
+
if (playlistNodeProcessor) {
|
|
2388
|
+
playlistNodeProcessor(tour, entryNode, ellipsoid);
|
|
2389
|
+
} else {
|
|
2390
|
+
console.log(
|
|
2391
|
+
`Unknown KML Tour playlist entry type ${entryNode.localName}`,
|
|
2392
|
+
);
|
|
2393
|
+
}
|
|
2394
|
+
}
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
dataSource._kmlTours.push(tour);
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2401
|
+
function processTourUnsupportedNode(tour, entryNode) {
|
|
2402
|
+
oneTimeWarning(`KML Tour unsupported node ${entryNode.localName}`);
|
|
2403
|
+
}
|
|
2404
|
+
|
|
2405
|
+
function processTourWait(tour, entryNode) {
|
|
2406
|
+
const duration = queryNumericValue(entryNode, "duration", namespaces.gx);
|
|
2407
|
+
tour.addPlaylistEntry(new KmlTourWait(duration));
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
function processTourFlyTo(tour, entryNode, ellipsoid) {
|
|
2411
|
+
const duration = queryNumericValue(entryNode, "duration", namespaces.gx);
|
|
2412
|
+
const flyToMode = queryStringValue(entryNode, "flyToMode", namespaces.gx);
|
|
2413
|
+
|
|
2414
|
+
const t = { kml: {} };
|
|
2415
|
+
|
|
2416
|
+
processLookAt(entryNode, t, ellipsoid);
|
|
2417
|
+
processCamera(entryNode, t, ellipsoid);
|
|
2418
|
+
|
|
2419
|
+
const view = t.kml.lookAt || t.kml.camera;
|
|
2420
|
+
|
|
2421
|
+
const flyto = new KmlTourFlyTo(duration, flyToMode, view);
|
|
2422
|
+
tour.addPlaylistEntry(flyto);
|
|
2423
|
+
}
|
|
2424
|
+
|
|
2425
|
+
function processCamera(featureNode, entity, ellipsoid) {
|
|
2426
|
+
const camera = queryFirstNode(featureNode, "Camera", namespaces.kml);
|
|
2427
|
+
if (defined(camera)) {
|
|
2428
|
+
const lon = queryNumericValue(camera, "longitude", namespaces.kml) ?? 0.0;
|
|
2429
|
+
const lat = queryNumericValue(camera, "latitude", namespaces.kml) ?? 0.0;
|
|
2430
|
+
const altitude =
|
|
2431
|
+
queryNumericValue(camera, "altitude", namespaces.kml) ?? 0.0;
|
|
2432
|
+
|
|
2433
|
+
const heading = queryNumericValue(camera, "heading", namespaces.kml) ?? 0.0;
|
|
2434
|
+
const tilt = queryNumericValue(camera, "tilt", namespaces.kml) ?? 0.0;
|
|
2435
|
+
const roll = queryNumericValue(camera, "roll", namespaces.kml) ?? 0.0;
|
|
2436
|
+
|
|
2437
|
+
const position = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);
|
|
2438
|
+
const hpr = HeadingPitchRoll.fromDegrees(heading, tilt - 90.0, roll);
|
|
2439
|
+
|
|
2440
|
+
entity.kml.camera = new KmlCamera(position, hpr);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
|
|
2444
|
+
function processLookAt(featureNode, entity, ellipsoid) {
|
|
2445
|
+
const lookAt = queryFirstNode(featureNode, "LookAt", namespaces.kml);
|
|
2446
|
+
if (defined(lookAt)) {
|
|
2447
|
+
const lon = queryNumericValue(lookAt, "longitude", namespaces.kml) ?? 0.0;
|
|
2448
|
+
const lat = queryNumericValue(lookAt, "latitude", namespaces.kml) ?? 0.0;
|
|
2449
|
+
const altitude =
|
|
2450
|
+
queryNumericValue(lookAt, "altitude", namespaces.kml) ?? 0.0;
|
|
2451
|
+
let heading = queryNumericValue(lookAt, "heading", namespaces.kml);
|
|
2452
|
+
let tilt = queryNumericValue(lookAt, "tilt", namespaces.kml);
|
|
2453
|
+
const range = queryNumericValue(lookAt, "range", namespaces.kml) ?? 0.0;
|
|
2454
|
+
|
|
2455
|
+
tilt = CesiumMath.toRadians(tilt ?? 0.0);
|
|
2456
|
+
heading = CesiumMath.toRadians(heading ?? 0.0);
|
|
2457
|
+
|
|
2458
|
+
const hpr = new HeadingPitchRange(
|
|
2459
|
+
heading,
|
|
2460
|
+
tilt - CesiumMath.PI_OVER_TWO,
|
|
2461
|
+
range,
|
|
2462
|
+
);
|
|
2463
|
+
const viewPoint = Cartesian3.fromDegrees(lon, lat, altitude, ellipsoid);
|
|
2464
|
+
|
|
2465
|
+
entity.kml.lookAt = new KmlLookAt(viewPoint, hpr);
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
function processScreenOverlay(
|
|
2470
|
+
dataSource,
|
|
2471
|
+
screenOverlayNode,
|
|
2472
|
+
processingData,
|
|
2473
|
+
deferredLoading,
|
|
2474
|
+
) {
|
|
2475
|
+
const screenOverlay = processingData.screenOverlayContainer;
|
|
2476
|
+
if (!defined(screenOverlay)) {
|
|
2477
|
+
return undefined;
|
|
2478
|
+
}
|
|
2479
|
+
|
|
2480
|
+
const sourceResource = processingData.sourceResource;
|
|
2481
|
+
const uriResolver = processingData.uriResolver;
|
|
2482
|
+
|
|
2483
|
+
const iconNode = queryFirstNode(screenOverlayNode, "Icon", namespaces.kml);
|
|
2484
|
+
const icon = getIconHref(
|
|
2485
|
+
iconNode,
|
|
2486
|
+
dataSource,
|
|
2487
|
+
sourceResource,
|
|
2488
|
+
uriResolver,
|
|
2489
|
+
false,
|
|
2490
|
+
);
|
|
2491
|
+
|
|
2492
|
+
if (!defined(icon)) {
|
|
2493
|
+
return undefined;
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
const img = document.createElement("img");
|
|
2497
|
+
dataSource._screenOverlays.push(img);
|
|
2498
|
+
|
|
2499
|
+
img.src = icon.url;
|
|
2500
|
+
img.onload = function () {
|
|
2501
|
+
const styles = ["position: absolute"];
|
|
2502
|
+
|
|
2503
|
+
const screenXY = queryFirstNode(
|
|
2504
|
+
screenOverlayNode,
|
|
2505
|
+
"screenXY",
|
|
2506
|
+
namespaces.kml,
|
|
2507
|
+
);
|
|
2508
|
+
const overlayXY = queryFirstNode(
|
|
2509
|
+
screenOverlayNode,
|
|
2510
|
+
"overlayXY",
|
|
2511
|
+
namespaces.kml,
|
|
2512
|
+
);
|
|
2513
|
+
const size = queryFirstNode(screenOverlayNode, "size", namespaces.kml);
|
|
2514
|
+
|
|
2515
|
+
let x, y;
|
|
2516
|
+
let xUnit, yUnit;
|
|
2517
|
+
let xStyle, yStyle;
|
|
2518
|
+
|
|
2519
|
+
if (defined(size)) {
|
|
2520
|
+
x = queryNumericAttribute(size, "x");
|
|
2521
|
+
y = queryNumericAttribute(size, "y");
|
|
2522
|
+
xUnit = queryStringAttribute(size, "xunits");
|
|
2523
|
+
yUnit = queryStringAttribute(size, "yunits");
|
|
2524
|
+
|
|
2525
|
+
if (defined(x) && x !== -1 && x !== 0) {
|
|
2526
|
+
if (xUnit === "fraction") {
|
|
2527
|
+
xStyle = `width: ${Math.floor(x * 100)}%`;
|
|
2528
|
+
} else if (xUnit === "pixels") {
|
|
2529
|
+
xStyle = `width: ${x}px`;
|
|
2530
|
+
}
|
|
2531
|
+
|
|
2532
|
+
styles.push(xStyle);
|
|
2533
|
+
}
|
|
2534
|
+
|
|
2535
|
+
if (defined(y) && y !== -1 && y !== 0) {
|
|
2536
|
+
if (yUnit === "fraction") {
|
|
2537
|
+
yStyle = `height: ${Math.floor(y * 100)}%`;
|
|
2538
|
+
} else if (yUnit === "pixels") {
|
|
2539
|
+
yStyle = `height: ${y}px`;
|
|
2540
|
+
}
|
|
2541
|
+
|
|
2542
|
+
styles.push(yStyle);
|
|
2543
|
+
}
|
|
2544
|
+
}
|
|
2545
|
+
|
|
2546
|
+
// set the interim style so the width/height properties get calculated
|
|
2547
|
+
img.style = styles.join(";");
|
|
2548
|
+
|
|
2549
|
+
let xOrigin = 0;
|
|
2550
|
+
let yOrigin = img.height;
|
|
2551
|
+
|
|
2552
|
+
if (defined(overlayXY)) {
|
|
2553
|
+
x = queryNumericAttribute(overlayXY, "x");
|
|
2554
|
+
y = queryNumericAttribute(overlayXY, "y");
|
|
2555
|
+
xUnit = queryStringAttribute(overlayXY, "xunits");
|
|
2556
|
+
yUnit = queryStringAttribute(overlayXY, "yunits");
|
|
2557
|
+
|
|
2558
|
+
if (defined(x)) {
|
|
2559
|
+
if (xUnit === "fraction") {
|
|
2560
|
+
xOrigin = x * img.width;
|
|
2561
|
+
} else if (xUnit === "pixels") {
|
|
2562
|
+
xOrigin = x;
|
|
2563
|
+
} else if (xUnit === "insetPixels") {
|
|
2564
|
+
xOrigin = x;
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
if (defined(y)) {
|
|
2569
|
+
if (yUnit === "fraction") {
|
|
2570
|
+
yOrigin = y * img.height;
|
|
2571
|
+
} else if (yUnit === "pixels") {
|
|
2572
|
+
yOrigin = y;
|
|
2573
|
+
} else if (yUnit === "insetPixels") {
|
|
2574
|
+
yOrigin = y;
|
|
2575
|
+
}
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
if (defined(screenXY)) {
|
|
2580
|
+
x = queryNumericAttribute(screenXY, "x");
|
|
2581
|
+
y = queryNumericAttribute(screenXY, "y");
|
|
2582
|
+
xUnit = queryStringAttribute(screenXY, "xunits");
|
|
2583
|
+
yUnit = queryStringAttribute(screenXY, "yunits");
|
|
2584
|
+
|
|
2585
|
+
if (defined(x)) {
|
|
2586
|
+
if (xUnit === "fraction") {
|
|
2587
|
+
xStyle = `${"left: " + "calc("}${Math.floor(
|
|
2588
|
+
x * 100,
|
|
2589
|
+
)}% - ${xOrigin}px)`;
|
|
2590
|
+
} else if (xUnit === "pixels") {
|
|
2591
|
+
xStyle = `left: ${x - xOrigin}px`;
|
|
2592
|
+
} else if (xUnit === "insetPixels") {
|
|
2593
|
+
xStyle = `right: ${x - xOrigin}px`;
|
|
2594
|
+
}
|
|
2595
|
+
|
|
2596
|
+
styles.push(xStyle);
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
if (defined(y)) {
|
|
2600
|
+
if (yUnit === "fraction") {
|
|
2601
|
+
yStyle = `${"bottom: " + "calc("}${Math.floor(
|
|
2602
|
+
y * 100,
|
|
2603
|
+
)}% - ${yOrigin}px)`;
|
|
2604
|
+
} else if (yUnit === "pixels") {
|
|
2605
|
+
yStyle = `bottom: ${y - yOrigin}px`;
|
|
2606
|
+
} else if (yUnit === "insetPixels") {
|
|
2607
|
+
yStyle = `top: ${y - yOrigin}px`;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
styles.push(yStyle);
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
img.style = styles.join(";");
|
|
2615
|
+
};
|
|
2616
|
+
|
|
2617
|
+
screenOverlay.appendChild(img);
|
|
2618
|
+
}
|
|
2619
|
+
|
|
2620
|
+
function processGroundOverlay(
|
|
2621
|
+
dataSource,
|
|
2622
|
+
groundOverlay,
|
|
2623
|
+
processingData,
|
|
2624
|
+
deferredLoading,
|
|
2625
|
+
) {
|
|
2626
|
+
const r = processFeature(dataSource, groundOverlay, processingData);
|
|
2627
|
+
const entity = r.entity;
|
|
2628
|
+
|
|
2629
|
+
let geometry;
|
|
2630
|
+
let isLatLonQuad = false;
|
|
2631
|
+
|
|
2632
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
2633
|
+
const positions = readCoordinates(
|
|
2634
|
+
queryFirstNode(groundOverlay, "LatLonQuad", namespaces.gx),
|
|
2635
|
+
ellipsoid,
|
|
2636
|
+
);
|
|
2637
|
+
const zIndex = queryNumericValue(groundOverlay, "drawOrder", namespaces.kml);
|
|
2638
|
+
if (defined(positions)) {
|
|
2639
|
+
geometry = createDefaultPolygon();
|
|
2640
|
+
geometry.hierarchy = new PolygonHierarchy(positions);
|
|
2641
|
+
geometry.zIndex = zIndex;
|
|
2642
|
+
entity.polygon = geometry;
|
|
2643
|
+
isLatLonQuad = true;
|
|
2644
|
+
} else {
|
|
2645
|
+
geometry = new RectangleGraphics();
|
|
2646
|
+
geometry.zIndex = zIndex;
|
|
2647
|
+
entity.rectangle = geometry;
|
|
2648
|
+
|
|
2649
|
+
const latLonBox = queryFirstNode(
|
|
2650
|
+
groundOverlay,
|
|
2651
|
+
"LatLonBox",
|
|
2652
|
+
namespaces.kml,
|
|
2653
|
+
);
|
|
2654
|
+
if (defined(latLonBox)) {
|
|
2655
|
+
let west = queryNumericValue(latLonBox, "west", namespaces.kml);
|
|
2656
|
+
let south = queryNumericValue(latLonBox, "south", namespaces.kml);
|
|
2657
|
+
let east = queryNumericValue(latLonBox, "east", namespaces.kml);
|
|
2658
|
+
let north = queryNumericValue(latLonBox, "north", namespaces.kml);
|
|
2659
|
+
|
|
2660
|
+
if (defined(west)) {
|
|
2661
|
+
west = CesiumMath.negativePiToPi(CesiumMath.toRadians(west));
|
|
2662
|
+
}
|
|
2663
|
+
if (defined(south)) {
|
|
2664
|
+
south = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(south));
|
|
2665
|
+
}
|
|
2666
|
+
if (defined(east)) {
|
|
2667
|
+
east = CesiumMath.negativePiToPi(CesiumMath.toRadians(east));
|
|
2668
|
+
}
|
|
2669
|
+
if (defined(north)) {
|
|
2670
|
+
north = CesiumMath.clampToLatitudeRange(CesiumMath.toRadians(north));
|
|
2671
|
+
}
|
|
2672
|
+
geometry.coordinates = new Rectangle(west, south, east, north);
|
|
2673
|
+
|
|
2674
|
+
const rotation = queryNumericValue(latLonBox, "rotation", namespaces.kml);
|
|
2675
|
+
if (defined(rotation)) {
|
|
2676
|
+
const rotationRadians = CesiumMath.toRadians(rotation);
|
|
2677
|
+
geometry.rotation = rotationRadians;
|
|
2678
|
+
geometry.stRotation = rotationRadians;
|
|
2679
|
+
}
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2683
|
+
const iconNode = queryFirstNode(groundOverlay, "Icon", namespaces.kml);
|
|
2684
|
+
const href = getIconHref(
|
|
2685
|
+
iconNode,
|
|
2686
|
+
dataSource,
|
|
2687
|
+
processingData.sourceResource,
|
|
2688
|
+
processingData.uriResolver,
|
|
2689
|
+
true,
|
|
2690
|
+
);
|
|
2691
|
+
if (defined(href)) {
|
|
2692
|
+
if (isLatLonQuad) {
|
|
2693
|
+
oneTimeWarning(
|
|
2694
|
+
"kml-gx:LatLonQuad",
|
|
2695
|
+
"KML - gx:LatLonQuad Icon does not support texture projection.",
|
|
2696
|
+
);
|
|
2697
|
+
}
|
|
2698
|
+
const x = queryNumericValue(iconNode, "x", namespaces.gx);
|
|
2699
|
+
const y = queryNumericValue(iconNode, "y", namespaces.gx);
|
|
2700
|
+
const w = queryNumericValue(iconNode, "w", namespaces.gx);
|
|
2701
|
+
const h = queryNumericValue(iconNode, "h", namespaces.gx);
|
|
2702
|
+
|
|
2703
|
+
if (defined(x) || defined(y) || defined(w) || defined(h)) {
|
|
2704
|
+
oneTimeWarning(
|
|
2705
|
+
"kml-groundOverlay-xywh",
|
|
2706
|
+
"KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays",
|
|
2707
|
+
);
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
geometry.material = href;
|
|
2711
|
+
geometry.material.color = queryColorValue(
|
|
2712
|
+
groundOverlay,
|
|
2713
|
+
"color",
|
|
2714
|
+
namespaces.kml,
|
|
2715
|
+
);
|
|
2716
|
+
geometry.material.transparent = true;
|
|
2717
|
+
} else {
|
|
2718
|
+
geometry.material = queryColorValue(groundOverlay, "color", namespaces.kml);
|
|
2719
|
+
}
|
|
2720
|
+
|
|
2721
|
+
let altitudeMode = queryStringValue(
|
|
2722
|
+
groundOverlay,
|
|
2723
|
+
"altitudeMode",
|
|
2724
|
+
namespaces.kml,
|
|
2725
|
+
);
|
|
2726
|
+
|
|
2727
|
+
if (defined(altitudeMode)) {
|
|
2728
|
+
if (altitudeMode === "absolute") {
|
|
2729
|
+
//Use height above ellipsoid until we support MSL.
|
|
2730
|
+
geometry.height = queryNumericValue(
|
|
2731
|
+
groundOverlay,
|
|
2732
|
+
"altitude",
|
|
2733
|
+
namespaces.kml,
|
|
2734
|
+
);
|
|
2735
|
+
geometry.zIndex = undefined;
|
|
2736
|
+
} else if (altitudeMode !== "clampToGround") {
|
|
2737
|
+
oneTimeWarning(
|
|
2738
|
+
"kml-altitudeMode-unknown",
|
|
2739
|
+
`KML - Unknown altitudeMode: ${altitudeMode}`,
|
|
2740
|
+
);
|
|
2741
|
+
}
|
|
2742
|
+
// else just use the default of 0 until we support 'clampToGround'
|
|
2743
|
+
} else {
|
|
2744
|
+
altitudeMode = queryStringValue(
|
|
2745
|
+
groundOverlay,
|
|
2746
|
+
"altitudeMode",
|
|
2747
|
+
namespaces.gx,
|
|
2748
|
+
);
|
|
2749
|
+
if (altitudeMode === "relativeToSeaFloor") {
|
|
2750
|
+
oneTimeWarning(
|
|
2751
|
+
"kml-altitudeMode-relativeToSeaFloor",
|
|
2752
|
+
"KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute.",
|
|
2753
|
+
);
|
|
2754
|
+
geometry.height = queryNumericValue(
|
|
2755
|
+
groundOverlay,
|
|
2756
|
+
"altitude",
|
|
2757
|
+
namespaces.kml,
|
|
2758
|
+
);
|
|
2759
|
+
geometry.zIndex = undefined;
|
|
2760
|
+
} else if (altitudeMode === "clampToSeaFloor") {
|
|
2761
|
+
oneTimeWarning(
|
|
2762
|
+
"kml-altitudeMode-clampToSeaFloor",
|
|
2763
|
+
"KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround.",
|
|
2764
|
+
);
|
|
2765
|
+
} else if (defined(altitudeMode)) {
|
|
2766
|
+
oneTimeWarning(
|
|
2767
|
+
"kml-altitudeMode-unknown",
|
|
2768
|
+
`KML - Unknown altitudeMode: ${altitudeMode}`,
|
|
2769
|
+
);
|
|
2770
|
+
}
|
|
2771
|
+
}
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2774
|
+
function processUnsupportedFeature(
|
|
2775
|
+
dataSource,
|
|
2776
|
+
node,
|
|
2777
|
+
processingData,
|
|
2778
|
+
deferredLoading,
|
|
2779
|
+
) {
|
|
2780
|
+
dataSource._unsupportedNode.raiseEvent(
|
|
2781
|
+
dataSource,
|
|
2782
|
+
processingData.parentEntity,
|
|
2783
|
+
node,
|
|
2784
|
+
processingData.entityCollection,
|
|
2785
|
+
processingData.styleCollection,
|
|
2786
|
+
processingData.sourceResource,
|
|
2787
|
+
processingData.uriResolver,
|
|
2788
|
+
);
|
|
2789
|
+
oneTimeWarning(
|
|
2790
|
+
`kml-unsupportedFeature-${node.nodeName}`,
|
|
2791
|
+
`KML - Unsupported feature: ${node.nodeName}`,
|
|
2792
|
+
);
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
const RefreshMode = {
|
|
2796
|
+
INTERVAL: 0,
|
|
2797
|
+
EXPIRE: 1,
|
|
2798
|
+
STOP: 2,
|
|
2799
|
+
};
|
|
2800
|
+
|
|
2801
|
+
function cleanupString(s) {
|
|
2802
|
+
if (!defined(s) || s.length === 0) {
|
|
2803
|
+
return "";
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
const sFirst = s[0];
|
|
2807
|
+
if (sFirst === "&" || sFirst === "?") {
|
|
2808
|
+
s = s.substring(1);
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
return s;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
const zeroRectangle = new Rectangle();
|
|
2815
|
+
const scratchCartographic = new Cartographic();
|
|
2816
|
+
const scratchCartesian2 = new Cartesian2();
|
|
2817
|
+
const scratchCartesian3 = new Cartesian3();
|
|
2818
|
+
|
|
2819
|
+
function processNetworkLinkQueryString(
|
|
2820
|
+
resource,
|
|
2821
|
+
camera,
|
|
2822
|
+
canvas,
|
|
2823
|
+
viewBoundScale,
|
|
2824
|
+
bbox,
|
|
2825
|
+
ellipsoid,
|
|
2826
|
+
) {
|
|
2827
|
+
function fixLatitude(value) {
|
|
2828
|
+
if (value < -CesiumMath.PI_OVER_TWO) {
|
|
2829
|
+
return -CesiumMath.PI_OVER_TWO;
|
|
2830
|
+
} else if (value > CesiumMath.PI_OVER_TWO) {
|
|
2831
|
+
return CesiumMath.PI_OVER_TWO;
|
|
2832
|
+
}
|
|
2833
|
+
return value;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
function fixLongitude(value) {
|
|
2837
|
+
if (value > CesiumMath.PI) {
|
|
2838
|
+
return value - CesiumMath.TWO_PI;
|
|
2839
|
+
} else if (value < -CesiumMath.PI) {
|
|
2840
|
+
return value + CesiumMath.TWO_PI;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
return value;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
let queryString = objectToQuery(resource.queryParameters);
|
|
2847
|
+
|
|
2848
|
+
// objectToQuery escapes [ and ], so fix that
|
|
2849
|
+
queryString = queryString.replace(/%5B/g, "[").replace(/%5D/g, "]");
|
|
2850
|
+
|
|
2851
|
+
if (defined(camera) && camera._mode !== SceneMode.MORPHING) {
|
|
2852
|
+
let centerCartesian;
|
|
2853
|
+
let centerCartographic;
|
|
2854
|
+
|
|
2855
|
+
bbox = bbox ?? zeroRectangle;
|
|
2856
|
+
if (defined(canvas)) {
|
|
2857
|
+
scratchCartesian2.x = canvas.clientWidth * 0.5;
|
|
2858
|
+
scratchCartesian2.y = canvas.clientHeight * 0.5;
|
|
2859
|
+
centerCartesian = camera.pickEllipsoid(
|
|
2860
|
+
scratchCartesian2,
|
|
2861
|
+
ellipsoid,
|
|
2862
|
+
scratchCartesian3,
|
|
2863
|
+
);
|
|
2864
|
+
}
|
|
2865
|
+
|
|
2866
|
+
if (defined(centerCartesian)) {
|
|
2867
|
+
centerCartographic = ellipsoid.cartesianToCartographic(
|
|
2868
|
+
centerCartesian,
|
|
2869
|
+
scratchCartographic,
|
|
2870
|
+
);
|
|
2871
|
+
} else {
|
|
2872
|
+
centerCartographic = Rectangle.center(bbox, scratchCartographic);
|
|
2873
|
+
centerCartesian = ellipsoid.cartographicToCartesian(centerCartographic);
|
|
2874
|
+
}
|
|
2875
|
+
|
|
2876
|
+
if (
|
|
2877
|
+
defined(viewBoundScale) &&
|
|
2878
|
+
!CesiumMath.equalsEpsilon(viewBoundScale, 1.0, CesiumMath.EPSILON9)
|
|
2879
|
+
) {
|
|
2880
|
+
const newHalfWidth = bbox.width * viewBoundScale * 0.5;
|
|
2881
|
+
const newHalfHeight = bbox.height * viewBoundScale * 0.5;
|
|
2882
|
+
bbox = new Rectangle(
|
|
2883
|
+
fixLongitude(centerCartographic.longitude - newHalfWidth),
|
|
2884
|
+
fixLatitude(centerCartographic.latitude - newHalfHeight),
|
|
2885
|
+
fixLongitude(centerCartographic.longitude + newHalfWidth),
|
|
2886
|
+
fixLatitude(centerCartographic.latitude + newHalfHeight),
|
|
2887
|
+
);
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
queryString = queryString.replace(
|
|
2891
|
+
"[bboxWest]",
|
|
2892
|
+
CesiumMath.toDegrees(bbox.west).toString(),
|
|
2893
|
+
);
|
|
2894
|
+
queryString = queryString.replace(
|
|
2895
|
+
"[bboxSouth]",
|
|
2896
|
+
CesiumMath.toDegrees(bbox.south).toString(),
|
|
2897
|
+
);
|
|
2898
|
+
queryString = queryString.replace(
|
|
2899
|
+
"[bboxEast]",
|
|
2900
|
+
CesiumMath.toDegrees(bbox.east).toString(),
|
|
2901
|
+
);
|
|
2902
|
+
queryString = queryString.replace(
|
|
2903
|
+
"[bboxNorth]",
|
|
2904
|
+
CesiumMath.toDegrees(bbox.north).toString(),
|
|
2905
|
+
);
|
|
2906
|
+
|
|
2907
|
+
const lon = CesiumMath.toDegrees(centerCartographic.longitude).toString();
|
|
2908
|
+
const lat = CesiumMath.toDegrees(centerCartographic.latitude).toString();
|
|
2909
|
+
queryString = queryString.replace("[lookatLon]", lon);
|
|
2910
|
+
queryString = queryString.replace("[lookatLat]", lat);
|
|
2911
|
+
queryString = queryString.replace(
|
|
2912
|
+
"[lookatTilt]",
|
|
2913
|
+
CesiumMath.toDegrees(camera.pitch).toString(),
|
|
2914
|
+
);
|
|
2915
|
+
queryString = queryString.replace(
|
|
2916
|
+
"[lookatHeading]",
|
|
2917
|
+
CesiumMath.toDegrees(camera.heading).toString(),
|
|
2918
|
+
);
|
|
2919
|
+
queryString = queryString.replace(
|
|
2920
|
+
"[lookatRange]",
|
|
2921
|
+
Cartesian3.distance(camera.positionWC, centerCartesian),
|
|
2922
|
+
);
|
|
2923
|
+
queryString = queryString.replace("[lookatTerrainLon]", lon);
|
|
2924
|
+
queryString = queryString.replace("[lookatTerrainLat]", lat);
|
|
2925
|
+
queryString = queryString.replace(
|
|
2926
|
+
"[lookatTerrainAlt]",
|
|
2927
|
+
centerCartographic.height.toString(),
|
|
2928
|
+
);
|
|
2929
|
+
|
|
2930
|
+
ellipsoid.cartesianToCartographic(camera.positionWC, scratchCartographic);
|
|
2931
|
+
queryString = queryString.replace(
|
|
2932
|
+
"[cameraLon]",
|
|
2933
|
+
CesiumMath.toDegrees(scratchCartographic.longitude).toString(),
|
|
2934
|
+
);
|
|
2935
|
+
queryString = queryString.replace(
|
|
2936
|
+
"[cameraLat]",
|
|
2937
|
+
CesiumMath.toDegrees(scratchCartographic.latitude).toString(),
|
|
2938
|
+
);
|
|
2939
|
+
queryString = queryString.replace(
|
|
2940
|
+
"[cameraAlt]",
|
|
2941
|
+
CesiumMath.toDegrees(scratchCartographic.height).toString(),
|
|
2942
|
+
);
|
|
2943
|
+
|
|
2944
|
+
const frustum = camera.frustum;
|
|
2945
|
+
const aspectRatio = frustum.aspectRatio;
|
|
2946
|
+
let horizFov = "";
|
|
2947
|
+
let vertFov = "";
|
|
2948
|
+
if (defined(aspectRatio)) {
|
|
2949
|
+
const fov = CesiumMath.toDegrees(frustum.fov);
|
|
2950
|
+
if (aspectRatio > 1.0) {
|
|
2951
|
+
horizFov = fov;
|
|
2952
|
+
vertFov = fov / aspectRatio;
|
|
2953
|
+
} else {
|
|
2954
|
+
vertFov = fov;
|
|
2955
|
+
horizFov = fov * aspectRatio;
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
queryString = queryString.replace("[horizFov]", horizFov.toString());
|
|
2959
|
+
queryString = queryString.replace("[vertFov]", vertFov.toString());
|
|
2960
|
+
} else {
|
|
2961
|
+
queryString = queryString.replace("[bboxWest]", "-180");
|
|
2962
|
+
queryString = queryString.replace("[bboxSouth]", "-90");
|
|
2963
|
+
queryString = queryString.replace("[bboxEast]", "180");
|
|
2964
|
+
queryString = queryString.replace("[bboxNorth]", "90");
|
|
2965
|
+
|
|
2966
|
+
queryString = queryString.replace("[lookatLon]", "");
|
|
2967
|
+
queryString = queryString.replace("[lookatLat]", "");
|
|
2968
|
+
queryString = queryString.replace("[lookatRange]", "");
|
|
2969
|
+
queryString = queryString.replace("[lookatTilt]", "");
|
|
2970
|
+
queryString = queryString.replace("[lookatHeading]", "");
|
|
2971
|
+
queryString = queryString.replace("[lookatTerrainLon]", "");
|
|
2972
|
+
queryString = queryString.replace("[lookatTerrainLat]", "");
|
|
2973
|
+
queryString = queryString.replace("[lookatTerrainAlt]", "");
|
|
2974
|
+
|
|
2975
|
+
queryString = queryString.replace("[cameraLon]", "");
|
|
2976
|
+
queryString = queryString.replace("[cameraLat]", "");
|
|
2977
|
+
queryString = queryString.replace("[cameraAlt]", "");
|
|
2978
|
+
queryString = queryString.replace("[horizFov]", "");
|
|
2979
|
+
queryString = queryString.replace("[vertFov]", "");
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
if (defined(canvas)) {
|
|
2983
|
+
queryString = queryString.replace("[horizPixels]", canvas.clientWidth);
|
|
2984
|
+
queryString = queryString.replace("[vertPixels]", canvas.clientHeight);
|
|
2985
|
+
} else {
|
|
2986
|
+
queryString = queryString.replace("[horizPixels]", "");
|
|
2987
|
+
queryString = queryString.replace("[vertPixels]", "");
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
queryString = queryString.replace("[terrainEnabled]", "1");
|
|
2991
|
+
queryString = queryString.replace("[clientVersion]", "1");
|
|
2992
|
+
queryString = queryString.replace("[kmlVersion]", "2.2");
|
|
2993
|
+
queryString = queryString.replace("[clientName]", "Cesium");
|
|
2994
|
+
queryString = queryString.replace("[language]", "English");
|
|
2995
|
+
|
|
2996
|
+
resource.setQueryParameters(queryToObject(queryString));
|
|
2997
|
+
}
|
|
2998
|
+
|
|
2999
|
+
function processNetworkLink(dataSource, node, processingData, deferredLoading) {
|
|
3000
|
+
const r = processFeature(dataSource, node, processingData);
|
|
3001
|
+
const networkEntity = r.entity;
|
|
3002
|
+
|
|
3003
|
+
const sourceResource = processingData.sourceResource;
|
|
3004
|
+
const uriResolver = processingData.uriResolver;
|
|
3005
|
+
|
|
3006
|
+
let link = queryFirstNode(node, "Link", namespaces.kml);
|
|
3007
|
+
|
|
3008
|
+
if (!defined(link)) {
|
|
3009
|
+
link = queryFirstNode(node, "Url", namespaces.kml);
|
|
3010
|
+
}
|
|
3011
|
+
if (defined(link)) {
|
|
3012
|
+
let href = queryStringValue(link, "href", namespaces.kml);
|
|
3013
|
+
let viewRefreshMode;
|
|
3014
|
+
let viewBoundScale;
|
|
3015
|
+
if (defined(href)) {
|
|
3016
|
+
let newSourceUri = href;
|
|
3017
|
+
href = resolveHref(href, sourceResource, processingData.uriResolver);
|
|
3018
|
+
|
|
3019
|
+
// We need to pass in the original path if resolveHref returns a data uri because the network link
|
|
3020
|
+
// references a document in a KMZ archive
|
|
3021
|
+
if (/^data:/.test(href.getUrlComponent())) {
|
|
3022
|
+
// So if sourceUri isn't the kmz file, then its another kml in the archive, so resolve it
|
|
3023
|
+
if (!/\.kmz/i.test(sourceResource.getUrlComponent())) {
|
|
3024
|
+
newSourceUri = sourceResource.getDerivedResource({
|
|
3025
|
+
url: newSourceUri,
|
|
3026
|
+
});
|
|
3027
|
+
}
|
|
3028
|
+
} else {
|
|
3029
|
+
newSourceUri = href.clone(); // Not a data uri so use the fully qualified uri
|
|
3030
|
+
viewRefreshMode = queryStringValue(
|
|
3031
|
+
link,
|
|
3032
|
+
"viewRefreshMode",
|
|
3033
|
+
namespaces.kml,
|
|
3034
|
+
);
|
|
3035
|
+
if (viewRefreshMode === "onRegion") {
|
|
3036
|
+
oneTimeWarning(
|
|
3037
|
+
"kml-refrehMode-onRegion",
|
|
3038
|
+
"KML - Unsupported viewRefreshMode: onRegion",
|
|
3039
|
+
);
|
|
3040
|
+
return;
|
|
3041
|
+
}
|
|
3042
|
+
viewBoundScale =
|
|
3043
|
+
queryStringValue(link, "viewBoundScale", namespaces.kml) ?? 1.0;
|
|
3044
|
+
const defaultViewFormat =
|
|
3045
|
+
viewRefreshMode === "onStop"
|
|
3046
|
+
? "BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]"
|
|
3047
|
+
: "";
|
|
3048
|
+
const viewFormat =
|
|
3049
|
+
queryStringValue(link, "viewFormat", namespaces.kml) ??
|
|
3050
|
+
defaultViewFormat;
|
|
3051
|
+
const httpQuery = queryStringValue(link, "httpQuery", namespaces.kml);
|
|
3052
|
+
if (defined(viewFormat)) {
|
|
3053
|
+
href.setQueryParameters(queryToObject(cleanupString(viewFormat)));
|
|
3054
|
+
}
|
|
3055
|
+
if (defined(httpQuery)) {
|
|
3056
|
+
href.setQueryParameters(queryToObject(cleanupString(httpQuery)));
|
|
3057
|
+
}
|
|
3058
|
+
|
|
3059
|
+
const ellipsoid = dataSource._ellipsoid;
|
|
3060
|
+
processNetworkLinkQueryString(
|
|
3061
|
+
href,
|
|
3062
|
+
dataSource.camera,
|
|
3063
|
+
dataSource.canvas,
|
|
3064
|
+
viewBoundScale,
|
|
3065
|
+
dataSource._lastCameraView.bbox,
|
|
3066
|
+
ellipsoid,
|
|
3067
|
+
);
|
|
3068
|
+
}
|
|
3069
|
+
|
|
3070
|
+
const options = {
|
|
3071
|
+
sourceUri: newSourceUri,
|
|
3072
|
+
uriResolver: uriResolver,
|
|
3073
|
+
context: networkEntity.id,
|
|
3074
|
+
screenOverlayContainer: processingData.screenOverlayContainer,
|
|
3075
|
+
};
|
|
3076
|
+
const networkLinkCollection = new EntityCollection();
|
|
3077
|
+
const promise = load(dataSource, networkLinkCollection, href, options)
|
|
3078
|
+
.then(function (rootElement) {
|
|
3079
|
+
const entities = dataSource._entityCollection;
|
|
3080
|
+
const newEntities = networkLinkCollection.values;
|
|
3081
|
+
entities.suspendEvents();
|
|
3082
|
+
for (let i = 0; i < newEntities.length; i++) {
|
|
3083
|
+
const newEntity = newEntities[i];
|
|
3084
|
+
if (!defined(newEntity.parent)) {
|
|
3085
|
+
newEntity.parent = networkEntity;
|
|
3086
|
+
mergeAvailabilityWithParent(newEntity);
|
|
3087
|
+
}
|
|
3088
|
+
|
|
3089
|
+
entities.add(newEntity);
|
|
3090
|
+
}
|
|
3091
|
+
entities.resumeEvents();
|
|
3092
|
+
|
|
3093
|
+
// Add network links to a list if we need they will need to be updated
|
|
3094
|
+
const refreshMode = queryStringValue(
|
|
3095
|
+
link,
|
|
3096
|
+
"refreshMode",
|
|
3097
|
+
namespaces.kml,
|
|
3098
|
+
);
|
|
3099
|
+
let refreshInterval =
|
|
3100
|
+
queryNumericValue(link, "refreshInterval", namespaces.kml) ?? 0;
|
|
3101
|
+
if (
|
|
3102
|
+
(refreshMode === "onInterval" && refreshInterval > 0) ||
|
|
3103
|
+
refreshMode === "onExpire" ||
|
|
3104
|
+
viewRefreshMode === "onStop"
|
|
3105
|
+
) {
|
|
3106
|
+
const networkLinkControl = queryFirstNode(
|
|
3107
|
+
rootElement,
|
|
3108
|
+
"NetworkLinkControl",
|
|
3109
|
+
namespaces.kml,
|
|
3110
|
+
);
|
|
3111
|
+
const hasNetworkLinkControl = defined(networkLinkControl);
|
|
3112
|
+
|
|
3113
|
+
const now = JulianDate.now();
|
|
3114
|
+
const networkLinkInfo = {
|
|
3115
|
+
id: createGuid(),
|
|
3116
|
+
href: href,
|
|
3117
|
+
cookie: {},
|
|
3118
|
+
lastUpdated: now,
|
|
3119
|
+
updating: false,
|
|
3120
|
+
entity: networkEntity,
|
|
3121
|
+
viewBoundScale: viewBoundScale,
|
|
3122
|
+
needsUpdate: false,
|
|
3123
|
+
cameraUpdateTime: now,
|
|
3124
|
+
};
|
|
3125
|
+
|
|
3126
|
+
let minRefreshPeriod = 0;
|
|
3127
|
+
if (hasNetworkLinkControl) {
|
|
3128
|
+
networkLinkInfo.cookie = queryToObject(
|
|
3129
|
+
queryStringValue(
|
|
3130
|
+
networkLinkControl,
|
|
3131
|
+
"cookie",
|
|
3132
|
+
namespaces.kml,
|
|
3133
|
+
) ?? "",
|
|
3134
|
+
);
|
|
3135
|
+
minRefreshPeriod =
|
|
3136
|
+
queryNumericValue(
|
|
3137
|
+
networkLinkControl,
|
|
3138
|
+
"minRefreshPeriod",
|
|
3139
|
+
namespaces.kml,
|
|
3140
|
+
) ?? 0;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
if (refreshMode === "onInterval") {
|
|
3144
|
+
if (hasNetworkLinkControl) {
|
|
3145
|
+
refreshInterval = Math.max(minRefreshPeriod, refreshInterval);
|
|
3146
|
+
}
|
|
3147
|
+
networkLinkInfo.refreshMode = RefreshMode.INTERVAL;
|
|
3148
|
+
networkLinkInfo.time = refreshInterval;
|
|
3149
|
+
} else if (refreshMode === "onExpire") {
|
|
3150
|
+
let expires;
|
|
3151
|
+
if (hasNetworkLinkControl) {
|
|
3152
|
+
expires = queryStringValue(
|
|
3153
|
+
networkLinkControl,
|
|
3154
|
+
"expires",
|
|
3155
|
+
namespaces.kml,
|
|
3156
|
+
);
|
|
3157
|
+
}
|
|
3158
|
+
if (defined(expires)) {
|
|
3159
|
+
try {
|
|
3160
|
+
const date = JulianDate.fromIso8601(expires);
|
|
3161
|
+
const diff = JulianDate.secondsDifference(date, now);
|
|
3162
|
+
if (diff > 0 && diff < minRefreshPeriod) {
|
|
3163
|
+
JulianDate.addSeconds(now, minRefreshPeriod, date);
|
|
3164
|
+
}
|
|
3165
|
+
networkLinkInfo.refreshMode = RefreshMode.EXPIRE;
|
|
3166
|
+
networkLinkInfo.time = date;
|
|
3167
|
+
} catch (e) {
|
|
3168
|
+
oneTimeWarning(
|
|
3169
|
+
"kml-refreshMode-onInterval-onExpire",
|
|
3170
|
+
"KML - NetworkLinkControl expires is not a valid date",
|
|
3171
|
+
);
|
|
3172
|
+
}
|
|
3173
|
+
} else {
|
|
3174
|
+
oneTimeWarning(
|
|
3175
|
+
"kml-refreshMode-onExpire",
|
|
3176
|
+
"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element",
|
|
3177
|
+
);
|
|
3178
|
+
}
|
|
3179
|
+
} else if (defined(dataSource.camera)) {
|
|
3180
|
+
// Only allow onStop refreshes if we have a camera
|
|
3181
|
+
networkLinkInfo.refreshMode = RefreshMode.STOP;
|
|
3182
|
+
networkLinkInfo.time =
|
|
3183
|
+
queryNumericValue(link, "viewRefreshTime", namespaces.kml) ?? 0;
|
|
3184
|
+
} else {
|
|
3185
|
+
oneTimeWarning(
|
|
3186
|
+
"kml-refrehMode-onStop-noCamera",
|
|
3187
|
+
"A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.",
|
|
3188
|
+
);
|
|
3189
|
+
}
|
|
3190
|
+
|
|
3191
|
+
if (defined(networkLinkInfo.refreshMode)) {
|
|
3192
|
+
dataSource._networkLinks.set(networkLinkInfo.id, networkLinkInfo);
|
|
3193
|
+
}
|
|
3194
|
+
}
|
|
3195
|
+
})
|
|
3196
|
+
.catch(function (error) {
|
|
3197
|
+
oneTimeWarning(`An error occured during loading ${href.url}`);
|
|
3198
|
+
dataSource._error.raiseEvent(dataSource, error);
|
|
3199
|
+
});
|
|
3200
|
+
|
|
3201
|
+
deferredLoading.addPromise(promise);
|
|
3202
|
+
}
|
|
3203
|
+
}
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
function processFeatureNode(dataSource, node, processingData, deferredLoading) {
|
|
3207
|
+
const featureProcessor = featureTypes[node.localName];
|
|
3208
|
+
if (defined(featureProcessor)) {
|
|
3209
|
+
return featureProcessor(dataSource, node, processingData, deferredLoading);
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
return processUnsupportedFeature(
|
|
3213
|
+
dataSource,
|
|
3214
|
+
node,
|
|
3215
|
+
processingData,
|
|
3216
|
+
deferredLoading,
|
|
3217
|
+
);
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
function loadKml(
|
|
3221
|
+
dataSource,
|
|
3222
|
+
entityCollection,
|
|
3223
|
+
kml,
|
|
3224
|
+
sourceResource,
|
|
3225
|
+
uriResolver,
|
|
3226
|
+
screenOverlayContainer,
|
|
3227
|
+
context,
|
|
3228
|
+
) {
|
|
3229
|
+
entityCollection.removeAll();
|
|
3230
|
+
|
|
3231
|
+
const documentElement = kml.documentElement;
|
|
3232
|
+
const document =
|
|
3233
|
+
documentElement.localName === "Document"
|
|
3234
|
+
? documentElement
|
|
3235
|
+
: queryFirstNode(documentElement, "Document", namespaces.kml);
|
|
3236
|
+
let name = queryStringValue(document, "name", namespaces.kml);
|
|
3237
|
+
if (!defined(name)) {
|
|
3238
|
+
name = getFilenameFromUri(sourceResource.getUrlComponent());
|
|
3239
|
+
}
|
|
3240
|
+
|
|
3241
|
+
// Only set the name from the root document
|
|
3242
|
+
if (!defined(dataSource._name)) {
|
|
3243
|
+
dataSource._name = name;
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
const deferredLoading = new KmlDataSource._DeferredLoading(dataSource);
|
|
3247
|
+
const styleCollection = new EntityCollection(dataSource);
|
|
3248
|
+
return Promise.all(
|
|
3249
|
+
processStyles(
|
|
3250
|
+
dataSource,
|
|
3251
|
+
kml,
|
|
3252
|
+
styleCollection,
|
|
3253
|
+
sourceResource,
|
|
3254
|
+
false,
|
|
3255
|
+
uriResolver,
|
|
3256
|
+
),
|
|
3257
|
+
).then(function () {
|
|
3258
|
+
let element = kml.documentElement;
|
|
3259
|
+
if (element.localName === "kml") {
|
|
3260
|
+
const childNodes = element.childNodes;
|
|
3261
|
+
for (let i = 0; i < childNodes.length; i++) {
|
|
3262
|
+
const tmp = childNodes[i];
|
|
3263
|
+
if (defined(featureTypes[tmp.localName])) {
|
|
3264
|
+
element = tmp;
|
|
3265
|
+
break;
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
}
|
|
3269
|
+
|
|
3270
|
+
const processingData = {
|
|
3271
|
+
parentEntity: undefined,
|
|
3272
|
+
entityCollection: entityCollection,
|
|
3273
|
+
styleCollection: styleCollection,
|
|
3274
|
+
sourceResource: sourceResource,
|
|
3275
|
+
uriResolver: uriResolver,
|
|
3276
|
+
context: context,
|
|
3277
|
+
screenOverlayContainer: screenOverlayContainer,
|
|
3278
|
+
};
|
|
3279
|
+
|
|
3280
|
+
entityCollection.suspendEvents();
|
|
3281
|
+
processFeatureNode(dataSource, element, processingData, deferredLoading);
|
|
3282
|
+
entityCollection.resumeEvents();
|
|
3283
|
+
|
|
3284
|
+
return deferredLoading.wait().then(function () {
|
|
3285
|
+
return kml.documentElement;
|
|
3286
|
+
});
|
|
3287
|
+
});
|
|
3288
|
+
}
|
|
3289
|
+
|
|
3290
|
+
async function loadKmz(
|
|
3291
|
+
dataSource,
|
|
3292
|
+
entityCollection,
|
|
3293
|
+
blob,
|
|
3294
|
+
sourceResource,
|
|
3295
|
+
screenOverlayContainer,
|
|
3296
|
+
) {
|
|
3297
|
+
const zWorkerUri = buildModuleUrl("ThirdParty/Workers/zip-web-worker.js");
|
|
3298
|
+
const zWasmUri = buildModuleUrl("ThirdParty/zip-module.wasm");
|
|
3299
|
+
configure({
|
|
3300
|
+
workerURI: zWorkerUri,
|
|
3301
|
+
wasmURI: zWasmUri,
|
|
3302
|
+
});
|
|
3303
|
+
|
|
3304
|
+
const reader = new ZipReader(new BlobReader(blob));
|
|
3305
|
+
const entries = await reader.getEntries();
|
|
3306
|
+
|
|
3307
|
+
const promises = [];
|
|
3308
|
+
const uriResolver = {};
|
|
3309
|
+
let docEntry;
|
|
3310
|
+
for (let i = 0; i < entries.length; i++) {
|
|
3311
|
+
const entry = entries[i];
|
|
3312
|
+
if (!entry.directory) {
|
|
3313
|
+
if (/\.kml$/i.test(entry.filename)) {
|
|
3314
|
+
// We use the first KML document we come across
|
|
3315
|
+
// https://developers.google.com/kml/documentation/kmzarchives
|
|
3316
|
+
// Unless we come across a .kml file at the root of the archive because GE does this
|
|
3317
|
+
if (!defined(docEntry) || !/\//i.test(entry.filename)) {
|
|
3318
|
+
if (defined(docEntry)) {
|
|
3319
|
+
// We found one at the root so load the initial kml as a data uri
|
|
3320
|
+
promises.push(loadDataUriFromZip(docEntry, uriResolver));
|
|
3321
|
+
}
|
|
3322
|
+
docEntry = entry;
|
|
3323
|
+
} else {
|
|
3324
|
+
// Wasn't the first kml and wasn't at the root
|
|
3325
|
+
promises.push(loadDataUriFromZip(entry, uriResolver));
|
|
3326
|
+
}
|
|
3327
|
+
} else {
|
|
3328
|
+
promises.push(loadDataUriFromZip(entry, uriResolver));
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
// Now load the root KML document
|
|
3334
|
+
if (defined(docEntry)) {
|
|
3335
|
+
promises.push(loadXmlFromZip(docEntry, uriResolver));
|
|
3336
|
+
}
|
|
3337
|
+
await Promise.all(promises);
|
|
3338
|
+
reader.close();
|
|
3339
|
+
if (!defined(uriResolver.kml)) {
|
|
3340
|
+
throw new RuntimeError("KMZ file does not contain a KML document.");
|
|
3341
|
+
}
|
|
3342
|
+
uriResolver.keys = Object.keys(uriResolver);
|
|
3343
|
+
|
|
3344
|
+
return loadKml(
|
|
3345
|
+
dataSource,
|
|
3346
|
+
entityCollection,
|
|
3347
|
+
uriResolver.kml,
|
|
3348
|
+
sourceResource,
|
|
3349
|
+
uriResolver,
|
|
3350
|
+
screenOverlayContainer,
|
|
3351
|
+
);
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
function load(dataSource, entityCollection, data, options) {
|
|
3355
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3356
|
+
let sourceUri = options.sourceUri;
|
|
3357
|
+
const uriResolver = options.uriResolver;
|
|
3358
|
+
const context = options.context;
|
|
3359
|
+
let screenOverlayContainer = options.screenOverlayContainer;
|
|
3360
|
+
|
|
3361
|
+
let promise = data;
|
|
3362
|
+
if (typeof data === "string" || data instanceof Resource) {
|
|
3363
|
+
data = Resource.createIfNeeded(data);
|
|
3364
|
+
promise = data.fetchBlob();
|
|
3365
|
+
sourceUri = sourceUri ?? data.clone();
|
|
3366
|
+
|
|
3367
|
+
// Add resource credits to our list of credits to display
|
|
3368
|
+
const resourceCredits = dataSource._resourceCredits;
|
|
3369
|
+
const credits = data.credits;
|
|
3370
|
+
if (defined(credits)) {
|
|
3371
|
+
const length = credits.length;
|
|
3372
|
+
for (let i = 0; i < length; i++) {
|
|
3373
|
+
resourceCredits.push(credits[i]);
|
|
3374
|
+
}
|
|
3375
|
+
}
|
|
3376
|
+
} else {
|
|
3377
|
+
sourceUri = sourceUri ?? Resource.DEFAULT.clone();
|
|
3378
|
+
}
|
|
3379
|
+
|
|
3380
|
+
sourceUri = Resource.createIfNeeded(sourceUri);
|
|
3381
|
+
|
|
3382
|
+
if (defined(screenOverlayContainer)) {
|
|
3383
|
+
screenOverlayContainer = getElement(screenOverlayContainer);
|
|
3384
|
+
}
|
|
3385
|
+
|
|
3386
|
+
return Promise.resolve(promise)
|
|
3387
|
+
.then(function (dataToLoad) {
|
|
3388
|
+
if (dataToLoad instanceof Blob) {
|
|
3389
|
+
return isZipFile(dataToLoad).then(function (isZip) {
|
|
3390
|
+
if (isZip) {
|
|
3391
|
+
return loadKmz(
|
|
3392
|
+
dataSource,
|
|
3393
|
+
entityCollection,
|
|
3394
|
+
dataToLoad,
|
|
3395
|
+
sourceUri,
|
|
3396
|
+
screenOverlayContainer,
|
|
3397
|
+
);
|
|
3398
|
+
}
|
|
3399
|
+
return readBlobAsText(dataToLoad).then(function (text) {
|
|
3400
|
+
//There's no official way to validate if a parse was successful.
|
|
3401
|
+
//The following check detects the error on various browsers.
|
|
3402
|
+
|
|
3403
|
+
//Insert missing namespaces
|
|
3404
|
+
text = insertNamespaces(text);
|
|
3405
|
+
|
|
3406
|
+
//Remove Duplicate Namespaces
|
|
3407
|
+
text = removeDuplicateNamespaces(text);
|
|
3408
|
+
|
|
3409
|
+
//IE raises an exception
|
|
3410
|
+
let kml;
|
|
3411
|
+
let error;
|
|
3412
|
+
try {
|
|
3413
|
+
kml = parser.parseFromString(text, "application/xml");
|
|
3414
|
+
} catch (e) {
|
|
3415
|
+
error = e.toString();
|
|
3416
|
+
}
|
|
3417
|
+
|
|
3418
|
+
//The parse succeeds on Chrome and Firefox, but the error
|
|
3419
|
+
//handling is different in each.
|
|
3420
|
+
if (
|
|
3421
|
+
defined(error) ||
|
|
3422
|
+
kml.body ||
|
|
3423
|
+
kml.documentElement.tagName === "parsererror"
|
|
3424
|
+
) {
|
|
3425
|
+
//Firefox has error information as the firstChild nodeValue.
|
|
3426
|
+
let msg = defined(error)
|
|
3427
|
+
? error
|
|
3428
|
+
: kml.documentElement.firstChild.nodeValue;
|
|
3429
|
+
|
|
3430
|
+
//Chrome has it in the body text.
|
|
3431
|
+
if (!msg) {
|
|
3432
|
+
msg = kml.body.innerText;
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
//Return the error
|
|
3436
|
+
throw new RuntimeError(msg);
|
|
3437
|
+
}
|
|
3438
|
+
return loadKml(
|
|
3439
|
+
dataSource,
|
|
3440
|
+
entityCollection,
|
|
3441
|
+
kml,
|
|
3442
|
+
sourceUri,
|
|
3443
|
+
uriResolver,
|
|
3444
|
+
screenOverlayContainer,
|
|
3445
|
+
context,
|
|
3446
|
+
);
|
|
3447
|
+
});
|
|
3448
|
+
});
|
|
3449
|
+
}
|
|
3450
|
+
return loadKml(
|
|
3451
|
+
dataSource,
|
|
3452
|
+
entityCollection,
|
|
3453
|
+
dataToLoad,
|
|
3454
|
+
sourceUri,
|
|
3455
|
+
uriResolver,
|
|
3456
|
+
screenOverlayContainer,
|
|
3457
|
+
context,
|
|
3458
|
+
);
|
|
3459
|
+
})
|
|
3460
|
+
.catch(function (error) {
|
|
3461
|
+
dataSource._error.raiseEvent(dataSource, error);
|
|
3462
|
+
console.log(error);
|
|
3463
|
+
return Promise.reject(error);
|
|
3464
|
+
});
|
|
3465
|
+
}
|
|
3466
|
+
|
|
3467
|
+
// NOTE: LoadOptions properties are repeated in ConstructorOptions because some
|
|
3468
|
+
// tooling does not support "base types" for @typedef. Remove if/when
|
|
3469
|
+
// https://github.com/microsoft/TypeScript/issues/20077 and/or
|
|
3470
|
+
// https://github.com/jsdoc/jsdoc/issues/1199 actually get resolved
|
|
3471
|
+
/**
|
|
3472
|
+
* @typedef {object} KmlDataSource.LoadOptions
|
|
3473
|
+
*
|
|
3474
|
+
* Initialization options for the `load` method.
|
|
3475
|
+
*
|
|
3476
|
+
* @property {string} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.
|
|
3477
|
+
* @property {boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
|
|
3478
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The global ellipsoid used for geographical calculations.
|
|
3479
|
+
* @property {Element|string} [screenOverlayContainer] A container for ScreenOverlay images.
|
|
3480
|
+
*/
|
|
3481
|
+
|
|
3482
|
+
/**
|
|
3483
|
+
* @typedef {object} KmlDataSource.ConstructorOptions
|
|
3484
|
+
*
|
|
3485
|
+
* Options for constructing a new KmlDataSource, or calling the static `load` method.
|
|
3486
|
+
*
|
|
3487
|
+
* @property {Camera} [camera] The camera that is used for viewRefreshModes and sending camera properties to network links.
|
|
3488
|
+
* @property {HTMLCanvasElement} [canvas] The canvas that is used for sending viewer properties to network links.
|
|
3489
|
+
* @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.
|
|
3490
|
+
*
|
|
3491
|
+
* @property {string} [sourceUri] Overrides the url to use for resolving relative links and other KML network features.
|
|
3492
|
+
* @property {boolean} [clampToGround=false] true if we want the geometry features (Polygons, LineStrings and LinearRings) clamped to the ground.
|
|
3493
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The global ellipsoid used for geographical calculations.
|
|
3494
|
+
* @property {Element|string} [screenOverlayContainer] A container for ScreenOverlay images.
|
|
3495
|
+
|
|
3496
|
+
*/
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
|
|
3500
|
+
* <p>
|
|
3501
|
+
* KML support in Cesium is incomplete, but a large amount of the standard,
|
|
3502
|
+
* as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
|
|
3503
|
+
* {@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
|
|
3504
|
+
* detailed list of what is and isn't supported. Cesium will also write information to the
|
|
3505
|
+
* console when it encounters most unsupported features.
|
|
3506
|
+
* </p>
|
|
3507
|
+
* <p>
|
|
3508
|
+
* Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
|
|
3509
|
+
* is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
|
|
3510
|
+
* under the <code>kml</code> property.
|
|
3511
|
+
* </p>
|
|
3512
|
+
*
|
|
3513
|
+
* @alias KmlDataSource
|
|
3514
|
+
* @constructor
|
|
3515
|
+
*
|
|
3516
|
+
* @param {KmlDataSource.ConstructorOptions} [options] Object describing initialization options
|
|
3517
|
+
*
|
|
3518
|
+
* @see {@link http://www.opengeospatial.org/standards/kml/|Open Geospatial Consortium KML Standard}
|
|
3519
|
+
* @see {@link https://developers.google.com/kml/|Google KML Documentation}
|
|
3520
|
+
*
|
|
3521
|
+
* @demo {@link https://sandcastle.cesium.com/index.html?src=KML.html|Cesium Sandcastle KML Demo}
|
|
3522
|
+
*
|
|
3523
|
+
* @example
|
|
3524
|
+
* const viewer = new Cesium.Viewer('cesiumContainer');
|
|
3525
|
+
* viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
|
|
3526
|
+
* {
|
|
3527
|
+
* camera: viewer.scene.camera,
|
|
3528
|
+
* canvas: viewer.scene.canvas
|
|
3529
|
+
* })
|
|
3530
|
+
* );
|
|
3531
|
+
*/
|
|
3532
|
+
function KmlDataSource(options) {
|
|
3533
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3534
|
+
const camera = options.camera;
|
|
3535
|
+
const canvas = options.canvas;
|
|
3536
|
+
|
|
3537
|
+
this._changed = new Event();
|
|
3538
|
+
this._error = new Event();
|
|
3539
|
+
this._loading = new Event();
|
|
3540
|
+
this._refresh = new Event();
|
|
3541
|
+
this._unsupportedNode = new Event();
|
|
3542
|
+
|
|
3543
|
+
this._clock = undefined;
|
|
3544
|
+
this._entityCollection = new EntityCollection(this);
|
|
3545
|
+
this._name = undefined;
|
|
3546
|
+
this._isLoading = false;
|
|
3547
|
+
this._pinBuilder = new PinBuilder();
|
|
3548
|
+
this._networkLinks = new AssociativeArray();
|
|
3549
|
+
this._entityCluster = new EntityCluster();
|
|
3550
|
+
|
|
3551
|
+
/**
|
|
3552
|
+
* The current size of this Canvas will be used to populate the Link parameters
|
|
3553
|
+
* for client height and width.
|
|
3554
|
+
*
|
|
3555
|
+
* @type {HTMLCanvasElement | undefined}
|
|
3556
|
+
*/
|
|
3557
|
+
this.canvas = canvas;
|
|
3558
|
+
|
|
3559
|
+
/**
|
|
3560
|
+
* The position and orientation of this {@link Camera} will be used to
|
|
3561
|
+
* populate various camera parameters when making network requests.
|
|
3562
|
+
* Camera movement will determine when to trigger NetworkLink refresh if
|
|
3563
|
+
* <code>viewRefreshMode</code> is <code>onStop</code>.
|
|
3564
|
+
*
|
|
3565
|
+
* @type {Camera | undefined}
|
|
3566
|
+
*/
|
|
3567
|
+
this.camera = camera;
|
|
3568
|
+
|
|
3569
|
+
this._lastCameraView = {
|
|
3570
|
+
position: defined(camera) ? Cartesian3.clone(camera.positionWC) : undefined,
|
|
3571
|
+
direction: defined(camera)
|
|
3572
|
+
? Cartesian3.clone(camera.directionWC)
|
|
3573
|
+
: undefined,
|
|
3574
|
+
up: defined(camera) ? Cartesian3.clone(camera.upWC) : undefined,
|
|
3575
|
+
bbox: defined(camera)
|
|
3576
|
+
? camera.computeViewRectangle()
|
|
3577
|
+
: Rectangle.clone(Rectangle.MAX_VALUE),
|
|
3578
|
+
};
|
|
3579
|
+
|
|
3580
|
+
this._ellipsoid = options.ellipsoid ?? Ellipsoid.default;
|
|
3581
|
+
|
|
3582
|
+
// User specified credit
|
|
3583
|
+
let credit = options.credit;
|
|
3584
|
+
if (typeof credit === "string") {
|
|
3585
|
+
credit = new Credit(credit);
|
|
3586
|
+
}
|
|
3587
|
+
this._credit = credit;
|
|
3588
|
+
|
|
3589
|
+
// Create a list of Credit's from the resource that the user can't remove
|
|
3590
|
+
this._resourceCredits = [];
|
|
3591
|
+
|
|
3592
|
+
this._kmlTours = [];
|
|
3593
|
+
|
|
3594
|
+
this._screenOverlays = [];
|
|
3595
|
+
}
|
|
3596
|
+
|
|
3597
|
+
/**
|
|
3598
|
+
* Creates a Promise to a new instance loaded with the provided KML data.
|
|
3599
|
+
*
|
|
3600
|
+
* @param {Resource|string|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
|
|
3601
|
+
* @param {KmlDataSource.ConstructorOptions} [options] An object specifying configuration options
|
|
3602
|
+
*
|
|
3603
|
+
* @returns {Promise<KmlDataSource>} A promise that will resolve to a new KmlDataSource instance once the KML is loaded.
|
|
3604
|
+
*/
|
|
3605
|
+
KmlDataSource.load = function (data, options) {
|
|
3606
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3607
|
+
const dataSource = new KmlDataSource(options);
|
|
3608
|
+
return dataSource.load(data, options);
|
|
3609
|
+
};
|
|
3610
|
+
|
|
3611
|
+
Object.defineProperties(KmlDataSource.prototype, {
|
|
3612
|
+
/**
|
|
3613
|
+
* Gets or sets a human-readable name for this instance.
|
|
3614
|
+
* This will be automatically be set to the KML document name on load.
|
|
3615
|
+
* @memberof KmlDataSource.prototype
|
|
3616
|
+
* @type {string}
|
|
3617
|
+
*/
|
|
3618
|
+
name: {
|
|
3619
|
+
get: function () {
|
|
3620
|
+
return this._name;
|
|
3621
|
+
},
|
|
3622
|
+
set: function (value) {
|
|
3623
|
+
if (this._name !== value) {
|
|
3624
|
+
this._name = value;
|
|
3625
|
+
this._changed.raiseEvent(this);
|
|
3626
|
+
}
|
|
3627
|
+
},
|
|
3628
|
+
},
|
|
3629
|
+
/**
|
|
3630
|
+
* Gets the clock settings defined by the loaded KML. This represents the total
|
|
3631
|
+
* availability interval for all time-dynamic data. If the KML does not contain
|
|
3632
|
+
* time-dynamic data, this value is undefined.
|
|
3633
|
+
* @memberof KmlDataSource.prototype
|
|
3634
|
+
* @type {DataSourceClock}
|
|
3635
|
+
*/
|
|
3636
|
+
clock: {
|
|
3637
|
+
get: function () {
|
|
3638
|
+
return this._clock;
|
|
3639
|
+
},
|
|
3640
|
+
},
|
|
3641
|
+
/**
|
|
3642
|
+
* Gets the collection of {@link Entity} instances.
|
|
3643
|
+
* @memberof KmlDataSource.prototype
|
|
3644
|
+
* @type {EntityCollection}
|
|
3645
|
+
*/
|
|
3646
|
+
entities: {
|
|
3647
|
+
get: function () {
|
|
3648
|
+
return this._entityCollection;
|
|
3649
|
+
},
|
|
3650
|
+
},
|
|
3651
|
+
/**
|
|
3652
|
+
* Gets a value indicating if the data source is currently loading data.
|
|
3653
|
+
* @memberof KmlDataSource.prototype
|
|
3654
|
+
* @type {boolean}
|
|
3655
|
+
*/
|
|
3656
|
+
isLoading: {
|
|
3657
|
+
get: function () {
|
|
3658
|
+
return this._isLoading;
|
|
3659
|
+
},
|
|
3660
|
+
},
|
|
3661
|
+
/**
|
|
3662
|
+
* Gets an event that will be raised when the underlying data changes.
|
|
3663
|
+
* @memberof KmlDataSource.prototype
|
|
3664
|
+
* @type {Event}
|
|
3665
|
+
*/
|
|
3666
|
+
changedEvent: {
|
|
3667
|
+
get: function () {
|
|
3668
|
+
return this._changed;
|
|
3669
|
+
},
|
|
3670
|
+
},
|
|
3671
|
+
/**
|
|
3672
|
+
* Gets an event that will be raised if an error is encountered during processing.
|
|
3673
|
+
* @memberof KmlDataSource.prototype
|
|
3674
|
+
* @type {Event}
|
|
3675
|
+
*/
|
|
3676
|
+
errorEvent: {
|
|
3677
|
+
get: function () {
|
|
3678
|
+
return this._error;
|
|
3679
|
+
},
|
|
3680
|
+
},
|
|
3681
|
+
/**
|
|
3682
|
+
* Gets an event that will be raised when the data source either starts or stops loading.
|
|
3683
|
+
* @memberof KmlDataSource.prototype
|
|
3684
|
+
* @type {Event}
|
|
3685
|
+
*/
|
|
3686
|
+
loadingEvent: {
|
|
3687
|
+
get: function () {
|
|
3688
|
+
return this._loading;
|
|
3689
|
+
},
|
|
3690
|
+
},
|
|
3691
|
+
/**
|
|
3692
|
+
* Gets an event that will be raised when the data source refreshes a network link.
|
|
3693
|
+
* @memberof KmlDataSource.prototype
|
|
3694
|
+
* @type {Event}
|
|
3695
|
+
*/
|
|
3696
|
+
refreshEvent: {
|
|
3697
|
+
get: function () {
|
|
3698
|
+
return this._refresh;
|
|
3699
|
+
},
|
|
3700
|
+
},
|
|
3701
|
+
/**
|
|
3702
|
+
* Gets an event that will be raised when the data source finds an unsupported node type.
|
|
3703
|
+
* @memberof KmlDataSource.prototype
|
|
3704
|
+
* @type {Event}
|
|
3705
|
+
*/
|
|
3706
|
+
unsupportedNodeEvent: {
|
|
3707
|
+
get: function () {
|
|
3708
|
+
return this._unsupportedNode;
|
|
3709
|
+
},
|
|
3710
|
+
},
|
|
3711
|
+
/**
|
|
3712
|
+
* Gets whether or not this data source should be displayed.
|
|
3713
|
+
* @memberof KmlDataSource.prototype
|
|
3714
|
+
* @type {boolean}
|
|
3715
|
+
*/
|
|
3716
|
+
show: {
|
|
3717
|
+
get: function () {
|
|
3718
|
+
return this._entityCollection.show;
|
|
3719
|
+
},
|
|
3720
|
+
set: function (value) {
|
|
3721
|
+
this._entityCollection.show = value;
|
|
3722
|
+
},
|
|
3723
|
+
},
|
|
3724
|
+
|
|
3725
|
+
/**
|
|
3726
|
+
* Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
|
|
3727
|
+
*
|
|
3728
|
+
* @memberof KmlDataSource.prototype
|
|
3729
|
+
* @type {EntityCluster}
|
|
3730
|
+
*/
|
|
3731
|
+
clustering: {
|
|
3732
|
+
get: function () {
|
|
3733
|
+
return this._entityCluster;
|
|
3734
|
+
},
|
|
3735
|
+
set: function (value) {
|
|
3736
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3737
|
+
if (!defined(value)) {
|
|
3738
|
+
throw new DeveloperError("value must be defined.");
|
|
3739
|
+
}
|
|
3740
|
+
//>>includeEnd('debug');
|
|
3741
|
+
this._entityCluster = value;
|
|
3742
|
+
},
|
|
3743
|
+
},
|
|
3744
|
+
/**
|
|
3745
|
+
* Gets the credit that will be displayed for the data source
|
|
3746
|
+
* @memberof KmlDataSource.prototype
|
|
3747
|
+
* @type {Credit}
|
|
3748
|
+
*/
|
|
3749
|
+
credit: {
|
|
3750
|
+
get: function () {
|
|
3751
|
+
return this._credit;
|
|
3752
|
+
},
|
|
3753
|
+
},
|
|
3754
|
+
/**
|
|
3755
|
+
* Gets the KML Tours that are used to guide the camera to specified destinations on given time intervals.
|
|
3756
|
+
* @memberof KmlDataSource.prototype
|
|
3757
|
+
* @type {KmlTour[]}
|
|
3758
|
+
*/
|
|
3759
|
+
kmlTours: {
|
|
3760
|
+
get: function () {
|
|
3761
|
+
return this._kmlTours;
|
|
3762
|
+
},
|
|
3763
|
+
},
|
|
3764
|
+
});
|
|
3765
|
+
|
|
3766
|
+
/**
|
|
3767
|
+
* Asynchronously loads the provided KML data, replacing any existing data.
|
|
3768
|
+
*
|
|
3769
|
+
* @param {Resource|string|Document|Blob} data A url, parsed KML document, or Blob containing binary KMZ data or a parsed KML document.
|
|
3770
|
+
* @param {KmlDataSource.LoadOptions} [options] An object specifying configuration options
|
|
3771
|
+
*
|
|
3772
|
+
* @returns {Promise<KmlDataSource>} A promise that will resolve to this instances once the KML is loaded.
|
|
3773
|
+
*/
|
|
3774
|
+
KmlDataSource.prototype.load = function (data, options) {
|
|
3775
|
+
//>>includeStart('debug', pragmas.debug);
|
|
3776
|
+
if (!defined(data)) {
|
|
3777
|
+
throw new DeveloperError("data is required.");
|
|
3778
|
+
}
|
|
3779
|
+
//>>includeEnd('debug');
|
|
3780
|
+
|
|
3781
|
+
options = options ?? Frozen.EMPTY_OBJECT;
|
|
3782
|
+
DataSource.setLoading(this, true);
|
|
3783
|
+
|
|
3784
|
+
const oldName = this._name;
|
|
3785
|
+
this._name = undefined;
|
|
3786
|
+
this._clampToGround = options.clampToGround ?? false;
|
|
3787
|
+
|
|
3788
|
+
const that = this;
|
|
3789
|
+
return load(this, this._entityCollection, data, options)
|
|
3790
|
+
.then(function () {
|
|
3791
|
+
let clock;
|
|
3792
|
+
|
|
3793
|
+
const availability = that._entityCollection.computeAvailability();
|
|
3794
|
+
|
|
3795
|
+
let start = availability.start;
|
|
3796
|
+
let stop = availability.stop;
|
|
3797
|
+
const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);
|
|
3798
|
+
const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);
|
|
3799
|
+
if (!isMinStart || !isMaxStop) {
|
|
3800
|
+
let date;
|
|
3801
|
+
|
|
3802
|
+
//If start is min time just start at midnight this morning, local time
|
|
3803
|
+
if (isMinStart) {
|
|
3804
|
+
date = new Date();
|
|
3805
|
+
date.setHours(0, 0, 0, 0);
|
|
3806
|
+
start = JulianDate.fromDate(date);
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
//If stop is max value just stop at midnight tonight, local time
|
|
3810
|
+
if (isMaxStop) {
|
|
3811
|
+
date = new Date();
|
|
3812
|
+
date.setHours(24, 0, 0, 0);
|
|
3813
|
+
stop = JulianDate.fromDate(date);
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
clock = new DataSourceClock();
|
|
3817
|
+
clock.startTime = start;
|
|
3818
|
+
clock.stopTime = stop;
|
|
3819
|
+
clock.currentTime = JulianDate.clone(start);
|
|
3820
|
+
clock.clockRange = ClockRange.LOOP_STOP;
|
|
3821
|
+
clock.clockStep = ClockStep.SYSTEM_CLOCK_MULTIPLIER;
|
|
3822
|
+
clock.multiplier = Math.round(
|
|
3823
|
+
Math.min(
|
|
3824
|
+
Math.max(JulianDate.secondsDifference(stop, start) / 60, 1),
|
|
3825
|
+
3.15569e7,
|
|
3826
|
+
),
|
|
3827
|
+
);
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
let changed = false;
|
|
3831
|
+
if (clock !== that._clock) {
|
|
3832
|
+
that._clock = clock;
|
|
3833
|
+
changed = true;
|
|
3834
|
+
}
|
|
3835
|
+
|
|
3836
|
+
if (oldName !== that._name) {
|
|
3837
|
+
changed = true;
|
|
3838
|
+
}
|
|
3839
|
+
|
|
3840
|
+
if (changed) {
|
|
3841
|
+
that._changed.raiseEvent(that);
|
|
3842
|
+
}
|
|
3843
|
+
|
|
3844
|
+
DataSource.setLoading(that, false);
|
|
3845
|
+
|
|
3846
|
+
return that;
|
|
3847
|
+
})
|
|
3848
|
+
.catch(function (error) {
|
|
3849
|
+
DataSource.setLoading(that, false);
|
|
3850
|
+
that._error.raiseEvent(that, error);
|
|
3851
|
+
console.log(error);
|
|
3852
|
+
return Promise.reject(error);
|
|
3853
|
+
});
|
|
3854
|
+
};
|
|
3855
|
+
|
|
3856
|
+
/**
|
|
3857
|
+
* Cleans up any non-entity elements created by the data source. Currently this only affects ScreenOverlay elements.
|
|
3858
|
+
*/
|
|
3859
|
+
KmlDataSource.prototype.destroy = function () {
|
|
3860
|
+
while (this._screenOverlays.length > 0) {
|
|
3861
|
+
const elem = this._screenOverlays.pop();
|
|
3862
|
+
elem.remove();
|
|
3863
|
+
}
|
|
3864
|
+
};
|
|
3865
|
+
|
|
3866
|
+
function mergeAvailabilityWithParent(child) {
|
|
3867
|
+
const parent = child.parent;
|
|
3868
|
+
if (defined(parent)) {
|
|
3869
|
+
const parentAvailability = parent.availability;
|
|
3870
|
+
if (defined(parentAvailability)) {
|
|
3871
|
+
const childAvailability = child.availability;
|
|
3872
|
+
if (defined(childAvailability)) {
|
|
3873
|
+
childAvailability.intersect(parentAvailability);
|
|
3874
|
+
} else {
|
|
3875
|
+
child.availability = parentAvailability;
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
}
|
|
3880
|
+
|
|
3881
|
+
function getNetworkLinkUpdateCallback(
|
|
3882
|
+
dataSource,
|
|
3883
|
+
networkLink,
|
|
3884
|
+
newEntityCollection,
|
|
3885
|
+
networkLinks,
|
|
3886
|
+
processedHref,
|
|
3887
|
+
) {
|
|
3888
|
+
return function (rootElement) {
|
|
3889
|
+
if (!networkLinks.contains(networkLink.id)) {
|
|
3890
|
+
// Got into the odd case where a parent network link was updated while a child
|
|
3891
|
+
// network link update was in flight, so just throw it away.
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
let remove = false;
|
|
3895
|
+
const networkLinkControl = queryFirstNode(
|
|
3896
|
+
rootElement,
|
|
3897
|
+
"NetworkLinkControl",
|
|
3898
|
+
namespaces.kml,
|
|
3899
|
+
);
|
|
3900
|
+
const hasNetworkLinkControl = defined(networkLinkControl);
|
|
3901
|
+
|
|
3902
|
+
let minRefreshPeriod = 0;
|
|
3903
|
+
if (hasNetworkLinkControl) {
|
|
3904
|
+
if (
|
|
3905
|
+
defined(queryFirstNode(networkLinkControl, "Update", namespaces.kml))
|
|
3906
|
+
) {
|
|
3907
|
+
oneTimeWarning(
|
|
3908
|
+
"kml-networkLinkControl-update",
|
|
3909
|
+
"KML - NetworkLinkControl updates aren't supported.",
|
|
3910
|
+
);
|
|
3911
|
+
networkLink.updating = false;
|
|
3912
|
+
networkLinks.remove(networkLink.id);
|
|
3913
|
+
return;
|
|
3914
|
+
}
|
|
3915
|
+
networkLink.cookie = queryToObject(
|
|
3916
|
+
queryStringValue(networkLinkControl, "cookie", namespaces.kml) ?? "",
|
|
3917
|
+
);
|
|
3918
|
+
minRefreshPeriod =
|
|
3919
|
+
queryNumericValue(
|
|
3920
|
+
networkLinkControl,
|
|
3921
|
+
"minRefreshPeriod",
|
|
3922
|
+
namespaces.kml,
|
|
3923
|
+
) ?? 0;
|
|
3924
|
+
}
|
|
3925
|
+
|
|
3926
|
+
const now = JulianDate.now();
|
|
3927
|
+
const refreshMode = networkLink.refreshMode;
|
|
3928
|
+
if (refreshMode === RefreshMode.INTERVAL) {
|
|
3929
|
+
if (defined(networkLinkControl)) {
|
|
3930
|
+
networkLink.time = Math.max(minRefreshPeriod, networkLink.time);
|
|
3931
|
+
}
|
|
3932
|
+
} else if (refreshMode === RefreshMode.EXPIRE) {
|
|
3933
|
+
let expires;
|
|
3934
|
+
if (defined(networkLinkControl)) {
|
|
3935
|
+
expires = queryStringValue(
|
|
3936
|
+
networkLinkControl,
|
|
3937
|
+
"expires",
|
|
3938
|
+
namespaces.kml,
|
|
3939
|
+
);
|
|
3940
|
+
}
|
|
3941
|
+
if (defined(expires)) {
|
|
3942
|
+
try {
|
|
3943
|
+
const date = JulianDate.fromIso8601(expires);
|
|
3944
|
+
const diff = JulianDate.secondsDifference(date, now);
|
|
3945
|
+
if (diff > 0 && diff < minRefreshPeriod) {
|
|
3946
|
+
JulianDate.addSeconds(now, minRefreshPeriod, date);
|
|
3947
|
+
}
|
|
3948
|
+
networkLink.time = date;
|
|
3949
|
+
} catch (e) {
|
|
3950
|
+
oneTimeWarning(
|
|
3951
|
+
"kml-networkLinkControl-expires",
|
|
3952
|
+
"KML - NetworkLinkControl expires is not a valid date",
|
|
3953
|
+
);
|
|
3954
|
+
remove = true;
|
|
3955
|
+
}
|
|
3956
|
+
} else {
|
|
3957
|
+
oneTimeWarning(
|
|
3958
|
+
"kml-refreshMode-onExpire",
|
|
3959
|
+
"KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element",
|
|
3960
|
+
);
|
|
3961
|
+
remove = true;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
|
|
3965
|
+
const networkLinkEntity = networkLink.entity;
|
|
3966
|
+
const entityCollection = dataSource._entityCollection;
|
|
3967
|
+
const newEntities = newEntityCollection.values;
|
|
3968
|
+
|
|
3969
|
+
function removeChildren(entity) {
|
|
3970
|
+
entityCollection.remove(entity);
|
|
3971
|
+
const children = entity._children;
|
|
3972
|
+
const count = children.length;
|
|
3973
|
+
for (let i = 0; i < count; ++i) {
|
|
3974
|
+
removeChildren(children[i]);
|
|
3975
|
+
}
|
|
3976
|
+
}
|
|
3977
|
+
|
|
3978
|
+
// Remove old entities
|
|
3979
|
+
entityCollection.suspendEvents();
|
|
3980
|
+
const entitiesCopy = entityCollection.values.slice();
|
|
3981
|
+
let i;
|
|
3982
|
+
for (i = 0; i < entitiesCopy.length; ++i) {
|
|
3983
|
+
const entityToRemove = entitiesCopy[i];
|
|
3984
|
+
if (entityToRemove.parent === networkLinkEntity) {
|
|
3985
|
+
entityToRemove.parent = undefined;
|
|
3986
|
+
removeChildren(entityToRemove);
|
|
3987
|
+
}
|
|
3988
|
+
}
|
|
3989
|
+
entityCollection.resumeEvents();
|
|
3990
|
+
|
|
3991
|
+
// Add new entities
|
|
3992
|
+
entityCollection.suspendEvents();
|
|
3993
|
+
for (i = 0; i < newEntities.length; i++) {
|
|
3994
|
+
const newEntity = newEntities[i];
|
|
3995
|
+
if (!defined(newEntity.parent)) {
|
|
3996
|
+
newEntity.parent = networkLinkEntity;
|
|
3997
|
+
mergeAvailabilityWithParent(newEntity);
|
|
3998
|
+
}
|
|
3999
|
+
entityCollection.add(newEntity);
|
|
4000
|
+
}
|
|
4001
|
+
entityCollection.resumeEvents();
|
|
4002
|
+
|
|
4003
|
+
// No refresh information remove it, otherwise update lastUpdate time
|
|
4004
|
+
if (remove) {
|
|
4005
|
+
networkLinks.remove(networkLink.id);
|
|
4006
|
+
} else {
|
|
4007
|
+
networkLink.lastUpdated = now;
|
|
4008
|
+
}
|
|
4009
|
+
|
|
4010
|
+
const availability = entityCollection.computeAvailability();
|
|
4011
|
+
|
|
4012
|
+
const start = availability.start;
|
|
4013
|
+
const stop = availability.stop;
|
|
4014
|
+
const isMinStart = JulianDate.equals(start, Iso8601.MINIMUM_VALUE);
|
|
4015
|
+
const isMaxStop = JulianDate.equals(stop, Iso8601.MAXIMUM_VALUE);
|
|
4016
|
+
if (!isMinStart || !isMaxStop) {
|
|
4017
|
+
const clock = dataSource._clock;
|
|
4018
|
+
|
|
4019
|
+
if (clock.startTime !== start || clock.stopTime !== stop) {
|
|
4020
|
+
clock.startTime = start;
|
|
4021
|
+
clock.stopTime = stop;
|
|
4022
|
+
dataSource._changed.raiseEvent(dataSource);
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
networkLink.updating = false;
|
|
4027
|
+
networkLink.needsUpdate = false;
|
|
4028
|
+
dataSource._refresh.raiseEvent(
|
|
4029
|
+
dataSource,
|
|
4030
|
+
processedHref.getUrlComponent(true),
|
|
4031
|
+
);
|
|
4032
|
+
};
|
|
4033
|
+
}
|
|
4034
|
+
|
|
4035
|
+
const entitiesToIgnore = new AssociativeArray();
|
|
4036
|
+
|
|
4037
|
+
/**
|
|
4038
|
+
* Updates any NetworkLink that require updating.
|
|
4039
|
+
*
|
|
4040
|
+
* @param {JulianDate} time The simulation time.
|
|
4041
|
+
* @returns {boolean} True if this data source is ready to be displayed at the provided time, false otherwise.
|
|
4042
|
+
*/
|
|
4043
|
+
KmlDataSource.prototype.update = function (time) {
|
|
4044
|
+
const networkLinks = this._networkLinks;
|
|
4045
|
+
if (networkLinks.length === 0) {
|
|
4046
|
+
return true;
|
|
4047
|
+
}
|
|
4048
|
+
|
|
4049
|
+
const now = JulianDate.now();
|
|
4050
|
+
const that = this;
|
|
4051
|
+
|
|
4052
|
+
entitiesToIgnore.removeAll();
|
|
4053
|
+
|
|
4054
|
+
function recurseIgnoreEntities(entity) {
|
|
4055
|
+
const children = entity._children;
|
|
4056
|
+
const count = children.length;
|
|
4057
|
+
for (let i = 0; i < count; ++i) {
|
|
4058
|
+
const child = children[i];
|
|
4059
|
+
entitiesToIgnore.set(child.id, child);
|
|
4060
|
+
recurseIgnoreEntities(child);
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
|
|
4064
|
+
let cameraViewUpdate = false;
|
|
4065
|
+
const lastCameraView = this._lastCameraView;
|
|
4066
|
+
const camera = this.camera;
|
|
4067
|
+
if (
|
|
4068
|
+
defined(camera) &&
|
|
4069
|
+
!(
|
|
4070
|
+
camera.positionWC.equalsEpsilon(
|
|
4071
|
+
lastCameraView.position,
|
|
4072
|
+
CesiumMath.EPSILON7,
|
|
4073
|
+
) &&
|
|
4074
|
+
camera.directionWC.equalsEpsilon(
|
|
4075
|
+
lastCameraView.direction,
|
|
4076
|
+
CesiumMath.EPSILON7,
|
|
4077
|
+
) &&
|
|
4078
|
+
camera.upWC.equalsEpsilon(lastCameraView.up, CesiumMath.EPSILON7)
|
|
4079
|
+
)
|
|
4080
|
+
) {
|
|
4081
|
+
// Camera has changed so update the last view
|
|
4082
|
+
lastCameraView.position = Cartesian3.clone(camera.positionWC);
|
|
4083
|
+
lastCameraView.direction = Cartesian3.clone(camera.directionWC);
|
|
4084
|
+
lastCameraView.up = Cartesian3.clone(camera.upWC);
|
|
4085
|
+
lastCameraView.bbox = camera.computeViewRectangle();
|
|
4086
|
+
cameraViewUpdate = true;
|
|
4087
|
+
}
|
|
4088
|
+
|
|
4089
|
+
const newNetworkLinks = new AssociativeArray();
|
|
4090
|
+
let changed = false;
|
|
4091
|
+
networkLinks.values.forEach(function (networkLink) {
|
|
4092
|
+
const entity = networkLink.entity;
|
|
4093
|
+
if (entitiesToIgnore.contains(entity.id)) {
|
|
4094
|
+
return;
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
if (!networkLink.updating) {
|
|
4098
|
+
let doUpdate = false;
|
|
4099
|
+
if (networkLink.refreshMode === RefreshMode.INTERVAL) {
|
|
4100
|
+
if (
|
|
4101
|
+
JulianDate.secondsDifference(now, networkLink.lastUpdated) >
|
|
4102
|
+
networkLink.time
|
|
4103
|
+
) {
|
|
4104
|
+
doUpdate = true;
|
|
4105
|
+
}
|
|
4106
|
+
} else if (networkLink.refreshMode === RefreshMode.EXPIRE) {
|
|
4107
|
+
if (JulianDate.greaterThan(now, networkLink.time)) {
|
|
4108
|
+
doUpdate = true;
|
|
4109
|
+
}
|
|
4110
|
+
} else if (networkLink.refreshMode === RefreshMode.STOP) {
|
|
4111
|
+
if (cameraViewUpdate) {
|
|
4112
|
+
networkLink.needsUpdate = true;
|
|
4113
|
+
networkLink.cameraUpdateTime = now;
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
if (
|
|
4117
|
+
networkLink.needsUpdate &&
|
|
4118
|
+
JulianDate.secondsDifference(now, networkLink.cameraUpdateTime) >=
|
|
4119
|
+
networkLink.time
|
|
4120
|
+
) {
|
|
4121
|
+
doUpdate = true;
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
if (doUpdate) {
|
|
4126
|
+
recurseIgnoreEntities(entity);
|
|
4127
|
+
networkLink.updating = true;
|
|
4128
|
+
const newEntityCollection = new EntityCollection();
|
|
4129
|
+
const href = networkLink.href.clone();
|
|
4130
|
+
|
|
4131
|
+
href.setQueryParameters(networkLink.cookie);
|
|
4132
|
+
const ellipsoid = that._ellipsoid ?? Ellipsoid.default;
|
|
4133
|
+
processNetworkLinkQueryString(
|
|
4134
|
+
href,
|
|
4135
|
+
that.camera,
|
|
4136
|
+
that.canvas,
|
|
4137
|
+
networkLink.viewBoundScale,
|
|
4138
|
+
lastCameraView.bbox,
|
|
4139
|
+
ellipsoid,
|
|
4140
|
+
);
|
|
4141
|
+
|
|
4142
|
+
load(that, newEntityCollection, href, {
|
|
4143
|
+
context: entity.id,
|
|
4144
|
+
})
|
|
4145
|
+
.then(
|
|
4146
|
+
getNetworkLinkUpdateCallback(
|
|
4147
|
+
that,
|
|
4148
|
+
networkLink,
|
|
4149
|
+
newEntityCollection,
|
|
4150
|
+
newNetworkLinks,
|
|
4151
|
+
href,
|
|
4152
|
+
),
|
|
4153
|
+
)
|
|
4154
|
+
.catch(function (error) {
|
|
4155
|
+
const msg = `NetworkLink ${networkLink.href} refresh failed: ${error}`;
|
|
4156
|
+
console.log(msg);
|
|
4157
|
+
that._error.raiseEvent(that, msg);
|
|
4158
|
+
});
|
|
4159
|
+
changed = true;
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
4162
|
+
newNetworkLinks.set(networkLink.id, networkLink);
|
|
4163
|
+
});
|
|
4164
|
+
|
|
4165
|
+
if (changed) {
|
|
4166
|
+
this._networkLinks = newNetworkLinks;
|
|
4167
|
+
this._changed.raiseEvent(this);
|
|
4168
|
+
}
|
|
4169
|
+
|
|
4170
|
+
return true;
|
|
4171
|
+
};
|
|
4172
|
+
|
|
4173
|
+
/**
|
|
4174
|
+
* Contains KML Feature data loaded into the <code>Entity.kml</code> property by {@link KmlDataSource}.
|
|
4175
|
+
* @alias KmlFeatureData
|
|
4176
|
+
* @constructor
|
|
4177
|
+
*/
|
|
4178
|
+
function KmlFeatureData() {
|
|
4179
|
+
/**
|
|
4180
|
+
* @typedef KmlFeatureData.Author
|
|
4181
|
+
* @type {object}
|
|
4182
|
+
* @property {string} name Gets the name.
|
|
4183
|
+
* @property {string} uri Gets the URI.
|
|
4184
|
+
* @property {number} age Gets the email.
|
|
4185
|
+
*/
|
|
4186
|
+
|
|
4187
|
+
/**
|
|
4188
|
+
* Gets the atom syndication format author field.
|
|
4189
|
+
* @type {KmlFeatureData.Author}
|
|
4190
|
+
*/
|
|
4191
|
+
this.author = {
|
|
4192
|
+
name: undefined,
|
|
4193
|
+
uri: undefined,
|
|
4194
|
+
email: undefined,
|
|
4195
|
+
};
|
|
4196
|
+
|
|
4197
|
+
/**
|
|
4198
|
+
* @typedef KmlFeatureData.Link
|
|
4199
|
+
* @type {object}
|
|
4200
|
+
* @property {string} href Gets the href.
|
|
4201
|
+
* @property {string} hreflang Gets the language of the linked resource.
|
|
4202
|
+
* @property {string} rel Gets the link relation.
|
|
4203
|
+
* @property {string} type Gets the link type.
|
|
4204
|
+
* @property {string} title Gets the link title.
|
|
4205
|
+
* @property {string} length Gets the link length.
|
|
4206
|
+
*/
|
|
4207
|
+
|
|
4208
|
+
/**
|
|
4209
|
+
* Gets the link.
|
|
4210
|
+
* @type {KmlFeatureData.Link}
|
|
4211
|
+
*/
|
|
4212
|
+
this.link = {
|
|
4213
|
+
href: undefined,
|
|
4214
|
+
hreflang: undefined,
|
|
4215
|
+
rel: undefined,
|
|
4216
|
+
type: undefined,
|
|
4217
|
+
title: undefined,
|
|
4218
|
+
length: undefined,
|
|
4219
|
+
};
|
|
4220
|
+
|
|
4221
|
+
/**
|
|
4222
|
+
* Gets the unstructured address field.
|
|
4223
|
+
* @type {string}
|
|
4224
|
+
*/
|
|
4225
|
+
this.address = undefined;
|
|
4226
|
+
/**
|
|
4227
|
+
* Gets the phone number.
|
|
4228
|
+
* @type {string}
|
|
4229
|
+
*/
|
|
4230
|
+
this.phoneNumber = undefined;
|
|
4231
|
+
/**
|
|
4232
|
+
* Gets the snippet.
|
|
4233
|
+
* @type {string}
|
|
4234
|
+
*/
|
|
4235
|
+
this.snippet = undefined;
|
|
4236
|
+
/**
|
|
4237
|
+
* Gets the extended data, parsed into a JSON object.
|
|
4238
|
+
* Currently only the <code>Data</code> property is supported.
|
|
4239
|
+
* <code>SchemaData</code> and custom data are ignored.
|
|
4240
|
+
* @type {string}
|
|
4241
|
+
*/
|
|
4242
|
+
this.extendedData = undefined;
|
|
4243
|
+
}
|
|
4244
|
+
|
|
4245
|
+
// For testing
|
|
4246
|
+
KmlDataSource._DeferredLoading = DeferredLoading;
|
|
4247
|
+
KmlDataSource._getTimestamp = getTimestamp;
|
|
4248
|
+
|
|
4249
|
+
export default KmlDataSource;
|