@cesium/engine 25.0.0 → 26.0.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/Workers/{chunk-GPIGURCG.js → chunk-3VFEWOBI.js} +7 -7
- package/Build/Workers/{chunk-BTX2NL3P.js → chunk-424RNO3D.js} +18 -18
- package/Build/Workers/{chunk-HSVQATK2.js → chunk-4MGMYHOO.js} +6 -6
- package/Build/Workers/{chunk-FIBS5S7R.js → chunk-4S7IE3LB.js} +2 -2
- package/Build/Workers/{chunk-A7ZBMVFS.js → chunk-52JDLOEM.js} +14 -14
- package/Build/Workers/{chunk-ZCCIIBZT.js → chunk-54I6Y66F.js} +6 -6
- package/Build/Workers/{chunk-J647NNZW.js → chunk-6YEE6JDR.js} +6 -6
- package/Build/Workers/{chunk-HVMG6AG4.js → chunk-7J2HKPRH.js} +9 -9
- package/Build/Workers/{chunk-K6NFIRFB.js → chunk-7WM2PX4V.js} +5 -5
- package/Build/Workers/{chunk-3LSD7OOA.js → chunk-ACXQXN46.js} +16 -16
- package/Build/Workers/{chunk-CZ23Y3RM.js → chunk-AYKR4VBR.js} +2 -2
- package/Build/Workers/{chunk-4MTRQFJP.js → chunk-C6J67V5A.js} +1 -1
- package/Build/Workers/{chunk-WTQGE7Q6.js → chunk-C6KNZ7T4.js} +17 -17
- package/Build/Workers/{chunk-AWFZHD2B.js → chunk-CFQP6LYM.js} +4 -4
- package/Build/Workers/{chunk-ST2UWDUU.js → chunk-CXOYE2WM.js} +5 -5
- package/Build/Workers/{chunk-H2A4USJR.js → chunk-CZEYZU4N.js} +10 -10
- package/Build/Workers/{chunk-DFEI5MAV.js → chunk-DBOEKL43.js} +7 -7
- package/Build/Workers/{chunk-A7A433MD.js → chunk-DDWSZVMY.js} +5 -5
- package/Build/Workers/{chunk-J7KQEKPK.js → chunk-DOBXCNC3.js} +13 -13
- package/Build/Workers/{chunk-URUCCIPS.js → chunk-E7VQ76KE.js} +6 -6
- package/Build/Workers/{chunk-ZAPOS52G.js → chunk-EBSIOBXY.js} +8 -8
- package/Build/Workers/{chunk-3VDDRF2E.js → chunk-EF2QYXGA.js} +14 -14
- package/Build/Workers/{chunk-WN6P5UDH.js → chunk-EPYXRCDB.js} +12 -12
- package/Build/Workers/{chunk-EZARA5FJ.js → chunk-F6QDY6HU.js} +13 -13
- package/Build/Workers/{chunk-GL7DNVUS.js → chunk-FRQZECAO.js} +5 -5
- package/Build/Workers/{chunk-VQKLRBIK.js → chunk-G7PXZRVF.js} +7 -7
- package/Build/Workers/{chunk-4QQXGTCE.js → chunk-INUEEEQA.js} +8 -8
- package/Build/Workers/{chunk-ITD2IN7N.js → chunk-IRBKFCEJ.js} +2 -2
- package/Build/Workers/{chunk-6SDGQI27.js → chunk-IYOUHCZB.js} +1 -1
- package/Build/Workers/{chunk-DYT5NR6P.js → chunk-J6BWOHUF.js} +3 -3
- package/Build/Workers/{chunk-4GF4MVPY.js → chunk-KFSTQKNM.js} +7 -7
- package/Build/Workers/{chunk-4XXHJI6Y.js → chunk-KKOSKAZB.js} +17 -17
- package/Build/Workers/{chunk-WC57YYBN.js → chunk-KSSWJIZW.js} +2 -2
- package/Build/Workers/{chunk-5T6QQAJW.js → chunk-M3B5JKSM.js} +1 -1
- package/Build/Workers/{chunk-QO2CGXMP.js → chunk-MPZHGZU6.js} +6 -6
- package/Build/Workers/{chunk-WUBKZFF6.js → chunk-MYP774IS.js} +9 -9
- package/Build/Workers/{chunk-WNN5D4W3.js → chunk-O3EA5HS7.js} +10 -10
- package/Build/Workers/{chunk-77RL3MBD.js → chunk-P3CK7MCY.js} +25 -4
- package/Build/Workers/{chunk-QXNQQYPV.js → chunk-Q3PY526V.js} +8 -8
- package/Build/Workers/{chunk-CKQP3DSS.js → chunk-QN67VG36.js} +6 -6
- package/Build/Workers/{chunk-ACFFCHHZ.js → chunk-QRWGUWI6.js} +11 -11
- package/Build/Workers/{chunk-LH5SF3XV.js → chunk-S4MCOY6I.js} +5 -5
- package/Build/Workers/{chunk-FVLVVOBQ.js → chunk-SMQZZOW6.js} +10 -10
- package/Build/Workers/{chunk-TA777BGS.js → chunk-TKKIREQ6.js} +1 -1
- package/Build/Workers/{chunk-AEAVLYPS.js → chunk-U3ZA64U7.js} +2 -2
- package/Build/Workers/{chunk-7LSFAEWF.js → chunk-UA25D5MX.js} +10 -10
- package/Build/Workers/{chunk-J3OFS2RD.js → chunk-UOOIQ3KX.js} +12 -12
- package/Build/Workers/{chunk-ND3NTTOF.js → chunk-V7VQKN6N.js} +6 -6
- package/Build/Workers/{chunk-I3A6DXYZ.js → chunk-VQYETPWC.js} +4 -4
- package/Build/Workers/{chunk-35H3UBIO.js → chunk-VWV2IJRB.js} +11 -11
- package/Build/Workers/{chunk-QSDY4NS7.js → chunk-XZMBNNDX.js} +9 -9
- package/Build/Workers/{chunk-TAI4HLII.js → chunk-Y57HREW5.js} +4 -4
- package/Build/Workers/{chunk-3TKLDHV3.js → chunk-Y5BF6AFU.js} +2 -2
- package/Build/Workers/{chunk-3XY3MVPG.js → chunk-YLY7NKAB.js} +4 -4
- package/Build/Workers/{chunk-BVAIWR7O.js → chunk-ZK3CF7ZD.js} +12 -12
- package/Build/Workers/{chunk-DH26SNAB.js → chunk-ZP7JMQV4.js} +1 -1
- package/Build/Workers/{chunk-3RFFPH4M.js → chunk-ZZ46LWL6.js} +1 -1
- package/Build/Workers/combineGeometry.js +24 -24
- package/Build/Workers/createBoxGeometry.js +18 -18
- package/Build/Workers/createBoxOutlineGeometry.js +16 -16
- package/Build/Workers/createCircleGeometry.js +26 -26
- package/Build/Workers/createCircleOutlineGeometry.js +19 -19
- package/Build/Workers/createCoplanarPolygonGeometry.js +33 -33
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +31 -31
- package/Build/Workers/createCorridorGeometry.js +29 -29
- package/Build/Workers/createCorridorOutlineGeometry.js +28 -28
- package/Build/Workers/createCylinderGeometry.js +20 -20
- package/Build/Workers/createCylinderOutlineGeometry.js +18 -18
- package/Build/Workers/createEllipseGeometry.js +26 -26
- package/Build/Workers/createEllipseOutlineGeometry.js +19 -19
- package/Build/Workers/createEllipsoidGeometry.js +19 -19
- package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -18
- package/Build/Workers/createFrustumGeometry.js +18 -18
- package/Build/Workers/createFrustumOutlineGeometry.js +18 -18
- package/Build/Workers/createGeometry.js +24 -24
- package/Build/Workers/createGroundPolylineGeometry.js +22 -22
- package/Build/Workers/createPlaneGeometry.js +16 -16
- package/Build/Workers/createPlaneOutlineGeometry.js +15 -15
- package/Build/Workers/createPolygonGeometry.js +32 -32
- package/Build/Workers/createPolygonOutlineGeometry.js +30 -30
- package/Build/Workers/createPolylineGeometry.js +25 -25
- package/Build/Workers/createPolylineVolumeGeometry.js +31 -31
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +27 -27
- package/Build/Workers/createRectangleGeometry.js +27 -27
- package/Build/Workers/createRectangleOutlineGeometry.js +20 -20
- package/Build/Workers/createSimplePolylineGeometry.js +23 -23
- package/Build/Workers/createSphereGeometry.js +19 -19
- package/Build/Workers/createSphereOutlineGeometry.js +18 -18
- package/Build/Workers/createTaskProcessorWorker.js +3 -3
- package/Build/Workers/createVectorTileClampedPolylines.js +14 -14
- package/Build/Workers/createVectorTileGeometries.js +24 -24
- package/Build/Workers/createVectorTilePoints.js +13 -13
- package/Build/Workers/createVectorTilePolygons.js +22 -22
- package/Build/Workers/createVectorTilePolylines.js +14 -14
- package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +22 -22
- package/Build/Workers/createVerticesFromHeightmap.js +22 -22
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +20 -20
- package/Build/Workers/createWallGeometry.js +24 -24
- package/Build/Workers/createWallOutlineGeometry.js +23 -23
- package/Build/Workers/decodeDraco.js +10 -10
- package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
- package/Build/Workers/decodeI3S.js +10 -10
- package/Build/Workers/gaussianSplatSorter.js +4 -4
- package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
- package/Build/Workers/incrementallyBuildTerrainPicker.js +10 -10
- package/Build/Workers/transcodeKTX2.js +6 -6
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +22 -22
- package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
- package/Source/Core/Cartesian2.js +1 -1
- package/Source/Core/Cartesian3.js +1 -1
- package/Source/Core/Cartesian4.js +1 -1
- package/Source/Core/ComponentDatatype.js +35 -0
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/MapProjection.js +1 -0
- package/Source/Core/Matrix2.js +1 -1
- package/Source/Core/Matrix3.js +1 -1
- package/Source/Core/Matrix4.js +1 -1
- package/Source/Core/Resource.js +1 -1
- package/Source/Core/ScreenSpaceEventHandler.js +51 -41
- package/Source/Core/createColorRamp.js +37 -0
- package/Source/Core/globalTypes.js +25 -0
- package/Source/Renderer/Pass.js +3 -2
- package/Source/Renderer/createUniform.js +346 -239
- package/Source/Renderer/createUniformArray.js +494 -381
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/BufferPoint.js +1 -0
- package/Source/Scene/BufferPointCollection.js +14 -1
- package/Source/Scene/BufferPolygon.js +3 -2
- package/Source/Scene/BufferPolygonCollection.js +10 -0
- package/Source/Scene/BufferPolyline.js +1 -0
- package/Source/Scene/BufferPolylineCollection.js +2 -0
- package/Source/Scene/BufferPrimitiveCollection.js +79 -28
- package/Source/Scene/CameraEventAggregator.js +30 -18
- package/Source/Scene/Cesium3DTile.js +54 -1
- package/Source/Scene/Cesium3DTileContent.js +195 -254
- package/Source/Scene/Cesium3DTileContentFactory.js +10 -2
- package/Source/Scene/Cesium3DTileset.js +45 -5
- package/Source/Scene/Composite3DTileContent.js +254 -292
- package/Source/Scene/EdgeDisplayMode.js +50 -0
- package/Source/Scene/Empty3DTileContent.js +100 -132
- package/Source/Scene/GaussianSplat3DTileContent.js +436 -478
- package/Source/Scene/GeoJsonPrimitive.js +874 -0
- package/Source/Scene/Geometry3DTileContent.js +151 -185
- package/Source/Scene/GltfLoader.js +109 -0
- package/Source/Scene/Implicit3DTileContent.js +179 -214
- package/Source/Scene/MVTDataProvider.js +147 -0
- package/Source/Scene/Model/EdgeVisibilityPipelineStage.js +79 -311
- package/Source/Scene/Model/Model.js +34 -0
- package/Source/Scene/Model/Model3DTileContent.js +424 -458
- package/Source/Scene/Model/ModelDrawCommand.js +31 -3
- package/Source/Scene/Model/ModelUtility.js +4 -0
- package/Source/Scene/Model/createVectorTileBuffersFromModelComponents.js +466 -150
- package/Source/Scene/ModelComponents.js +39 -1
- package/Source/Scene/Multiple3DTileContent.js +291 -334
- package/Source/Scene/Scene.js +26 -0
- package/Source/Scene/Tileset3DTileContent.js +113 -146
- package/Source/Scene/UrlTemplate3DTilesDataProvider.js +499 -0
- package/Source/Scene/Vector3DTileContent.js +205 -234
- package/Source/Scene/VectorGltf3DTileContent.js +85 -36
- package/Source/Scene/VoxelPrimitive.js +159 -175
- package/Source/Scene/VoxelProvider.js +64 -91
- package/Source/Scene/buildVectorGltfFromMVT.js +1059 -0
- package/Source/Scene/buildVoxelCustomShader.js +199 -0
- package/Source/Scene/decodeMVT.js +634 -0
- package/Source/Scene/renderBufferPointCollection.js +110 -64
- package/Source/Scene/renderBufferPolygonCollection.js +102 -55
- package/Source/Scene/renderBufferPolylineCollection.js +365 -166
- package/Source/Shaders/BufferPointMaterialFS.glsl +1 -0
- package/Source/Shaders/BufferPointMaterialFS.js +1 -0
- package/Source/Shaders/BufferPointMaterialVS.glsl +19 -9
- package/Source/Shaders/BufferPointMaterialVS.js +20 -10
- package/Source/Shaders/BufferPolygonMaterialVS.glsl +13 -4
- package/Source/Shaders/BufferPolygonMaterialVS.js +14 -5
- package/Source/Shaders/BufferPolylineMaterialVS.glsl +16 -2
- package/Source/Shaders/BufferPolylineMaterialVS.js +17 -3
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.glsl +9 -0
- package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
- package/Source/Shaders/Builtin/Constants/passOverlay.glsl +1 -1
- package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
- package/Source/Shaders/Builtin/CzmBuiltins.js +2 -0
- package/Source/Shaders/Model/EdgeVisibilityStageVS.glsl +0 -1
- package/Source/Shaders/Model/EdgeVisibilityStageVS.js +0 -1
- package/index.d.ts +253 -35
- package/index.js +71 -62
- package/package.json +2 -2
|
@@ -10,7 +10,6 @@ import BufferPolyline from "./BufferPolyline.js";
|
|
|
10
10
|
import BufferPolylineCollection from "./BufferPolylineCollection.js";
|
|
11
11
|
import BufferPolylineMaterial from "./BufferPolylineMaterial.js";
|
|
12
12
|
import Cesium3DTileStyle from "./Cesium3DTileStyle.js";
|
|
13
|
-
import Color from "../Core/Color.js";
|
|
14
13
|
import Matrix4 from "../Core/Matrix4.js";
|
|
15
14
|
import Model from "./Model/Model.js";
|
|
16
15
|
import ModelUtility from "./Model/ModelUtility.js";
|
|
@@ -28,6 +27,7 @@ import DeveloperError from "../Core/DeveloperError.js";
|
|
|
28
27
|
/** @import Cesium3DTileBatchTable from "./Cesium3DTileBatchTable.js"; */
|
|
29
28
|
/** @import Cesium3DTileVectorFeature from "./Cesium3DTileVectorFeature.js";*/
|
|
30
29
|
/** @import Cesium3DTileset from "./Cesium3DTileset.js"; */
|
|
30
|
+
/** @import Color from "../Core/Color.js"; */
|
|
31
31
|
/** @import FrameState from "./FrameState.js"; */
|
|
32
32
|
/** @import ImplicitMetadataView from "./ImplicitMetadataView.js"; */
|
|
33
33
|
/** @import Ray from "../Core/Ray.js"; */
|
|
@@ -73,14 +73,30 @@ class VectorGltf3DTileContent {
|
|
|
73
73
|
/** @type {Model} */
|
|
74
74
|
this._model = undefined;
|
|
75
75
|
|
|
76
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* List of all vector primitive collections.
|
|
78
|
+
* @type {Array<BufferPrimitiveCollection<BufferPrimitive>>}
|
|
79
|
+
*/
|
|
77
80
|
this._collections = [];
|
|
78
81
|
|
|
79
|
-
/**
|
|
82
|
+
/**
|
|
83
|
+
* List of transform matrices for each collection; order matches 'collections'.
|
|
84
|
+
* @type {Array<Matrix4>}
|
|
85
|
+
*/
|
|
80
86
|
this._collectionLocalMatrices = [];
|
|
81
87
|
|
|
82
|
-
/**
|
|
83
|
-
|
|
88
|
+
/**
|
|
89
|
+
* Maps vector primitive collection -> propertyTableId.
|
|
90
|
+
* @type {Map<BufferPrimitiveCollection<BufferPrimitive>, number>}
|
|
91
|
+
*/
|
|
92
|
+
this._collectionFeatureTableIds = new Map();
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Maps propertyTableId -> featureId -> feature. Note that Feature IDs are
|
|
96
|
+
* unique within their assigned property table, but not globally unique.
|
|
97
|
+
* @type {Map<number, Map<number, Cesium3DTileVectorFeature>>}
|
|
98
|
+
*/
|
|
99
|
+
this._featuresByTableId = new Map();
|
|
84
100
|
|
|
85
101
|
/** @type {ImplicitMetadataView} */
|
|
86
102
|
this._metadata = undefined;
|
|
@@ -98,8 +114,8 @@ class VectorGltf3DTileContent {
|
|
|
98
114
|
}
|
|
99
115
|
|
|
100
116
|
get featuresLength() {
|
|
101
|
-
return this.
|
|
102
|
-
(acc,
|
|
117
|
+
return this.batchTables.reduce(
|
|
118
|
+
(acc, batchTable) => acc + batchTable.featuresLength,
|
|
103
119
|
0,
|
|
104
120
|
);
|
|
105
121
|
}
|
|
@@ -132,7 +148,11 @@ class VectorGltf3DTileContent {
|
|
|
132
148
|
}
|
|
133
149
|
|
|
134
150
|
get batchTableByteLength() {
|
|
135
|
-
return
|
|
151
|
+
return this.batchTables.reduce(
|
|
152
|
+
// @ts-expect-error Missing types.
|
|
153
|
+
(acc, batchTable) => acc + batchTable.batchTableByteLength,
|
|
154
|
+
0,
|
|
155
|
+
);
|
|
136
156
|
}
|
|
137
157
|
|
|
138
158
|
/** @returns {undefined} */
|
|
@@ -189,19 +209,21 @@ class VectorGltf3DTileContent {
|
|
|
189
209
|
|
|
190
210
|
/**
|
|
191
211
|
* @param {number} featureId
|
|
212
|
+
* @param {number} [featureTableId]
|
|
192
213
|
* @returns {Cesium3DTileVectorFeature}
|
|
193
214
|
*/
|
|
194
|
-
getFeature(featureId) {
|
|
195
|
-
return this.
|
|
215
|
+
getFeature(featureId, featureTableId) {
|
|
216
|
+
return this._featuresByTableId.get(featureTableId)?.get(featureId);
|
|
196
217
|
}
|
|
197
218
|
|
|
198
219
|
/**
|
|
199
220
|
* @param {number} featureId
|
|
200
221
|
* @param {string} name
|
|
222
|
+
* @param {number} [featureTableId]
|
|
201
223
|
* @returns {boolean}
|
|
202
224
|
*/
|
|
203
|
-
hasProperty(featureId, name) {
|
|
204
|
-
const feature = this.getFeature(featureId);
|
|
225
|
+
hasProperty(featureId, name, featureTableId) {
|
|
226
|
+
const feature = this.getFeature(featureId, featureTableId);
|
|
205
227
|
return feature ? feature.hasProperty(name) : false;
|
|
206
228
|
}
|
|
207
229
|
|
|
@@ -210,8 +232,10 @@ class VectorGltf3DTileContent {
|
|
|
210
232
|
* @param {Color} color
|
|
211
233
|
*/
|
|
212
234
|
applyDebugSettings(enabled, color) {
|
|
213
|
-
|
|
214
|
-
|
|
235
|
+
const colorString = enabled
|
|
236
|
+
? `color("${color.toCssHexString()}", 1.0)`
|
|
237
|
+
: 'color("white", 1.0)';
|
|
238
|
+
this.applyStyle(new Cesium3DTileStyle({ color: colorString }));
|
|
215
239
|
}
|
|
216
240
|
|
|
217
241
|
/**
|
|
@@ -226,40 +250,64 @@ class VectorGltf3DTileContent {
|
|
|
226
250
|
c instanceof BufferPolygonCollection;
|
|
227
251
|
|
|
228
252
|
for (const collection of this._collections.filter(isPointCollection)) {
|
|
253
|
+
const featureTableId = this._collectionFeatureTableIds.get(collection);
|
|
229
254
|
for (let i = 0, il = collection.primitiveCount; i < il; i++) {
|
|
230
255
|
collection.get(i, point);
|
|
231
|
-
const feature = this.getFeature(point.featureId);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
256
|
+
const feature = this.getFeature(point.featureId, featureTableId);
|
|
257
|
+
|
|
258
|
+
if (defined(style.show)) {
|
|
259
|
+
point.show = style.show.evaluate(feature);
|
|
260
|
+
}
|
|
261
|
+
if (defined(style.color)) {
|
|
262
|
+
style.color.evaluate(feature, pointMaterial.color);
|
|
263
|
+
}
|
|
264
|
+
if (defined(style.pointSize)) {
|
|
265
|
+
pointMaterial.size = style.pointSize.evaluate(feature);
|
|
266
|
+
}
|
|
267
|
+
if (defined(style.pointOutlineWidth)) {
|
|
268
|
+
pointMaterial.outlineWidth =
|
|
269
|
+
style.pointOutlineWidth.evaluate(feature);
|
|
270
|
+
}
|
|
271
|
+
if (defined(style.pointOutlineColor)) {
|
|
272
|
+
style.pointOutlineColor.evaluate(feature, pointMaterial.outlineColor);
|
|
273
|
+
}
|
|
238
274
|
|
|
239
275
|
point.setMaterial(pointMaterial);
|
|
240
276
|
}
|
|
241
277
|
}
|
|
242
278
|
|
|
243
279
|
for (const collection of this._collections.filter(isPolylineCollection)) {
|
|
280
|
+
const featureTableId = this._collectionFeatureTableIds.get(collection);
|
|
244
281
|
for (let i = 0, il = collection.primitiveCount; i < il; i++) {
|
|
245
282
|
collection.get(i, polyline);
|
|
246
|
-
const feature = this.getFeature(polyline.featureId);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
283
|
+
const feature = this.getFeature(polyline.featureId, featureTableId);
|
|
284
|
+
|
|
285
|
+
if (defined(style.show)) {
|
|
286
|
+
polyline.show = style.show.evaluate(feature);
|
|
287
|
+
}
|
|
288
|
+
if (defined(style.color)) {
|
|
289
|
+
style.color.evaluate(feature, polylineMaterial.color);
|
|
290
|
+
}
|
|
291
|
+
if (defined(style.lineWidth)) {
|
|
292
|
+
polylineMaterial.width = style.lineWidth.evaluate(feature);
|
|
293
|
+
}
|
|
251
294
|
|
|
252
295
|
polyline.setMaterial(polylineMaterial);
|
|
253
296
|
}
|
|
254
297
|
}
|
|
255
298
|
|
|
256
299
|
for (const collection of this._collections.filter(isPolygonCollection)) {
|
|
300
|
+
const featureTableId = this._collectionFeatureTableIds.get(collection);
|
|
257
301
|
for (let i = 0, il = collection.primitiveCount; i < il; i++) {
|
|
258
302
|
collection.get(i, polygon);
|
|
259
|
-
const feature = this.getFeature(polygon.featureId);
|
|
303
|
+
const feature = this.getFeature(polygon.featureId, featureTableId);
|
|
260
304
|
|
|
261
|
-
|
|
262
|
-
|
|
305
|
+
if (defined(style.show)) {
|
|
306
|
+
polygon.show = style.show.evaluate(feature);
|
|
307
|
+
}
|
|
308
|
+
if (defined(style.color)) {
|
|
309
|
+
style.color.evaluate(feature, polygonMaterial.color);
|
|
310
|
+
}
|
|
263
311
|
|
|
264
312
|
polygon.setMaterial(polygonMaterial);
|
|
265
313
|
}
|
|
@@ -325,12 +373,12 @@ class VectorGltf3DTileContent {
|
|
|
325
373
|
* @param {Cesium3DTileset} tileset
|
|
326
374
|
* @param {Cesium3DTile} tile
|
|
327
375
|
* @param {Resource} resource
|
|
328
|
-
* @param {
|
|
376
|
+
* @param {Uint8Array} glb GLB binary produced by buildVectorGltfFromMVT
|
|
329
377
|
* @returns {Promise<VectorGltf3DTileContent>}
|
|
330
378
|
*/
|
|
331
|
-
static async fromGltf(tileset, tile, resource,
|
|
379
|
+
static async fromGltf(tileset, tile, resource, glb) {
|
|
332
380
|
const content = new VectorGltf3DTileContent(tileset, tile, resource);
|
|
333
|
-
const modelOptions = makeModelOptions(tileset, tile, content,
|
|
381
|
+
const modelOptions = makeModelOptions(tileset, tile, content, glb);
|
|
334
382
|
const model = await Model.fromGltfAsync(modelOptions);
|
|
335
383
|
// @ts-expect-error Requires Model conversion to ES6 class.
|
|
336
384
|
model.show = false;
|
|
@@ -343,13 +391,13 @@ class VectorGltf3DTileContent {
|
|
|
343
391
|
* @param {Cesium3DTileset} tileset
|
|
344
392
|
* @param {Cesium3DTile} tile
|
|
345
393
|
* @param {VectorGltf3DTileContent} content
|
|
346
|
-
* @param {
|
|
394
|
+
* @param {Uint8Array} glb
|
|
347
395
|
* @returns {*}
|
|
348
396
|
* @ignore
|
|
349
397
|
*/
|
|
350
|
-
function makeModelOptions(tileset, tile, content,
|
|
398
|
+
function makeModelOptions(tileset, tile, content, glb) {
|
|
351
399
|
return {
|
|
352
|
-
gltf:
|
|
400
|
+
gltf: glb,
|
|
353
401
|
basePath: content._resource,
|
|
354
402
|
cull: false,
|
|
355
403
|
releaseGltfJson: true,
|
|
@@ -397,7 +445,8 @@ function initializeVectorPrimitives(content) {
|
|
|
397
445
|
|
|
398
446
|
content._collections = result.collections;
|
|
399
447
|
content._collectionLocalMatrices = result.collectionLocalMatrices;
|
|
400
|
-
content.
|
|
448
|
+
content._collectionFeatureTableIds = result.collectionFeatureTableIds;
|
|
449
|
+
content._featuresByTableId = result.featuresByTableId;
|
|
401
450
|
}
|
|
402
451
|
|
|
403
452
|
export default VectorGltf3DTileContent;
|