@cesium/engine 21.0.1 → 22.1.0
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 +10 -7
- package/Build/Workers/chunk-23T2IPHV.js +55 -0
- package/Build/Workers/{chunk-TGJQMEL4.js → chunk-2AM4E2WD.js} +2 -2
- package/Build/Workers/{chunk-4CORGH7N.js → chunk-2MWF4IES.js} +16 -14
- package/Build/Workers/{chunk-3RKX3UFI.js → chunk-2RCIRXNI.js} +1 -1
- package/Build/Workers/{chunk-LV3G32QE.js → chunk-3YTMGEXW.js} +5 -1424
- package/Build/Workers/{chunk-PJAA7QSC.js → chunk-4BHWJWS3.js} +6 -6
- package/Build/Workers/{chunk-FE565QHX.js → chunk-5JKH4AMT.js} +2 -2
- package/Build/Workers/{chunk-KZ7GDSAJ.js → chunk-6HKAPCSO.js} +1 -1
- package/Build/Workers/{chunk-VVALNLSH.js → chunk-A53R2F2L.js} +4 -4
- package/Build/Workers/{chunk-KVB73ECP.js → chunk-A6YFUGJO.js} +7 -7
- package/Build/Workers/{chunk-QNOIRRJK.js → chunk-AJYWXC6I.js} +4 -4
- package/Build/Workers/{chunk-UKA7OISV.js → chunk-AOIO5VUS.js} +282 -2284
- package/Build/Workers/{chunk-OBS5EMZ6.js → chunk-B7JRBTT6.js} +10 -10
- package/Build/Workers/{chunk-5YXA47QD.js → chunk-CHNDJRYA.js} +20 -18
- package/Build/Workers/{chunk-X3ZV3XNO.js → chunk-CJOV55CW.js} +20 -18
- package/Build/Workers/{chunk-W6I3LNPF.js → chunk-COGPE5Z2.js} +10 -8
- package/Build/Workers/{chunk-2QPH5QDK.js → chunk-CW7W27IZ.js} +14 -10
- package/Build/Workers/{chunk-MXOGBWMP.js → chunk-DICY26ID.js} +20 -16
- package/Build/Workers/{chunk-W6KMV4F5.js → chunk-DMEFNTUV.js} +69 -7
- package/Build/Workers/{chunk-T7HU6E7G.js → chunk-DQSJEOZY.js} +1 -1
- package/Build/Workers/{chunk-ASVODZNK.js → chunk-GDU4RZSZ.js} +16 -36
- package/Build/Workers/{chunk-MQPDOWGH.js → chunk-GKWOUMYA.js} +1 -1
- package/Build/Workers/{chunk-A2SP2EJZ.js → chunk-GTY4K4IA.js} +9 -7
- package/Build/Workers/{chunk-KEPPNSBL.js → chunk-H6Q7E4BQ.js} +8 -6
- package/Build/Workers/{chunk-JG3C3LPY.js → chunk-HHGOFZVQ.js} +7 -5
- package/Build/Workers/chunk-HXKUEOOD.js +352 -0
- package/Build/Workers/{chunk-UFSYRVC5.js → chunk-I4REFVXB.js} +4 -4
- package/Build/Workers/{chunk-LU7DLY2L.js → chunk-IL5F6WEE.js} +3 -3
- package/Build/Workers/{chunk-RVRN4KDB.js → chunk-JKXPC5HD.js} +2 -2
- package/Build/Workers/{chunk-CBPNIEGH.js → chunk-KKGD7HAW.js} +13 -11
- package/Build/Workers/{chunk-DTKSVIH5.js → chunk-KROSQJUA.js} +2 -2
- package/Build/Workers/{chunk-42EJCSIV.js → chunk-L4JLDVCM.js} +5 -5
- package/Build/Workers/{chunk-LPKJSIMD.js → chunk-LIYMRHGR.js} +15 -13
- package/Build/Workers/{chunk-J2XQVKVH.js → chunk-MKMZHRB3.js} +74 -35
- package/Build/Workers/{chunk-CSDYSXBI.js → chunk-MO25ZQ2I.js} +14 -12
- package/Build/Workers/{chunk-3YNW5K6O.js → chunk-O6RZEKHZ.js} +12 -12
- package/Build/Workers/{chunk-RR3NCT4R.js → chunk-OOCGX2OD.js} +4 -4
- package/Build/Workers/{chunk-XG54SG4O.js → chunk-OXFU5HNU.js} +13 -5
- package/Build/Workers/{chunk-P2UKEFCK.js → chunk-P5CGIJUY.js} +2 -2
- package/Build/Workers/{chunk-DBHL2UVG.js → chunk-QEANVUGT.js} +2 -2
- package/Build/Workers/{chunk-2SI7DEW5.js → chunk-QFBCIX7J.js} +8 -6
- package/Build/Workers/{chunk-DDXI6UYW.js → chunk-QUAH3XOT.js} +4 -4
- package/Build/Workers/{chunk-PZUZCAX3.js → chunk-RXZDTDIY.js} +13 -9
- package/Build/Workers/{chunk-YZ3RCE45.js → chunk-SPA2KPH3.js} +14 -12
- package/Build/Workers/chunk-TDSVSW5A.js +1460 -0
- package/Build/Workers/{chunk-G3CKZ34K.js → chunk-UG2DPFOL.js} +8 -6
- package/Build/Workers/{chunk-IKUOV6DO.js → chunk-URGEDZBS.js} +7 -7
- package/Build/Workers/{chunk-U2GR5FDL.js → chunk-V35NQOJC.js} +21 -11
- package/Build/Workers/chunk-W4XUEDU5.js +2058 -0
- package/Build/Workers/chunk-WB4TSSBQ.js +3514 -0
- package/Build/Workers/{chunk-EBDZDBJN.js → chunk-WTLYD4FE.js} +19 -15
- package/Build/Workers/{chunk-WQZL6CA2.js → chunk-Y4ALZ4SS.js} +9 -7
- package/Build/Workers/{chunk-DAJKOQW6.js → chunk-YF2NVO5B.js} +19 -13
- package/Build/Workers/{chunk-XJVRYJVZ.js → chunk-YSYSXSHF.js} +1 -1
- package/Build/Workers/{chunk-YNOVMSUX.js → chunk-YX562XOB.js} +15 -11
- package/Build/Workers/{chunk-J3KPR6DJ.js → chunk-YZWA5B4R.js} +15 -13
- package/Build/Workers/{chunk-NYYQZ3LH.js → chunk-Z6DFT4D3.js} +15 -11
- package/Build/Workers/combineGeometry.js +24 -21
- package/Build/Workers/createBoxGeometry.js +18 -15
- package/Build/Workers/createBoxOutlineGeometry.js +16 -13
- package/Build/Workers/createCircleGeometry.js +28 -24
- package/Build/Workers/createCircleOutlineGeometry.js +21 -17
- package/Build/Workers/createCoplanarPolygonGeometry.js +35 -31
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +33 -29
- package/Build/Workers/createCorridorGeometry.js +32 -28
- package/Build/Workers/createCorridorOutlineGeometry.js +30 -26
- package/Build/Workers/createCylinderGeometry.js +20 -17
- package/Build/Workers/createCylinderOutlineGeometry.js +20 -16
- package/Build/Workers/createEllipseGeometry.js +28 -24
- package/Build/Workers/createEllipseOutlineGeometry.js +21 -17
- package/Build/Workers/createEllipsoidGeometry.js +19 -16
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -15
- package/Build/Workers/createFrustumGeometry.js +18 -15
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -15
- package/Build/Workers/createGeometry.js +28 -22
- package/Build/Workers/createGroundPolylineGeometry.js +25 -21
- package/Build/Workers/createPlaneGeometry.js +16 -13
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -12
- package/Build/Workers/createPolygonGeometry.js +35 -31
- package/Build/Workers/createPolygonOutlineGeometry.js +32 -28
- package/Build/Workers/createPolylineGeometry.js +27 -23
- package/Build/Workers/createPolylineVolumeGeometry.js +33 -29
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +29 -25
- package/Build/Workers/createRectangleGeometry.js +30 -26
- package/Build/Workers/createRectangleOutlineGeometry.js +23 -19
- package/Build/Workers/createSimplePolylineGeometry.js +25 -21
- package/Build/Workers/createSphereGeometry.js +19 -16
- package/Build/Workers/createSphereOutlineGeometry.js +18 -15
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +16 -13
- package/Build/Workers/createVectorTileGeometries.js +24 -21
- package/Build/Workers/createVectorTilePoints.js +15 -12
- package/Build/Workers/createVectorTilePolygons.js +24 -20
- package/Build/Workers/createVectorTilePolylines.js +16 -13
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +91 -0
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +28 -23
- package/Build/Workers/createVerticesFromHeightmap.js +28 -23
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -279
- package/Build/Workers/createWallGeometry.js +26 -22
- package/Build/Workers/createWallOutlineGeometry.js +25 -21
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +13 -11
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +121 -0
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -20
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +95 -0
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +2 -2
- package/Source/Core/AxisAlignedBoundingBox.js +36 -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 +2 -2
- package/Source/Core/Color.js +23 -6
- package/Source/Core/EllipsoidalOccluder.js +2 -2
- package/Source/Core/FeatureDetection.js +0 -2
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +1 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainData.js +2 -1
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -1
- package/Source/Core/HeightmapTerrainData.js +12 -22
- package/Source/Core/HilbertOrder.js +0 -6
- package/Source/Core/ITwinPlatform.js +6 -6
- package/Source/Core/IntersectionTests.js +80 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +35 -27
- package/Source/Core/PixelFormat.js +2 -2
- package/Source/Core/QuantizedMeshTerrainData.js +24 -57
- package/Source/Core/Resource.js +15 -11
- package/Source/Core/S2Cell.js +6 -18
- package/Source/Core/TaskProcessor.js +1 -1
- package/Source/Core/TerrainData.js +2 -1
- package/Source/Core/TerrainEncoding.js +215 -38
- package/Source/Core/TerrainMesh.js +215 -8
- package/Source/Core/TerrainPicker.js +607 -0
- package/Source/Core/TerrainProvider.js +151 -0
- package/Source/Core/TexturePacker.js +27 -12
- package/Source/Core/Transforms.js +28 -19
- package/Source/Core/VRTheWorldTerrainProvider.js +2 -2
- package/Source/Core/binarySearch.js +1 -1
- package/Source/Core/createWorldBathymetryAsync.js +2 -2
- package/Source/Core/createWorldTerrainAsync.js +3 -3
- package/Source/Core/loadImageFromTypedArray.js +9 -3
- package/Source/Core/mergeSort.js +1 -1
- package/Source/DataSources/BillboardGraphics.js +1 -1
- package/Source/DataSources/BillboardVisualizer.js +7 -4
- package/Source/DataSources/PropertyArray.js +2 -2
- package/Source/Renderer/AutomaticUniforms.js +61 -0
- package/Source/Renderer/Buffer.js +32 -0
- package/Source/Renderer/BufferUsage.js +3 -1
- package/Source/Renderer/Context.js +98 -14
- package/Source/Renderer/Pass.js +10 -9
- package/Source/Renderer/Sync.js +104 -0
- package/Source/Renderer/TextureAtlas.js +67 -27
- package/Source/Renderer/UniformState.js +12 -0
- package/Source/Renderer/VertexArray.js +1 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +1 -1
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Azure2DImageryProvider.js +99 -13
- package/Source/Scene/BatchTable.js +2 -2
- package/Source/Scene/Billboard.js +75 -28
- package/Source/Scene/BillboardCollection.js +24 -15
- package/Source/Scene/BillboardTexture.js +56 -7
- package/Source/Scene/BingMapsImageryProvider.js +1 -1
- package/Source/Scene/BoundingVolumeSemantics.js +54 -62
- package/Source/Scene/Cesium3DTile.js +3 -3
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +1 -1
- package/Source/Scene/Cesium3DTileset.js +1 -1
- package/Source/Scene/EdgeFramebuffer.js +245 -0
- package/Source/Scene/FrameState.js +12 -0
- package/Source/Scene/GaussianSplat3DTileContent.js +12 -16
- package/Source/Scene/GaussianSplatPrimitive.js +12 -8
- package/Source/Scene/GaussianSplatSorter.js +2 -2
- package/Source/Scene/Globe.js +4 -2
- package/Source/Scene/GlobeSurfaceTile.js +28 -70
- package/Source/Scene/GlobeSurfaceTileProvider.js +11 -0
- package/Source/Scene/GltfBufferViewLoader.js +18 -0
- package/Source/Scene/GltfLoader.js +46 -8
- package/Source/Scene/Google2DImageryProvider.js +48 -41
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +1 -1
- package/Source/Scene/I3SDataProvider.js +1 -1
- package/Source/Scene/I3SDecoder.js +3 -3
- package/Source/Scene/ITwinData.js +4 -4
- package/Source/Scene/ImageryLayer.js +1 -1
- package/Source/Scene/Implicit3DTileContent.js +18 -7
- package/Source/Scene/ImplicitSubtree.js +3 -3
- package/Source/Scene/ImplicitTileset.js +2 -2
- package/Source/Scene/IonImageryProvider.js +15 -84
- package/Source/Scene/IonImageryProviderFactory.js +194 -0
- package/Source/Scene/LabelCollection.js +54 -36
- package/Source/Scene/MetadataComponentType.js +5 -5
- package/Source/Scene/MetadataTableProperty.js +3 -9
- package/Source/Scene/Model/EdgeDetectionPipelineStage.js +42 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +800 -0
- package/Source/Scene/Model/MetadataPipelineStage.js +7 -7
- package/Source/Scene/Model/ModelDrawCommand.js +69 -0
- package/Source/Scene/Model/ModelImagery.js +4 -0
- package/Source/Scene/Model/ModelRuntimeNode.js +2 -2
- package/Source/Scene/Model/ModelRuntimePrimitive.js +13 -2
- package/Source/Scene/Model/ModelSceneGraph.js +15 -3
- package/Source/Scene/Model/ModelUtility.js +0 -1
- package/Source/Scene/Model/NodeRenderResources.js +1 -1
- package/Source/Scene/Model/PrimitiveRenderResources.js +1 -1
- package/Source/Scene/OIT.js +11 -1
- package/Source/Scene/PickFramebuffer.js +134 -50
- package/Source/Scene/Picking.js +195 -89
- package/Source/Scene/QuadtreePrimitive.js +34 -26
- package/Source/Scene/QuadtreeTile.js +66 -46
- package/Source/Scene/ResourceLoaderState.js +1 -1
- package/Source/Scene/Scene.js +160 -16
- package/Source/Scene/ScreenSpaceCameraController.js +1 -1
- package/Source/Scene/SensorVolumePortionToDisplay.js +6 -6
- package/Source/Scene/SingleTileImageryProvider.js +3 -3
- package/Source/Scene/Terrain.js +5 -5
- package/Source/Scene/TerrainFillMesh.js +1 -0
- package/Source/Scene/TileMapServiceImageryProvider.js +2 -2
- package/Source/Scene/UrlTemplateImageryProvider.js +1 -1
- package/Source/Scene/View.js +3 -0
- package/Source/Scene/VoxelPrimitive.js +196 -189
- package/Source/Scene/VoxelShape.js +2 -0
- package/Source/Scene/createWorldImageryAsync.js +1 -1
- package/Source/Shaders/BillboardCollectionFS.glsl +115 -62
- package/Source/Shaders/BillboardCollectionFS.js +115 -63
- package/Source/Shaders/BillboardCollectionVS.glsl +44 -37
- package/Source/Shaders/BillboardCollectionVS.js +45 -38
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.glsl +10 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/GlobeVS.glsl +1 -1
- package/Source/Shaders/GlobeVS.js +1 -1
- 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/ModelFS.glsl +5 -0
- package/Source/Shaders/Model/ModelFS.js +5 -0
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.glsl +0 -1
- package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
- package/Source/Shaders/ShadowVolumeAppearanceFS.glsl +7 -15
- package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
- package/Source/ThirdParty/Workers/zip-web-worker.js +1 -1
- package/Source/ThirdParty/zip-module.wasm +0 -0
- package/Source/Workers/createVerticesFromCesium3DTilesTerrain.js +46 -0
- package/Source/Workers/incrementallyBuildTerrainPicker.js +108 -0
- package/Source/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +55 -0
- package/index.d.ts +488 -31
- package/index.js +202 -190
- package/package.json +3 -2
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import BoundingSphere from "../Core/BoundingSphere.js";
|
|
2
2
|
import Cartesian3 from "../Core/Cartesian3.js";
|
|
3
3
|
import Cartesian4 from "../Core/Cartesian4.js";
|
|
4
|
-
import Cartographic from "../Core/Cartographic.js";
|
|
5
4
|
import defined from "../Core/defined.js";
|
|
6
5
|
import IndexDatatype from "../Core/IndexDatatype.js";
|
|
7
|
-
import IntersectionTests from "../Core/IntersectionTests.js";
|
|
8
6
|
import PixelFormat from "../Core/PixelFormat.js";
|
|
9
|
-
import Ray from "../Core/Ray.js";
|
|
10
7
|
import Request from "../Core/Request.js";
|
|
11
8
|
import RequestState from "../Core/RequestState.js";
|
|
12
9
|
import RequestType from "../Core/RequestType.js";
|
|
@@ -23,7 +20,6 @@ import TextureWrap from "../Renderer/TextureWrap.js";
|
|
|
23
20
|
import VertexArray from "../Renderer/VertexArray.js";
|
|
24
21
|
import ImageryState from "./ImageryState.js";
|
|
25
22
|
import QuadtreeTileLoadState from "./QuadtreeTileLoadState.js";
|
|
26
|
-
import SceneMode from "./SceneMode.js";
|
|
27
23
|
import TerrainState from "./TerrainState.js";
|
|
28
24
|
|
|
29
25
|
/**
|
|
@@ -126,33 +122,6 @@ Object.defineProperties(GlobeSurfaceTile.prototype, {
|
|
|
126
122
|
},
|
|
127
123
|
});
|
|
128
124
|
|
|
129
|
-
const scratchCartographic = new Cartographic();
|
|
130
|
-
|
|
131
|
-
function getPosition(encoding, mode, projection, vertices, index, result) {
|
|
132
|
-
let position = encoding.getExaggeratedPosition(vertices, index, result);
|
|
133
|
-
|
|
134
|
-
if (defined(mode) && mode !== SceneMode.SCENE3D) {
|
|
135
|
-
const ellipsoid = projection.ellipsoid;
|
|
136
|
-
const positionCartographic = ellipsoid.cartesianToCartographic(
|
|
137
|
-
position,
|
|
138
|
-
scratchCartographic,
|
|
139
|
-
);
|
|
140
|
-
position = projection.project(positionCartographic, result);
|
|
141
|
-
position = Cartesian3.fromElements(
|
|
142
|
-
position.z,
|
|
143
|
-
position.x,
|
|
144
|
-
position.y,
|
|
145
|
-
result,
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return position;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const scratchV0 = new Cartesian3();
|
|
153
|
-
const scratchV1 = new Cartesian3();
|
|
154
|
-
const scratchV2 = new Cartesian3();
|
|
155
|
-
|
|
156
125
|
GlobeSurfaceTile.prototype.pick = function (
|
|
157
126
|
ray,
|
|
158
127
|
mode,
|
|
@@ -160,42 +129,11 @@ GlobeSurfaceTile.prototype.pick = function (
|
|
|
160
129
|
cullBackFaces,
|
|
161
130
|
result,
|
|
162
131
|
) {
|
|
163
|
-
|
|
164
|
-
if (!defined(mesh)) {
|
|
132
|
+
if (!defined(this.renderedMesh)) {
|
|
165
133
|
return undefined;
|
|
166
134
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
const indices = mesh.indices;
|
|
170
|
-
const encoding = mesh.encoding;
|
|
171
|
-
const indicesLength = indices.length;
|
|
172
|
-
|
|
173
|
-
let minT = Number.MAX_VALUE;
|
|
174
|
-
|
|
175
|
-
for (let i = 0; i < indicesLength; i += 3) {
|
|
176
|
-
const i0 = indices[i];
|
|
177
|
-
const i1 = indices[i + 1];
|
|
178
|
-
const i2 = indices[i + 2];
|
|
179
|
-
|
|
180
|
-
const v0 = getPosition(encoding, mode, projection, vertices, i0, scratchV0);
|
|
181
|
-
const v1 = getPosition(encoding, mode, projection, vertices, i1, scratchV1);
|
|
182
|
-
const v2 = getPosition(encoding, mode, projection, vertices, i2, scratchV2);
|
|
183
|
-
|
|
184
|
-
const t = IntersectionTests.rayTriangleParametric(
|
|
185
|
-
ray,
|
|
186
|
-
v0,
|
|
187
|
-
v1,
|
|
188
|
-
v2,
|
|
189
|
-
cullBackFaces,
|
|
190
|
-
);
|
|
191
|
-
if (defined(t) && t < minT && t >= 0.0) {
|
|
192
|
-
minT = t;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return minT !== Number.MAX_VALUE
|
|
197
|
-
? Ray.getPoint(ray, minT, result)
|
|
198
|
-
: undefined;
|
|
135
|
+
const value = this.renderedMesh.pick(ray, cullBackFaces, mode, projection);
|
|
136
|
+
return Cartesian3.clone(value, result);
|
|
199
137
|
};
|
|
200
138
|
|
|
201
139
|
GlobeSurfaceTile.prototype.freeResources = function () {
|
|
@@ -473,8 +411,10 @@ GlobeSurfaceTile.prototype.updateExaggeration = function (
|
|
|
473
411
|
encoding.exaggeration !== exaggeration;
|
|
474
412
|
const encodingRelativeHeightChanged =
|
|
475
413
|
encoding.exaggerationRelativeHeight !== exaggerationRelativeHeight;
|
|
414
|
+
const exaggerationChanged =
|
|
415
|
+
encodingExaggerationScaleChanged || encodingRelativeHeightChanged;
|
|
476
416
|
|
|
477
|
-
if (
|
|
417
|
+
if (exaggerationChanged) {
|
|
478
418
|
// Turning exaggeration scale on/off requires adding or removing geodetic surface normals
|
|
479
419
|
// Relative height only translates, so it has no effect on normals
|
|
480
420
|
if (encodingExaggerationScaleChanged) {
|
|
@@ -493,14 +433,24 @@ GlobeSurfaceTile.prototype.updateExaggeration = function (
|
|
|
493
433
|
if (quadtree !== undefined) {
|
|
494
434
|
quadtree._tileToUpdateHeights.push(tile);
|
|
495
435
|
const customData = tile.customData;
|
|
496
|
-
const
|
|
497
|
-
for (let i = 0; i < customDataLength; i++) {
|
|
436
|
+
for (const data of customData) {
|
|
498
437
|
// Restart the level so that a height update is triggered
|
|
499
|
-
const data = customData[i];
|
|
500
438
|
data.level = -1;
|
|
501
439
|
}
|
|
502
440
|
}
|
|
441
|
+
|
|
442
|
+
mesh.updateExaggeration(exaggeration, exaggerationRelativeHeight);
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
GlobeSurfaceTile.prototype.updateSceneMode = function (mode) {
|
|
447
|
+
const surfaceTile = this;
|
|
448
|
+
const mesh = surfaceTile.renderedMesh;
|
|
449
|
+
if (mesh === undefined) {
|
|
450
|
+
return;
|
|
503
451
|
}
|
|
452
|
+
|
|
453
|
+
mesh.updateSceneMode(mode);
|
|
504
454
|
};
|
|
505
455
|
|
|
506
456
|
function prepareNewTile(tile, terrainProvider, imageryLayerCollection) {
|
|
@@ -931,7 +881,15 @@ function createWaterMaskTextureIfNeeded(context, surfaceTile) {
|
|
|
931
881
|
let texture;
|
|
932
882
|
|
|
933
883
|
const waterMaskLength = waterMask.length;
|
|
934
|
-
if (
|
|
884
|
+
if (waterMask instanceof ImageBitmap) {
|
|
885
|
+
texture = Texture.create({
|
|
886
|
+
context: context,
|
|
887
|
+
source: waterMask,
|
|
888
|
+
sampler: waterMaskData.sampler,
|
|
889
|
+
flipY: false,
|
|
890
|
+
skipColorSpaceConversion: true,
|
|
891
|
+
});
|
|
892
|
+
} else if (waterMaskLength === 1) {
|
|
935
893
|
// Length 1 means the tile is entirely land or entirely water.
|
|
936
894
|
// A value of 0 indicates entirely land, a value of 1 indicates entirely water.
|
|
937
895
|
if (waterMask[0] !== 0) {
|
|
@@ -193,6 +193,7 @@ function GlobeSurfaceTileProvider(options) {
|
|
|
193
193
|
|
|
194
194
|
this._oldVerticalExaggeration = undefined;
|
|
195
195
|
this._oldVerticalExaggerationRelativeHeight = undefined;
|
|
196
|
+
this._oldSceneMode = SceneMode.SCENE3D;
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
Object.defineProperties(GlobeSurfaceTileProvider.prototype, {
|
|
@@ -514,6 +515,16 @@ GlobeSurfaceTileProvider.prototype.endUpdate = function (frameState) {
|
|
|
514
515
|
});
|
|
515
516
|
}
|
|
516
517
|
|
|
518
|
+
const sceneModeChanged = this._oldSceneMode !== frameState.mode;
|
|
519
|
+
this._oldSceneMode = frameState.mode;
|
|
520
|
+
|
|
521
|
+
if (sceneModeChanged) {
|
|
522
|
+
quadtree.forEachLoadedTile(function (tile) {
|
|
523
|
+
const surfaceTile = tile.data;
|
|
524
|
+
surfaceTile.updateSceneMode(frameState.mode);
|
|
525
|
+
});
|
|
526
|
+
}
|
|
527
|
+
|
|
517
528
|
// Add the tile render commands to the command list, sorted by texture count.
|
|
518
529
|
const tilesToRenderByTextureCount = this._tilesToRenderByTextureCount;
|
|
519
530
|
for (
|
|
@@ -125,6 +125,12 @@ Object.defineProperties(GltfBufferViewLoader.prototype, {
|
|
|
125
125
|
},
|
|
126
126
|
});
|
|
127
127
|
|
|
128
|
+
/**
|
|
129
|
+
* Load the resources associated with the loader.
|
|
130
|
+
* @private
|
|
131
|
+
* @param {GltfBufferViewLoader} loader
|
|
132
|
+
* @returns {Promise<GltfBufferViewLoader>}
|
|
133
|
+
*/
|
|
128
134
|
async function loadResources(loader) {
|
|
129
135
|
try {
|
|
130
136
|
const bufferLoader = getBufferLoader(loader);
|
|
@@ -190,9 +196,18 @@ GltfBufferViewLoader.prototype.load = async function () {
|
|
|
190
196
|
return this._promise;
|
|
191
197
|
};
|
|
192
198
|
|
|
199
|
+
/**
|
|
200
|
+
* Get the buffer loader for the specified buffer view loader.
|
|
201
|
+
* Attempts to retrieve from the resource cache first. If a buffer loader is
|
|
202
|
+
* not found, creates a new buffer loader and adds it to the resource cache.
|
|
203
|
+
* @private
|
|
204
|
+
* @param {GltfBufferViewLoader} bufferViewLoader The loader.
|
|
205
|
+
* @returns {BufferLoader} The buffer loader.
|
|
206
|
+
*/
|
|
193
207
|
function getBufferLoader(bufferViewLoader) {
|
|
194
208
|
const resourceCache = bufferViewLoader._resourceCache;
|
|
195
209
|
const buffer = bufferViewLoader._buffer;
|
|
210
|
+
|
|
196
211
|
if (defined(buffer.uri)) {
|
|
197
212
|
const baseResource = bufferViewLoader._baseResource;
|
|
198
213
|
const resource = baseResource.getDerivedResource({
|
|
@@ -202,9 +217,12 @@ function getBufferLoader(bufferViewLoader) {
|
|
|
202
217
|
resource: resource,
|
|
203
218
|
});
|
|
204
219
|
}
|
|
220
|
+
|
|
221
|
+
const source = buffer.extras?._pipeline?.source;
|
|
205
222
|
return resourceCache.getEmbeddedBufferLoader({
|
|
206
223
|
parentResource: bufferViewLoader._gltfResource,
|
|
207
224
|
bufferId: bufferViewLoader._bufferId,
|
|
225
|
+
typedArray: source,
|
|
208
226
|
});
|
|
209
227
|
}
|
|
210
228
|
|
|
@@ -1441,13 +1441,18 @@ function loadIndices(
|
|
|
1441
1441
|
loader,
|
|
1442
1442
|
accessorId,
|
|
1443
1443
|
primitive,
|
|
1444
|
-
draco,
|
|
1445
1444
|
hasFeatureIds,
|
|
1446
1445
|
needsPostProcessing,
|
|
1447
1446
|
frameState,
|
|
1448
1447
|
) {
|
|
1449
1448
|
const accessor = loader.gltfJson.accessors[accessorId];
|
|
1450
1449
|
const bufferViewId = accessor.bufferView;
|
|
1450
|
+
// Infer compression / extensions directly from the glTF primitive instead of passing in flags
|
|
1451
|
+
const extensions = primitive.extensions ?? Frozen.EMPTY_OBJECT;
|
|
1452
|
+
const draco = extensions.KHR_draco_mesh_compression;
|
|
1453
|
+
const hasEdgeVisibility = defined(
|
|
1454
|
+
extensions.EXT_mesh_primitive_edge_visibility,
|
|
1455
|
+
);
|
|
1451
1456
|
|
|
1452
1457
|
if (!defined(draco) && !defined(bufferViewId)) {
|
|
1453
1458
|
return undefined;
|
|
@@ -1470,7 +1475,10 @@ function loadIndices(
|
|
|
1470
1475
|
const outputTypedArrayOnly = loadAttributesAsTypedArray;
|
|
1471
1476
|
const outputBuffer = !outputTypedArrayOnly;
|
|
1472
1477
|
const outputTypedArray =
|
|
1473
|
-
loadAttributesAsTypedArray ||
|
|
1478
|
+
loadAttributesAsTypedArray ||
|
|
1479
|
+
loadForCpuOperations ||
|
|
1480
|
+
loadForClassification ||
|
|
1481
|
+
hasEdgeVisibility;
|
|
1474
1482
|
|
|
1475
1483
|
// Determine what to load right now:
|
|
1476
1484
|
//
|
|
@@ -1991,11 +1999,6 @@ function fetchSpzExtensionFrom(extensions) {
|
|
|
1991
1999
|
return spz;
|
|
1992
2000
|
}
|
|
1993
2001
|
|
|
1994
|
-
const legacySpz = extensions?.KHR_spz_gaussian_splats_compression;
|
|
1995
|
-
if (defined(legacySpz)) {
|
|
1996
|
-
return legacySpz;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
2002
|
return undefined;
|
|
2000
2003
|
}
|
|
2001
2004
|
|
|
@@ -2036,8 +2039,44 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) {
|
|
|
2036
2039
|
);
|
|
2037
2040
|
}
|
|
2038
2041
|
|
|
2042
|
+
// Edge Visibility
|
|
2043
|
+
const edgeVisibilityExtension = extensions.EXT_mesh_primitive_edge_visibility;
|
|
2044
|
+
const hasEdgeVisibility = defined(edgeVisibilityExtension);
|
|
2045
|
+
if (hasEdgeVisibility) {
|
|
2046
|
+
const visibilityAccessor =
|
|
2047
|
+
loader.gltfJson.accessors[edgeVisibilityExtension.visibility];
|
|
2048
|
+
if (!defined(visibilityAccessor)) {
|
|
2049
|
+
throw new RuntimeError("Edge visibility accessor not found!");
|
|
2050
|
+
}
|
|
2051
|
+
const visibilityValues = loadAccessor(loader, visibilityAccessor);
|
|
2052
|
+
primitive.edgeVisibility = {
|
|
2053
|
+
visibility: visibilityValues,
|
|
2054
|
+
material: edgeVisibilityExtension.material,
|
|
2055
|
+
};
|
|
2056
|
+
|
|
2057
|
+
// Load silhouette normals
|
|
2058
|
+
if (defined(edgeVisibilityExtension.silhouetteNormals)) {
|
|
2059
|
+
const silhouetteNormalsAccessor =
|
|
2060
|
+
loader.gltfJson.accessors[edgeVisibilityExtension.silhouetteNormals];
|
|
2061
|
+
if (defined(silhouetteNormalsAccessor)) {
|
|
2062
|
+
const silhouetteNormalsValues = loadAccessor(
|
|
2063
|
+
loader,
|
|
2064
|
+
silhouetteNormalsAccessor,
|
|
2065
|
+
);
|
|
2066
|
+
primitive.edgeVisibility.silhouetteNormals = silhouetteNormalsValues;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
|
|
2070
|
+
// Load line strings
|
|
2071
|
+
if (defined(edgeVisibilityExtension.lineStrings)) {
|
|
2072
|
+
primitivePlan.edgeVisibility.lineStrings =
|
|
2073
|
+
edgeVisibilityExtension.lineStrings;
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2039
2077
|
//support the latest glTF spec and the legacy extension
|
|
2040
2078
|
const spzExtension = fetchSpzExtensionFrom(extensions);
|
|
2079
|
+
|
|
2041
2080
|
if (defined(spzExtension)) {
|
|
2042
2081
|
needsPostProcessing = true;
|
|
2043
2082
|
primitivePlan.needsGaussianSplats = true;
|
|
@@ -2108,7 +2147,6 @@ function loadPrimitive(loader, gltfPrimitive, hasInstances, frameState) {
|
|
|
2108
2147
|
loader,
|
|
2109
2148
|
indices,
|
|
2110
2149
|
gltfPrimitive,
|
|
2111
|
-
draco,
|
|
2112
2150
|
hasFeatureIds,
|
|
2113
2151
|
needsPostProcessing,
|
|
2114
2152
|
frameState,
|
|
@@ -5,28 +5,28 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
5
5
|
import Resource from "../Core/Resource.js";
|
|
6
6
|
import IonResource from "../Core/IonResource.js";
|
|
7
7
|
import Check from "../Core/Check.js";
|
|
8
|
-
import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js";
|
|
9
8
|
import GoogleMaps from "../Core/GoogleMaps.js";
|
|
9
|
+
import { GOOGLE_2D_MAPS as createFromIonEndpoint } from "./IonImageryProviderFactory.js";
|
|
10
|
+
import UrlTemplateImageryProvider from "./UrlTemplateImageryProvider.js";
|
|
10
11
|
|
|
11
12
|
const trailingSlashRegex = /\/$/;
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
|
-
* @typedef {
|
|
15
|
+
* @typedef {object} Google2DImageryProvider.ConstructorOptions
|
|
15
16
|
*
|
|
16
17
|
* Initialization options for the Google2DImageryProvider constructor
|
|
17
18
|
*
|
|
18
|
-
* @property {
|
|
19
|
-
* @property {string}
|
|
20
|
-
* @property {string}
|
|
21
|
-
* @property {string
|
|
22
|
-
* @property {string}
|
|
23
|
-
* @property {
|
|
24
|
-
* @property {
|
|
25
|
-
* @property {number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
19
|
+
* @property {string} key The Google api key to send with tile requests.
|
|
20
|
+
* @property {string} session The Google session token that tracks the current state of your map and viewport.
|
|
21
|
+
* @property {string|Resource|IonResource} url The Google 2D maps endpoint.
|
|
22
|
+
* @property {string} tileWidth The width of each tile in pixels.
|
|
23
|
+
* @property {string} tileHeight The height of each tile in pixels.
|
|
24
|
+
* @property {Ellipsoid} [ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
25
|
+
* @property {number} [minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
26
26
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
27
27
|
* to result in rendering problems.
|
|
28
|
-
* @property {number} [
|
|
29
|
-
* @property {Rectangle} [
|
|
28
|
+
* @property {number} [maximumLevel=22] The maximum level-of-detail supported by the imagery provider.
|
|
29
|
+
* @property {Rectangle} [rectangle=Rectangle.MAX_VALUE] The rectangle, in radians, covered by the image.
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
32
|
/**
|
|
@@ -36,7 +36,7 @@ const trailingSlashRegex = /\/$/;
|
|
|
36
36
|
*
|
|
37
37
|
*
|
|
38
38
|
* Provides 2D image tiles from {@link https://developers.google.com/maps/documentation/tile/2d-tiles-overview|Google 2D Tiles}.
|
|
39
|
-
*
|
|
39
|
+
*
|
|
40
40
|
* Google 2D Tiles can only be used with the Google geocoder.
|
|
41
41
|
*
|
|
42
42
|
* @alias Google2DImageryProvider
|
|
@@ -52,7 +52,7 @@ const trailingSlashRegex = /\/$/;
|
|
|
52
52
|
* @example
|
|
53
53
|
* // Use your own Google api key
|
|
54
54
|
* Cesium.GoogleMaps.defaultApiKey = "your-api-key";
|
|
55
|
-
*
|
|
55
|
+
*
|
|
56
56
|
* const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({
|
|
57
57
|
* mapType: "SATELLITE"
|
|
58
58
|
* });
|
|
@@ -101,6 +101,8 @@ function Google2DImageryProvider(options) {
|
|
|
101
101
|
key: encodeURIComponent(options.key),
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
+
this._resource = resource.clone();
|
|
105
|
+
|
|
104
106
|
let credit;
|
|
105
107
|
if (defined(options.credit)) {
|
|
106
108
|
credit = options.credit;
|
|
@@ -125,8 +127,6 @@ function Google2DImageryProvider(options) {
|
|
|
125
127
|
// This will be defined for ion resources
|
|
126
128
|
this._tileCredits = resource.credits;
|
|
127
129
|
this._attributionsByLevel = undefined;
|
|
128
|
-
// Asynchronously request and populate _attributionsByLevel
|
|
129
|
-
this.getViewportCredits();
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
Object.defineProperties(Google2DImageryProvider.prototype, {
|
|
@@ -296,7 +296,7 @@ Object.defineProperties(Google2DImageryProvider.prototype, {
|
|
|
296
296
|
* @param {string} [options.language="en_US"] an IETF language tag that specifies the language used to display information on the tiles
|
|
297
297
|
* @param {string} [options.region="US"] A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user.
|
|
298
298
|
* @param {"layerRoadmap" | "layerStreetview" | "layerTraffic"} [options.overlayLayerType] Returns a transparent overlay map with the specified layerType. If no value is provided, a basemap of mapType is returned. Use multiple instances of Google2DImageryProvider to add multiple Google Maps overlays to a scene. layerRoadmap is included in terrain and roadmap mapTypes, so adding as overlay to terrain or roadmap has no effect.
|
|
299
|
-
* @param {
|
|
299
|
+
* @param {object} [options.styles] An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the mapType is roadmap. For the complete style syntax, see the ({@link https://developers.google.com/maps/documentation/tile/style-reference|Google Style Reference}).
|
|
300
300
|
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
301
301
|
* @param {number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
302
302
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
@@ -314,7 +314,7 @@ Object.defineProperties(Google2DImageryProvider.prototype, {
|
|
|
314
314
|
* });
|
|
315
315
|
* @example
|
|
316
316
|
* // Google 2D roadmap overlay with custom styles
|
|
317
|
-
* const
|
|
317
|
+
* const googleTilesProvider = Cesium.Google2DImageryProvider.fromIonAssetId({
|
|
318
318
|
* assetId: 3830184,
|
|
319
319
|
* overlayLayerType: "layerRoadmap",
|
|
320
320
|
* styles: [
|
|
@@ -354,10 +354,6 @@ Google2DImageryProvider.fromIonAssetId = async function (options) {
|
|
|
354
354
|
},
|
|
355
355
|
);
|
|
356
356
|
|
|
357
|
-
const endpoint = await endpointResource.fetchJson();
|
|
358
|
-
const endpointOptions = { ...endpoint.options };
|
|
359
|
-
delete endpointOptions.url;
|
|
360
|
-
|
|
361
357
|
const providerOptions = {
|
|
362
358
|
language: options.language,
|
|
363
359
|
region: options.region,
|
|
@@ -368,11 +364,15 @@ Google2DImageryProvider.fromIonAssetId = async function (options) {
|
|
|
368
364
|
credit: options.credit,
|
|
369
365
|
};
|
|
370
366
|
|
|
371
|
-
|
|
372
|
-
|
|
367
|
+
const endpoint = await endpointResource.fetchJson();
|
|
368
|
+
const url = endpoint.options.url;
|
|
369
|
+
delete endpoint.options.url;
|
|
370
|
+
endpoint.options = {
|
|
371
|
+
...endpoint.options,
|
|
373
372
|
...providerOptions,
|
|
374
|
-
|
|
375
|
-
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
return createFromIonEndpoint(url, endpoint, endpointResource);
|
|
376
376
|
};
|
|
377
377
|
|
|
378
378
|
/**
|
|
@@ -383,7 +383,7 @@ Google2DImageryProvider.fromIonAssetId = async function (options) {
|
|
|
383
383
|
* @param {string} [options.language="en_US"] an IETF language tag that specifies the language used to display information on the tiles
|
|
384
384
|
* @param {string} [options.region="US"] A Common Locale Data Repository region identifier (two uppercase letters) that represents the physical location of the user.
|
|
385
385
|
* @param {"layerRoadmap" | "layerStreetview" | "layerTraffic"} [options.overlayLayerType] Returns a transparent overlay map with the specified layerType. If no value is provided, a basemap of mapType is returned. Use multiple instances of Google2DImageryProvider to add multiple Google Maps overlays to a scene. layerRoadmap is included in terrain and roadmap mapTypes, so adding as overlay to terrain or roadmap has no effect.
|
|
386
|
-
* @param {
|
|
386
|
+
* @param {object} [options.styles] An array of JSON style objects that specify the appearance and detail level of map features such as roads, parks, and built-up areas. Styling is used to customize the standard Google base map. The styles parameter is valid only if the mapType is roadmap. For the complete style syntax, see the ({@link https://developers.google.com/maps/documentation/tile/style-reference|Google Style Reference}).
|
|
387
387
|
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.default] The ellipsoid. If not specified, the default ellipsoid is used.
|
|
388
388
|
* @param {number} [options.minimumLevel=0] The minimum level-of-detail supported by the imagery provider. Take care when specifying
|
|
389
389
|
* this that the number of tiles at the minimum level is small, such as four or less. A larger number is likely
|
|
@@ -405,7 +405,7 @@ Google2DImageryProvider.fromIonAssetId = async function (options) {
|
|
|
405
405
|
* // Google 2D roadmap overlay with custom styles
|
|
406
406
|
* Cesium.GoogleMaps.defaultApiKey = "your-api-key";
|
|
407
407
|
*
|
|
408
|
-
* const
|
|
408
|
+
* const googleTilesProvider = Cesium.Google2DImageryProvider.fromUrl({
|
|
409
409
|
* overlayLayerType: "layerRoadmap",
|
|
410
410
|
* styles: [
|
|
411
411
|
* {
|
|
@@ -486,7 +486,21 @@ Google2DImageryProvider.prototype.requestImage = function (
|
|
|
486
486
|
level,
|
|
487
487
|
request,
|
|
488
488
|
) {
|
|
489
|
-
|
|
489
|
+
const promise = this._imageryProvider.requestImage(x, y, level, request);
|
|
490
|
+
|
|
491
|
+
// If the requestImage call returns undefined, it couldn't be scheduled this frame. Make sure to return undefined so this can be handled upstream.
|
|
492
|
+
if (!defined(promise)) {
|
|
493
|
+
return undefined;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
// Asynchronously request and populate _attributionsByLevel if it hasn't been already. We do this here so that the promise can be properly awaited.
|
|
497
|
+
if (!defined(this._attributionsByLevel)) {
|
|
498
|
+
return Promise.all([promise, this.getViewportCredits()]).then(
|
|
499
|
+
(results) => results[0],
|
|
500
|
+
);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
return promise;
|
|
490
504
|
};
|
|
491
505
|
|
|
492
506
|
/**
|
|
@@ -521,12 +535,7 @@ Google2DImageryProvider.prototype.getViewportCredits = async function () {
|
|
|
521
535
|
const promises = [];
|
|
522
536
|
for (let level = 0; level < maximumLevel + 1; level++) {
|
|
523
537
|
promises.push(
|
|
524
|
-
fetchViewportAttribution(
|
|
525
|
-
this._viewportUrl,
|
|
526
|
-
this._key,
|
|
527
|
-
this._session,
|
|
528
|
-
level,
|
|
529
|
-
),
|
|
538
|
+
fetchViewportAttribution(this._resource, this._viewportUrl, level),
|
|
530
539
|
);
|
|
531
540
|
}
|
|
532
541
|
const results = await Promise.all(promises);
|
|
@@ -547,12 +556,10 @@ Google2DImageryProvider.prototype.getViewportCredits = async function () {
|
|
|
547
556
|
return attributionsByLevel;
|
|
548
557
|
};
|
|
549
558
|
|
|
550
|
-
async function fetchViewportAttribution(
|
|
551
|
-
const
|
|
552
|
-
url
|
|
559
|
+
async function fetchViewportAttribution(resource, url, level) {
|
|
560
|
+
const viewportResource = resource.getDerivedResource({
|
|
561
|
+
url,
|
|
553
562
|
queryParameters: {
|
|
554
|
-
key,
|
|
555
|
-
session,
|
|
556
563
|
zoom: level,
|
|
557
564
|
north: 90,
|
|
558
565
|
south: -90,
|
|
@@ -561,7 +568,7 @@ async function fetchViewportAttribution(url, key, session, level) {
|
|
|
561
568
|
},
|
|
562
569
|
data: JSON.stringify(Frozen.EMPTY_OBJECT),
|
|
563
570
|
});
|
|
564
|
-
const viewportJson =
|
|
571
|
+
const viewportJson = await viewportResource.fetchJson();
|
|
565
572
|
return viewportJson.copyright;
|
|
566
573
|
}
|
|
567
574
|
|
|
@@ -436,7 +436,7 @@ Object.defineProperties(GoogleEarthEnterpriseMapsProvider.prototype, {
|
|
|
436
436
|
/**
|
|
437
437
|
* Creates a tiled imagery provider using the Google Earth Imagery API.
|
|
438
438
|
*
|
|
439
|
-
* @param {Resource|
|
|
439
|
+
* @param {Resource|string} url The url of the Google Earth server hosting the imagery.
|
|
440
440
|
* @param {GoogleEarthEnterpriseMapsProvider.ConstructorOptions} [options] Object describing initialization options
|
|
441
441
|
* @returns {Promise<GoogleEarthEnterpriseMapsProvider>} The created GoogleEarthEnterpriseMapsProvider.
|
|
442
442
|
*
|
|
@@ -63,7 +63,7 @@ import Lerc from "lerc";
|
|
|
63
63
|
import Rectangle from "../Core/Rectangle.js";
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
|
-
* @typedef {
|
|
66
|
+
* @typedef {object} I3SDataProvider.ConstructorOptions
|
|
67
67
|
*
|
|
68
68
|
* Initialization options for the I3SDataProvider constructor
|
|
69
69
|
*
|
|
@@ -41,11 +41,11 @@ async function initializeDecoder() {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Transcodes I3S to glTF in a web worker
|
|
44
|
-
* @param {
|
|
45
|
-
* @param {
|
|
44
|
+
* @param {string} url custom attributes source URL
|
|
45
|
+
* @param {object} defaultGeometrySchema Schema to use during decoding
|
|
46
46
|
* @param {I3SGeometry} geometryData The draco encoded geometry data
|
|
47
47
|
* @param {Array} [featureData] The draco encoded feature data
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {object} [symbologyData] The rendering symbology to apply
|
|
49
49
|
* @returns Promise<undefined|object> Returns a promise which resolves to the glTF result, or undefined if the task cannot be scheduled this frame.
|
|
50
50
|
*
|
|
51
51
|
* @exception {RuntimeError} I3S decoder could not be initialized.
|
|
@@ -35,7 +35,7 @@ const ITwinData = {};
|
|
|
35
35
|
*
|
|
36
36
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
37
37
|
*
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {object} options
|
|
39
39
|
* @param {string} options.iModelId The id of the iModel to load
|
|
40
40
|
* @param {Cesium3DTileset.ConstructorOptions} [options.tilesetOptions] Object containing options to pass to the internally created {@link Cesium3DTileset}.
|
|
41
41
|
* @param {string} [options.changesetId] The id of the changeset to load, if not provided the latest changesets will be used
|
|
@@ -95,7 +95,7 @@ ITwinData.createTilesetFromIModelId = async function ({
|
|
|
95
95
|
*
|
|
96
96
|
* @experimental This feature is not final and is subject to change without Cesium's standard deprecation policy.
|
|
97
97
|
*
|
|
98
|
-
* @param {
|
|
98
|
+
* @param {object} options
|
|
99
99
|
* @param {string} options.iTwinId The id of the iTwin to load data from
|
|
100
100
|
* @param {string} options.realityDataId The id of the reality data to load
|
|
101
101
|
* @param {ITwinPlatform.RealityDataType} [options.type] The type of this reality data
|
|
@@ -169,7 +169,7 @@ ITwinData.createTilesetForRealityDataId = async function ({
|
|
|
169
169
|
* If the <code>type</code> or <code>rootDocument</code> are not provided this function
|
|
170
170
|
* will first request the full metadata for the specified reality data to fill these values.
|
|
171
171
|
*
|
|
172
|
-
* @param {
|
|
172
|
+
* @param {object} options
|
|
173
173
|
* @param {string} options.iTwinId The id of the iTwin to load data from
|
|
174
174
|
* @param {string} options.realityDataId The id of the reality data to load
|
|
175
175
|
* @param {ITwinPlatform.RealityDataType} [options.type] The type of this reality data
|
|
@@ -232,7 +232,7 @@ ITwinData.createDataSourceForRealityDataId = async function ({
|
|
|
232
232
|
/**
|
|
233
233
|
* Load data from the Geospatial Features API as GeoJSON.
|
|
234
234
|
*
|
|
235
|
-
* @param {
|
|
235
|
+
* @param {object} options
|
|
236
236
|
* @param {string} options.iTwinId The id of the iTwin to load data from
|
|
237
237
|
* @param {string} options.collectionId The id of the data collection to load
|
|
238
238
|
* @param {number} [options.limit=10000] number of items per page, must be between 1 and 10,000 inclusive
|
|
@@ -40,7 +40,7 @@ import SplitDirection from "./SplitDirection.js";
|
|
|
40
40
|
import TileImagery from "./TileImagery.js";
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
|
-
* @typedef {
|
|
43
|
+
* @typedef {object} ImageryLayer.ConstructorOptions
|
|
44
44
|
*
|
|
45
45
|
* Initialization options for the ImageryLayer constructor.
|
|
46
46
|
*
|
|
@@ -459,14 +459,13 @@ function deriveChildTile(
|
|
|
459
459
|
// as the bounding volumes are needed below.
|
|
460
460
|
let tileMetadata;
|
|
461
461
|
let tileBounds;
|
|
462
|
-
let contentBounds;
|
|
463
462
|
if (defined(subtree.tilePropertyTableJson)) {
|
|
464
463
|
tileMetadata = subtree.getTileMetadataView(implicitCoordinates);
|
|
465
464
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
465
|
+
tileBounds = BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(
|
|
466
|
+
"TILE",
|
|
467
|
+
tileMetadata,
|
|
468
|
+
);
|
|
470
469
|
}
|
|
471
470
|
|
|
472
471
|
// Content is not loaded at this point, so this flag is set for future reference.
|
|
@@ -502,6 +501,20 @@ function deriveChildTile(
|
|
|
502
501
|
uri: childContentUri,
|
|
503
502
|
};
|
|
504
503
|
|
|
504
|
+
let contentBounds;
|
|
505
|
+
|
|
506
|
+
if (subtree.contentPropertyTableJsons.length > 0) {
|
|
507
|
+
const contentMetadata = subtree.getContentMetadataView(
|
|
508
|
+
implicitCoordinates,
|
|
509
|
+
i,
|
|
510
|
+
);
|
|
511
|
+
|
|
512
|
+
contentBounds = BoundingVolumeSemantics.parseAllBoundingVolumeSemantics(
|
|
513
|
+
"CONTENT",
|
|
514
|
+
contentMetadata,
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
|
|
505
518
|
const contentBoundingVolume = getContentBoundingVolume(
|
|
506
519
|
boundingVolume,
|
|
507
520
|
contentBounds,
|
|
@@ -892,7 +905,6 @@ function deriveBoundingVolumeS2(
|
|
|
892
905
|
}
|
|
893
906
|
|
|
894
907
|
// Extract the first 3 face bits from the 64-bit S2 cell ID.
|
|
895
|
-
// eslint-disable-next-line no-undef
|
|
896
908
|
const face = Number(parentTile._boundingVolume.s2Cell._cellId >> BigInt(61));
|
|
897
909
|
// The Hilbert curve is rotated for the "odd" faces on the S2 Earthcube.
|
|
898
910
|
// See http://s2geometry.io/devguide/img/s2cell_global.jpg
|
|
@@ -900,7 +912,6 @@ function deriveBoundingVolumeS2(
|
|
|
900
912
|
face % 2 === 0
|
|
901
913
|
? HilbertOrder.encode2D(level, x, y)
|
|
902
914
|
: HilbertOrder.encode2D(level, y, x);
|
|
903
|
-
// eslint-disable-next-line no-undef
|
|
904
915
|
const cell = S2Cell.fromFacePositionLevel(face, BigInt(position), level);
|
|
905
916
|
|
|
906
917
|
let minHeight, maxHeight;
|