@cesium/engine 2.4.1 → 3.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/cesiumWorkerBootstrapper.js +1 -1
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +0 -22
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +0 -75
- package/Source/Core/CesiumTerrainProvider.js +0 -75
- package/Source/Core/CustomHeightmapTerrainProvider.js +0 -38
- package/Source/Core/EllipsoidTerrainProvider.js +0 -37
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +0 -53
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +1 -101
- package/Source/Core/GoogleMaps.js +1 -1
- package/Source/Core/Ion.js +1 -2
- package/Source/Core/TerrainProvider.js +0 -22
- package/Source/Core/VRTheWorldTerrainProvider.js +0 -59
- package/Source/Core/sampleTerrain.js +0 -7
- package/Source/Core/sampleTerrainMostDetailed.js +0 -7
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +6 -5
- package/Source/DataSources/KmlTour.js +1 -12
- package/Source/DataSources/ModelVisualizer.js +0 -12
- package/Source/Renderer/Context.js +10 -2
- package/Source/Scene/ArcGisMapServerImageryProvider.js +7 -335
- package/Source/Scene/ArcGisMapService.js +1 -1
- package/Source/Scene/Billboard.js +7 -0
- package/Source/Scene/BingMapsImageryProvider.js +0 -326
- package/Source/Scene/Camera.js +1 -1
- package/Source/Scene/Cesium3DTile.js +4 -5
- package/Source/Scene/Cesium3DTileContent.js +0 -16
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +0 -123
- package/Source/Scene/Cesium3DTileset.js +183 -184
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +1 -1
- package/Source/Scene/Cesium3DTilesetCache.js +1 -3
- package/Source/Scene/Cesium3DTilesetSkipTraversal.js +5 -2
- package/Source/Scene/Cesium3DTilesetTraversal.js +2 -2
- package/Source/Scene/ClassificationPrimitive.js +5 -43
- package/Source/Scene/Composite3DTileContent.js +0 -27
- package/Source/Scene/CreditDisplay.js +0 -54
- package/Source/Scene/DerivedCommand.js +15 -10
- package/Source/Scene/Empty3DTileContent.js +0 -21
- package/Source/Scene/Geometry3DTileContent.js +0 -29
- package/Source/Scene/Globe.js +1 -9
- package/Source/Scene/GlobeSurfaceTile.js +13 -8
- package/Source/Scene/GlobeSurfaceTileProvider.js +8 -60
- package/Source/Scene/GltfPipeline/removeUnusedElements.js +27 -0
- package/Source/Scene/GltfPipeline/updateVersion.js +21 -4
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +1 -339
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +0 -326
- package/Source/Scene/GridImageryProvider.js +0 -274
- package/Source/Scene/GroundPolylinePrimitive.js +5 -38
- package/Source/Scene/GroundPrimitive.js +5 -43
- package/Source/Scene/I3SDataProvider.js +4 -99
- package/Source/Scene/I3SLayer.js +15 -22
- package/Source/Scene/Imagery.js +1 -9
- package/Source/Scene/ImageryLayer.js +1 -40
- package/Source/Scene/ImageryProvider.js +0 -138
- package/Source/Scene/Implicit3DTileContent.js +0 -23
- package/Source/Scene/IonImageryProvider.js +1 -369
- package/Source/Scene/MapboxImageryProvider.js +0 -276
- package/Source/Scene/MapboxStyleImageryProvider.js +0 -274
- package/Source/Scene/Model/Model.js +6 -249
- package/Source/Scene/Model/Model3DTileContent.js +0 -50
- package/Source/Scene/Model/ModelAnimationCollection.js +1 -1
- package/Source/Scene/Model/PointCloudStylingPipelineStage.js +1 -1
- package/Source/Scene/Multiple3DTileContent.js +0 -27
- package/Source/Scene/Primitive.js +10 -38
- package/Source/Scene/QuadtreePrimitive.js +3 -5
- package/Source/Scene/QuadtreeTileProvider.js +0 -10
- package/Source/Scene/Scene.js +3 -3
- package/Source/Scene/ScreenSpaceCameraController.js +5 -5
- package/Source/Scene/SingleTileImageryProvider.js +6 -302
- package/Source/Scene/TileCoordinatesImageryProvider.js +0 -273
- package/Source/Scene/TileMapServiceImageryProvider.js +3 -48
- package/Source/Scene/Tileset3DTileContent.js +0 -22
- package/Source/Scene/TimeDynamicPointCloud.js +0 -28
- package/Source/Scene/UrlTemplateImageryProvider.js +0 -375
- package/Source/Scene/Vector3DTileContent.js +0 -29
- package/Source/Scene/VoxelPrimitive.js +9 -49
- package/Source/Scene/VoxelProvider.js +0 -24
- package/Source/Scene/WebMapServiceImageryProvider.js +0 -274
- package/Source/Scene/WebMapTileServiceImageryProvider.js +0 -274
- package/Source/Scene/computeFlyToLocationForRectangle.js +0 -6
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +5 -0
- package/Source/Widget/CesiumWidget.js +2 -19
- package/index.d.ts +62 -1183
- package/index.js +54 -57
- package/package.json +2 -2
- package/Source/Core/createWorldTerrain.js +0 -61
- package/Source/Scene/createOsmBuildings.js +0 -82
- package/Source/Scene/createWorldImagery.js +0 -47
|
@@ -4,7 +4,6 @@ import defaultValue from "../Core/defaultValue.js";
|
|
|
4
4
|
import defined from "../Core/defined.js";
|
|
5
5
|
import destroyObject from "../Core/destroyObject.js";
|
|
6
6
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
7
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
8
7
|
import GeometryInstance from "../Core/GeometryInstance.js";
|
|
9
8
|
import GeometryInstanceAttribute from "../Core/GeometryInstanceAttribute.js";
|
|
10
9
|
import GroundPolylineGeometry from "../Core/GroundPolylineGeometry.js";
|
|
@@ -193,25 +192,6 @@ function GroundPolylinePrimitive(options) {
|
|
|
193
192
|
this._zIndex = undefined;
|
|
194
193
|
|
|
195
194
|
this._ready = false;
|
|
196
|
-
const groundPolylinePrimitive = this;
|
|
197
|
-
// This is here for backwards compatibility. This promise wrapper can be removed once readyPromise is removed.
|
|
198
|
-
this._readyPromise = new Promise((resolve, reject) => {
|
|
199
|
-
groundPolylinePrimitive._completeLoad = () => {
|
|
200
|
-
this._ready = true;
|
|
201
|
-
|
|
202
|
-
if (this.releaseGeometryInstances) {
|
|
203
|
-
this.geometryInstances = undefined;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
const error = this._error;
|
|
207
|
-
if (!defined(error)) {
|
|
208
|
-
resolve(this);
|
|
209
|
-
} else {
|
|
210
|
-
reject(error);
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
});
|
|
214
|
-
|
|
215
195
|
this._primitive = undefined;
|
|
216
196
|
|
|
217
197
|
this._sp = undefined;
|
|
@@ -315,23 +295,6 @@ Object.defineProperties(GroundPolylinePrimitive.prototype, {
|
|
|
315
295
|
},
|
|
316
296
|
},
|
|
317
297
|
|
|
318
|
-
/**
|
|
319
|
-
* Gets a promise that resolves when the primitive is ready to render.
|
|
320
|
-
* @memberof GroundPolylinePrimitive.prototype
|
|
321
|
-
* @type {Promise<GroundPolylinePrimitive>}
|
|
322
|
-
* @readonly
|
|
323
|
-
* @deprecated
|
|
324
|
-
*/
|
|
325
|
-
readyPromise: {
|
|
326
|
-
get: function () {
|
|
327
|
-
deprecationWarning(
|
|
328
|
-
"GroundPolylinePrimitive.readyPromise",
|
|
329
|
-
"GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."
|
|
330
|
-
);
|
|
331
|
-
return this._readyPromise;
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
|
|
335
298
|
/**
|
|
336
299
|
* This property is for debugging only; it is not for production use nor is it optimized.
|
|
337
300
|
* <p>
|
|
@@ -849,7 +812,11 @@ GroundPolylinePrimitive.prototype.update = function (frameState) {
|
|
|
849
812
|
this._primitive.update(frameState);
|
|
850
813
|
frameState.afterRender.push(() => {
|
|
851
814
|
if (!this._ready && defined(this._primitive) && this._primitive.ready) {
|
|
852
|
-
this.
|
|
815
|
+
this._ready = true;
|
|
816
|
+
|
|
817
|
+
if (this.releaseGeometryInstances) {
|
|
818
|
+
this.geometryInstances = undefined;
|
|
819
|
+
}
|
|
853
820
|
}
|
|
854
821
|
});
|
|
855
822
|
};
|
|
@@ -5,7 +5,6 @@ import Cartographic from "../Core/Cartographic.js";
|
|
|
5
5
|
import Check from "../Core/Check.js";
|
|
6
6
|
import defaultValue from "../Core/defaultValue.js";
|
|
7
7
|
import defined from "../Core/defined.js";
|
|
8
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
9
8
|
import destroyObject from "../Core/destroyObject.js";
|
|
10
9
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
11
10
|
import GeometryInstance from "../Core/GeometryInstance.js";
|
|
@@ -212,30 +211,6 @@ function GroundPrimitive(options) {
|
|
|
212
211
|
this._boundingVolumes2D = [];
|
|
213
212
|
|
|
214
213
|
this._ready = false;
|
|
215
|
-
|
|
216
|
-
const groundPrimitive = this;
|
|
217
|
-
// This is here for backwards compatibility. This promise wrapper can be removed once readyPromise is removed.
|
|
218
|
-
this._readyPromise = new Promise((resolve, reject) => {
|
|
219
|
-
groundPrimitive._completeLoad = () => {
|
|
220
|
-
if (this._ready) {
|
|
221
|
-
return;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
this._ready = true;
|
|
225
|
-
|
|
226
|
-
if (this.releaseGeometryInstances) {
|
|
227
|
-
this.geometryInstances = undefined;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const error = this._error;
|
|
231
|
-
if (!defined(error)) {
|
|
232
|
-
resolve(this);
|
|
233
|
-
} else {
|
|
234
|
-
reject(error);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
});
|
|
238
|
-
|
|
239
214
|
this._primitive = undefined;
|
|
240
215
|
|
|
241
216
|
this._maxHeight = undefined;
|
|
@@ -384,23 +359,6 @@ Object.defineProperties(GroundPrimitive.prototype, {
|
|
|
384
359
|
return this._ready;
|
|
385
360
|
},
|
|
386
361
|
},
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* Gets a promise that resolves when the primitive is ready to render.
|
|
390
|
-
* @memberof GroundPrimitive.prototype
|
|
391
|
-
* @type {Promise<GroundPrimitive>}
|
|
392
|
-
* @readonly
|
|
393
|
-
* @deprecated
|
|
394
|
-
*/
|
|
395
|
-
readyPromise: {
|
|
396
|
-
get: function () {
|
|
397
|
-
deprecationWarning(
|
|
398
|
-
"GroundPrimitive.readyPromise",
|
|
399
|
-
"GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."
|
|
400
|
-
);
|
|
401
|
-
return this._readyPromise;
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
362
|
});
|
|
405
363
|
|
|
406
364
|
/**
|
|
@@ -942,7 +900,11 @@ GroundPrimitive.prototype.update = function (frameState) {
|
|
|
942
900
|
|
|
943
901
|
frameState.afterRender.push(() => {
|
|
944
902
|
if (!this._ready && defined(this._primitive) && this._primitive.ready) {
|
|
945
|
-
this.
|
|
903
|
+
this._ready = true;
|
|
904
|
+
|
|
905
|
+
if (this.releaseGeometryInstances) {
|
|
906
|
+
this.geometryInstances = undefined;
|
|
907
|
+
}
|
|
946
908
|
}
|
|
947
909
|
});
|
|
948
910
|
};
|
|
@@ -51,7 +51,6 @@ import Cartographic from "../Core/Cartographic.js";
|
|
|
51
51
|
import Check from "../Core/Check.js";
|
|
52
52
|
import defaultValue from "../Core/defaultValue.js";
|
|
53
53
|
import defined from "../Core/defined.js";
|
|
54
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
55
54
|
import destroyObject from "../Core/destroyObject.js";
|
|
56
55
|
import HeightmapEncoding from "../Core/HeightmapEncoding.js";
|
|
57
56
|
import Resource from "../Core/Resource.js";
|
|
@@ -67,7 +66,6 @@ import Rectangle from "../Core/Rectangle.js";
|
|
|
67
66
|
*
|
|
68
67
|
* Initialization options for the I3SDataProvider constructor
|
|
69
68
|
*
|
|
70
|
-
* @property {Resource|string} [url] The url of the I3S dataset. Deprecated.
|
|
71
69
|
* @property {string} [name] The name of the I3S dataset.
|
|
72
70
|
* @property {boolean} [show=true] Determines if the dataset will be shown.
|
|
73
71
|
* @property {ArcGISTiledElevationTerrainProvider|Promise<ArcGISTiledElevationTerrainProvider>} [geoidTiledTerrainProvider] Tiled elevation provider describing an Earth Gravitational Model. If defined, geometry will be shifted based on the offsets given by this provider. Required to position I3S data sets with gravity-related height at the correct location.
|
|
@@ -139,18 +137,6 @@ function I3SDataProvider(options) {
|
|
|
139
137
|
this._geoidDataList = undefined;
|
|
140
138
|
this._decoderTaskProcessor = undefined;
|
|
141
139
|
this._taskProcessorReadyPromise = undefined;
|
|
142
|
-
|
|
143
|
-
if (defined(options.url)) {
|
|
144
|
-
deprecationWarning(
|
|
145
|
-
"I3SDataProvider options.url",
|
|
146
|
-
"I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."
|
|
147
|
-
);
|
|
148
|
-
this._readyPromise = undefined;
|
|
149
|
-
this._ready = false;
|
|
150
|
-
|
|
151
|
-
this._resource = Resource.createIfNeeded(options.url);
|
|
152
|
-
this._load();
|
|
153
|
-
}
|
|
154
140
|
}
|
|
155
141
|
|
|
156
142
|
Object.defineProperties(I3SDataProvider.prototype, {
|
|
@@ -255,41 +241,6 @@ Object.defineProperties(I3SDataProvider.prototype, {
|
|
|
255
241
|
},
|
|
256
242
|
},
|
|
257
243
|
|
|
258
|
-
/**
|
|
259
|
-
* Gets the promise that will be resolved when the I3S scene is loaded.
|
|
260
|
-
* @memberof I3SDataProvider.prototype
|
|
261
|
-
* @type {Promise<I3SDataProvider>}
|
|
262
|
-
* @readonly
|
|
263
|
-
* @deprecated
|
|
264
|
-
*/
|
|
265
|
-
readyPromise: {
|
|
266
|
-
get: function () {
|
|
267
|
-
deprecationWarning(
|
|
268
|
-
"I3SDataProvider.readyPromise",
|
|
269
|
-
"I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."
|
|
270
|
-
);
|
|
271
|
-
return this._readyPromise;
|
|
272
|
-
},
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* When <code>true</code>, the I3S scene is loaded.
|
|
277
|
-
* This is set to <code>true</code> right before {@link I3SDataProvider#readyPromise} is resolved.
|
|
278
|
-
* @memberof I3SDataProvider.prototype
|
|
279
|
-
* @type {boolean}
|
|
280
|
-
* @readonly
|
|
281
|
-
* @deprecated
|
|
282
|
-
*/
|
|
283
|
-
ready: {
|
|
284
|
-
get: function () {
|
|
285
|
-
deprecationWarning(
|
|
286
|
-
"I3SDataProvider.ready",
|
|
287
|
-
"I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."
|
|
288
|
-
);
|
|
289
|
-
return this._ready;
|
|
290
|
-
},
|
|
291
|
-
},
|
|
292
|
-
|
|
293
244
|
/**
|
|
294
245
|
* The resource used to fetch the I3S dataset.
|
|
295
246
|
* @memberof I3SDataProvider.prototype
|
|
@@ -451,57 +402,15 @@ I3SDataProvider.fromUrl = async function (url, options) {
|
|
|
451
402
|
// Start loading all of the tiles
|
|
452
403
|
const layerPromises = [];
|
|
453
404
|
for (let i = 0; i < provider._layers.length; i++) {
|
|
454
|
-
layerPromises.push(
|
|
405
|
+
layerPromises.push(
|
|
406
|
+
provider._layers[i].load(options.cesium3dTilesetOptions)
|
|
407
|
+
);
|
|
455
408
|
}
|
|
456
409
|
|
|
457
410
|
await Promise.all(layerPromises);
|
|
458
|
-
provider._ready = true;
|
|
459
|
-
provider._readyPromise = Promise.resolve(provider);
|
|
460
411
|
return provider;
|
|
461
412
|
};
|
|
462
413
|
|
|
463
|
-
/**
|
|
464
|
-
* @private
|
|
465
|
-
*/
|
|
466
|
-
I3SDataProvider.prototype._load = function () {
|
|
467
|
-
const that = this;
|
|
468
|
-
this._readyPromise = I3SDataProvider.loadJson(
|
|
469
|
-
this._resource,
|
|
470
|
-
this._traceFetches
|
|
471
|
-
).then(function (data) {
|
|
472
|
-
// Success
|
|
473
|
-
that._data = data;
|
|
474
|
-
if (defined(data.layers)) {
|
|
475
|
-
for (let layerIndex = 0; layerIndex < data.layers.length; layerIndex++) {
|
|
476
|
-
const newLayer = new I3SLayer(
|
|
477
|
-
that,
|
|
478
|
-
data.layers[layerIndex],
|
|
479
|
-
layerIndex
|
|
480
|
-
);
|
|
481
|
-
that._layers.push(newLayer);
|
|
482
|
-
}
|
|
483
|
-
} else {
|
|
484
|
-
const newLayer = new I3SLayer(that, data, data.id);
|
|
485
|
-
that._layers.push(newLayer);
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
that._computeExtent();
|
|
489
|
-
|
|
490
|
-
// Start loading all of the tiles
|
|
491
|
-
const layerPromises = [];
|
|
492
|
-
for (let i = 0; i < that._layers.length; i++) {
|
|
493
|
-
layerPromises.push(that._layers[i].load());
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
return Promise.all(layerPromises).then(function () {
|
|
497
|
-
that._ready = true;
|
|
498
|
-
return that;
|
|
499
|
-
});
|
|
500
|
-
});
|
|
501
|
-
|
|
502
|
-
return this._readyPromise;
|
|
503
|
-
};
|
|
504
|
-
|
|
505
414
|
/**
|
|
506
415
|
* @private
|
|
507
416
|
*/
|
|
@@ -609,13 +518,9 @@ I3SDataProvider.prototype.getDecoderTaskProcessor = function () {
|
|
|
609
518
|
return this._taskProcessorReadyPromise;
|
|
610
519
|
};
|
|
611
520
|
|
|
612
|
-
function getCoveredTiles(terrainProvider, extent) {
|
|
613
|
-
return getTiles(terrainProvider, extent);
|
|
614
|
-
}
|
|
615
|
-
|
|
616
521
|
const scratchCartesian2 = new Cartesian2();
|
|
617
522
|
|
|
618
|
-
function
|
|
523
|
+
function getCoveredTiles(terrainProvider, extent) {
|
|
619
524
|
const tilingScheme = terrainProvider.tilingScheme;
|
|
620
525
|
|
|
621
526
|
// Sort points into a set of tiles
|
package/Source/Scene/I3SLayer.js
CHANGED
|
@@ -19,9 +19,9 @@ import I3SNode from "./I3SNode.js";
|
|
|
19
19
|
function I3SLayer(dataProvider, layerData, index) {
|
|
20
20
|
this._dataProvider = dataProvider;
|
|
21
21
|
|
|
22
|
-
if (!defined(layerData.href)) {
|
|
22
|
+
if (!defined(layerData.href) && defined(index)) {
|
|
23
23
|
// assign a default layer
|
|
24
|
-
layerData.href =
|
|
24
|
+
layerData.href = `layers/${index}`;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const dataProviderUrl = this._dataProvider.resource.getUrlComponent();
|
|
@@ -165,10 +165,11 @@ Object.defineProperties(I3SLayer.prototype, {
|
|
|
165
165
|
|
|
166
166
|
/**
|
|
167
167
|
* Loads the content, including the root node definition and its children
|
|
168
|
+
* @param {Cesium3DTileset.ConstructorOptions} [cesium3dTilesetOptions] options for Cesium3dTileset constructor
|
|
168
169
|
* @returns {Promise} A promise that is resolved when the layer data is loaded
|
|
169
170
|
* @private
|
|
170
171
|
*/
|
|
171
|
-
I3SLayer.prototype.load = async function () {
|
|
172
|
+
I3SLayer.prototype.load = async function (cesium3dTilesetOptions) {
|
|
172
173
|
if (this._data.spatialReference.wkid !== 4326) {
|
|
173
174
|
throw new RuntimeError(
|
|
174
175
|
`Unsupported spatial reference: ${this._data.spatialReference.wkid}`
|
|
@@ -176,8 +177,8 @@ I3SLayer.prototype.load = async function () {
|
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
await this._dataProvider.loadGeoidData();
|
|
179
|
-
await this._loadRootNode();
|
|
180
|
-
await this._create3DTileset();
|
|
180
|
+
await this._loadRootNode(cesium3dTilesetOptions);
|
|
181
|
+
await this._create3DTileset(cesium3dTilesetOptions);
|
|
181
182
|
|
|
182
183
|
this._rootNode._tile = this._tileset._root;
|
|
183
184
|
this._tileset._root._i3sNode = this._rootNode;
|
|
@@ -288,7 +289,7 @@ I3SLayer.prototype._findBestGeometryBuffers = function (
|
|
|
288
289
|
/**
|
|
289
290
|
* @private
|
|
290
291
|
*/
|
|
291
|
-
I3SLayer.prototype._loadRootNode = function () {
|
|
292
|
+
I3SLayer.prototype._loadRootNode = function (cesium3dTilesetOptions) {
|
|
292
293
|
if (defined(this._data.nodePages)) {
|
|
293
294
|
let rootIndex = 0;
|
|
294
295
|
if (defined(this._data.nodePages.rootIndex)) {
|
|
@@ -299,7 +300,7 @@ I3SLayer.prototype._loadRootNode = function () {
|
|
|
299
300
|
this._rootNode = new I3SNode(this, this._data.store.rootNode, true);
|
|
300
301
|
}
|
|
301
302
|
|
|
302
|
-
return this._rootNode.load();
|
|
303
|
+
return this._rootNode.load(cesium3dTilesetOptions);
|
|
303
304
|
};
|
|
304
305
|
|
|
305
306
|
/**
|
|
@@ -308,9 +309,8 @@ I3SLayer.prototype._loadRootNode = function () {
|
|
|
308
309
|
I3SLayer.prototype._getNodeInNodePages = function (nodeIndex) {
|
|
309
310
|
const index = Math.floor(nodeIndex / this._data.nodePages.nodesPerPage);
|
|
310
311
|
const offsetInPage = nodeIndex % this._data.nodePages.nodesPerPage;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return that._nodePages[index][offsetInPage];
|
|
312
|
+
return this._loadNodePage(index).then(function (data) {
|
|
313
|
+
return data.nodes[offsetInPage];
|
|
314
314
|
});
|
|
315
315
|
};
|
|
316
316
|
|
|
@@ -373,7 +373,7 @@ I3SLayer.prototype._computeExtent = function () {
|
|
|
373
373
|
/**
|
|
374
374
|
* @private
|
|
375
375
|
*/
|
|
376
|
-
I3SLayer.prototype._create3DTileset = async function () {
|
|
376
|
+
I3SLayer.prototype._create3DTileset = async function (cesium3dTilesetOptions) {
|
|
377
377
|
const inPlaceTileset = {
|
|
378
378
|
asset: {
|
|
379
379
|
version: "1.0",
|
|
@@ -387,17 +387,10 @@ I3SLayer.prototype._create3DTileset = async function () {
|
|
|
387
387
|
});
|
|
388
388
|
|
|
389
389
|
const tilesetUrl = URL.createObjectURL(tilesetBlob);
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
if (this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(x)) {
|
|
395
|
-
tilesetOptions[x] = this._dataProvider._cesium3dTilesetOptions[x];
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
this._tileset = await Cesium3DTileset.fromUrl(tilesetUrl, tilesetOptions);
|
|
390
|
+
this._tileset = await Cesium3DTileset.fromUrl(
|
|
391
|
+
tilesetUrl,
|
|
392
|
+
cesium3dTilesetOptions
|
|
393
|
+
);
|
|
401
394
|
this._tileset.show = this._dataProvider.show;
|
|
402
395
|
this._tileset._isI3STileSet = true;
|
|
403
396
|
this._tileset.tileUnload.addEventListener(function (tile) {
|
package/Source/Scene/Imagery.js
CHANGED
|
@@ -34,15 +34,7 @@ function Imagery(imageryLayer, x, y, level, rectangle) {
|
|
|
34
34
|
this.credits = undefined;
|
|
35
35
|
this.referenceCount = 0;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
!defined(rectangle) &&
|
|
40
|
-
imageryLayer.ready &&
|
|
41
|
-
// imageryProvider._ready is deprecated; This is here for backward compatibility
|
|
42
|
-
(defined(imageryProvider._ready)
|
|
43
|
-
? imageryProvider._ready
|
|
44
|
-
: !defined(imageryProvider.ready) || imageryProvider.ready)
|
|
45
|
-
) {
|
|
37
|
+
if (!defined(rectangle) && imageryLayer.ready) {
|
|
46
38
|
const tilingScheme = imageryLayer.imageryProvider.tilingScheme;
|
|
47
39
|
rectangle = tilingScheme.tileXYToRectangle(x, y, level);
|
|
48
40
|
}
|
|
@@ -5,7 +5,6 @@ import createWorldImageryAsync from "../Scene/createWorldImageryAsync.js";
|
|
|
5
5
|
import defaultValue from "../Core/defaultValue.js";
|
|
6
6
|
import defined from "../Core/defined.js";
|
|
7
7
|
import destroyObject from "../Core/destroyObject.js";
|
|
8
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
9
8
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
10
9
|
import Event from "../Core/Event.js";
|
|
11
10
|
import FeatureDetection from "../Core/FeatureDetection.js";
|
|
@@ -667,38 +666,6 @@ const tileImageryBoundsScratch = new Rectangle();
|
|
|
667
666
|
const clippedRectangleScratch = new Rectangle();
|
|
668
667
|
const terrainRectangleScratch = new Rectangle();
|
|
669
668
|
|
|
670
|
-
/**
|
|
671
|
-
* Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
|
|
672
|
-
* producing the overall bounds of imagery that can be produced by this layer.
|
|
673
|
-
*
|
|
674
|
-
* @returns {Promise<Rectangle>} A promise to a rectangle which defines the overall bounds of imagery that can be produced by this layer.
|
|
675
|
-
*
|
|
676
|
-
* @example
|
|
677
|
-
* // Zoom to an imagery layer.
|
|
678
|
-
* imageryLayer.getViewableRectangle().then(function (rectangle) {
|
|
679
|
-
* return camera.flyTo({
|
|
680
|
-
* destination: rectangle
|
|
681
|
-
* });
|
|
682
|
-
* });
|
|
683
|
-
*/
|
|
684
|
-
ImageryLayer.prototype.getViewableRectangle = async function () {
|
|
685
|
-
deprecationWarning(
|
|
686
|
-
"ImageryLayer.getViewableRectangle",
|
|
687
|
-
"ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead."
|
|
688
|
-
);
|
|
689
|
-
|
|
690
|
-
const imageryProvider = this._imageryProvider;
|
|
691
|
-
const rectangle = this._rectangle;
|
|
692
|
-
// readyPromise has been deprecated. This is here for backward compatibility and can be removed with readyPromise.
|
|
693
|
-
if (defined(imageryProvider._readyPromise)) {
|
|
694
|
-
await imageryProvider._readyPromise;
|
|
695
|
-
} else if (defined(imageryProvider.readyPromise)) {
|
|
696
|
-
await imageryProvider.readyPromise;
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
return Rectangle.intersection(imageryProvider.rectangle, rectangle);
|
|
700
|
-
};
|
|
701
|
-
|
|
702
669
|
/**
|
|
703
670
|
* Computes the intersection of this layer's rectangle with the imagery provider's availability rectangle,
|
|
704
671
|
* producing the overall bounds of imagery that can be produced by this layer.
|
|
@@ -756,13 +723,7 @@ ImageryLayer.prototype._createTileImagerySkeletons = function (
|
|
|
756
723
|
}
|
|
757
724
|
|
|
758
725
|
const imageryProvider = this._imageryProvider;
|
|
759
|
-
if (
|
|
760
|
-
!this.ready ||
|
|
761
|
-
// ready is deprecated. This is here for backwards compatibility
|
|
762
|
-
(defined(imageryProvider._ready)
|
|
763
|
-
? !imageryProvider._ready
|
|
764
|
-
: defined(imageryProvider.ready) && !imageryProvider.ready)
|
|
765
|
-
) {
|
|
726
|
+
if (!this.ready) {
|
|
766
727
|
// The imagery provider is not ready, so we can't create skeletons, yet.
|
|
767
728
|
// Instead, add a placeholder so that we'll know to create
|
|
768
729
|
// the skeletons once the provider is ready.
|
|
@@ -47,28 +47,6 @@ function ImageryProvider() {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
Object.defineProperties(ImageryProvider.prototype, {
|
|
50
|
-
/**
|
|
51
|
-
* Gets a value indicating whether or not the provider is ready for use.
|
|
52
|
-
* @memberof ImageryProvider.prototype
|
|
53
|
-
* @type {boolean}
|
|
54
|
-
* @readonly
|
|
55
|
-
* @deprecated
|
|
56
|
-
*/
|
|
57
|
-
ready: {
|
|
58
|
-
get: DeveloperError.throwInstantiationError,
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Gets a promise that resolves to true when the provider is ready for use.
|
|
63
|
-
* @memberof ImageryProvider.prototype
|
|
64
|
-
* @type {Promise<boolean>}
|
|
65
|
-
* @readonly
|
|
66
|
-
* @deprecated
|
|
67
|
-
*/
|
|
68
|
-
readyPromise: {
|
|
69
|
-
get: DeveloperError.throwInstantiationError,
|
|
70
|
-
},
|
|
71
|
-
|
|
72
50
|
/**
|
|
73
51
|
* Gets the rectangle, in radians, of the imagery provided by the instance.
|
|
74
52
|
* @memberof ImageryProvider.prototype
|
|
@@ -191,122 +169,6 @@ Object.defineProperties(ImageryProvider.prototype, {
|
|
|
191
169
|
hasAlphaChannel: {
|
|
192
170
|
get: DeveloperError.throwInstantiationError,
|
|
193
171
|
},
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* The default alpha blending value of this provider, with 0.0 representing fully transparent and
|
|
197
|
-
* 1.0 representing fully opaque.
|
|
198
|
-
* @memberof ImageryProvider.prototype
|
|
199
|
-
* @type {Number|undefined}
|
|
200
|
-
* @deprecated
|
|
201
|
-
*/
|
|
202
|
-
defaultAlpha: {
|
|
203
|
-
get: DeveloperError.throwInstantiationError,
|
|
204
|
-
set: DeveloperError.throwInstantiationError,
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* The default alpha blending value on the night side of the globe of this provider, with 0.0 representing fully transparent and
|
|
209
|
-
* 1.0 representing fully opaque.
|
|
210
|
-
* @memberof ImageryProvider.prototype
|
|
211
|
-
* @type {Number|undefined}
|
|
212
|
-
* @deprecated
|
|
213
|
-
*/
|
|
214
|
-
defaultNightAlpha: {
|
|
215
|
-
get: DeveloperError.throwInstantiationError,
|
|
216
|
-
set: DeveloperError.throwInstantiationError,
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* The default alpha blending value on the day side of the globe of this provider, with 0.0 representing fully transparent and
|
|
221
|
-
* 1.0 representing fully opaque.
|
|
222
|
-
* @memberof ImageryProvider.prototype
|
|
223
|
-
* @type {Number|undefined}
|
|
224
|
-
* @deprecated
|
|
225
|
-
*/
|
|
226
|
-
defaultDayAlpha: {
|
|
227
|
-
get: DeveloperError.throwInstantiationError,
|
|
228
|
-
set: DeveloperError.throwInstantiationError,
|
|
229
|
-
},
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* The default brightness of this provider. 1.0 uses the unmodified imagery color. Less than 1.0
|
|
233
|
-
* makes the imagery darker while greater than 1.0 makes it brighter.
|
|
234
|
-
* @memberof ImageryProvider.prototype
|
|
235
|
-
* @type {Number|undefined}
|
|
236
|
-
* @deprecated
|
|
237
|
-
*/
|
|
238
|
-
defaultBrightness: {
|
|
239
|
-
get: DeveloperError.throwInstantiationError,
|
|
240
|
-
set: DeveloperError.throwInstantiationError,
|
|
241
|
-
},
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* The default contrast of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces
|
|
245
|
-
* the contrast while greater than 1.0 increases it.
|
|
246
|
-
* @memberof ImageryProvider.prototype
|
|
247
|
-
* @type {Number|undefined}
|
|
248
|
-
* @deprecated
|
|
249
|
-
*/
|
|
250
|
-
defaultContrast: {
|
|
251
|
-
get: DeveloperError.throwInstantiationError,
|
|
252
|
-
set: DeveloperError.throwInstantiationError,
|
|
253
|
-
},
|
|
254
|
-
|
|
255
|
-
/**
|
|
256
|
-
* The default hue of this provider in radians. 0.0 uses the unmodified imagery color.
|
|
257
|
-
* @memberof ImageryProvider.prototype
|
|
258
|
-
* @type {Number|undefined}
|
|
259
|
-
* @deprecated
|
|
260
|
-
*/
|
|
261
|
-
defaultHue: {
|
|
262
|
-
get: DeveloperError.throwInstantiationError,
|
|
263
|
-
set: DeveloperError.throwInstantiationError,
|
|
264
|
-
},
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* The default saturation of this provider. 1.0 uses the unmodified imagery color. Less than 1.0 reduces the
|
|
268
|
-
* saturation while greater than 1.0 increases it.
|
|
269
|
-
* @memberof ImageryProvider.prototype
|
|
270
|
-
* @type {Number|undefined}
|
|
271
|
-
* @deprecated
|
|
272
|
-
*/
|
|
273
|
-
defaultSaturation: {
|
|
274
|
-
get: DeveloperError.throwInstantiationError,
|
|
275
|
-
set: DeveloperError.throwInstantiationError,
|
|
276
|
-
},
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* The default gamma correction to apply to this provider. 1.0 uses the unmodified imagery color.
|
|
280
|
-
* @memberof ImageryProvider.prototype
|
|
281
|
-
* @type {Number|undefined}
|
|
282
|
-
* @deprecated
|
|
283
|
-
*/
|
|
284
|
-
defaultGamma: {
|
|
285
|
-
get: DeveloperError.throwInstantiationError,
|
|
286
|
-
set: DeveloperError.throwInstantiationError,
|
|
287
|
-
},
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* The default texture minification filter to apply to this provider.
|
|
291
|
-
* @memberof ImageryProvider.prototype
|
|
292
|
-
* @type {TextureMinificationFilter}
|
|
293
|
-
* @deprecated
|
|
294
|
-
*/
|
|
295
|
-
defaultMinificationFilter: {
|
|
296
|
-
get: DeveloperError.throwInstantiationError,
|
|
297
|
-
set: DeveloperError.throwInstantiationError,
|
|
298
|
-
},
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* The default texture magnification filter to apply to this provider.
|
|
302
|
-
* @memberof ImageryProvider.prototype
|
|
303
|
-
* @type {TextureMagnificationFilter}
|
|
304
|
-
* @deprecated
|
|
305
|
-
*/
|
|
306
|
-
defaultMagnificationFilter: {
|
|
307
|
-
get: DeveloperError.throwInstantiationError,
|
|
308
|
-
set: DeveloperError.throwInstantiationError,
|
|
309
|
-
},
|
|
310
172
|
});
|
|
311
173
|
|
|
312
174
|
/**
|
|
@@ -4,7 +4,6 @@ import clone from "../Core/clone.js";
|
|
|
4
4
|
import combine from "../Core/combine.js";
|
|
5
5
|
import defaultValue from "../Core/defaultValue.js";
|
|
6
6
|
import defined from "../Core/defined.js";
|
|
7
|
-
import deprecationWarning from "../Core/deprecationWarning.js";
|
|
8
7
|
import destroyObject from "../Core/destroyObject.js";
|
|
9
8
|
import DeveloperError from "../Core/DeveloperError.js";
|
|
10
9
|
import CesiumMath from "../Core/Math.js";
|
|
@@ -74,7 +73,6 @@ function Implicit3DTileContent(tileset, tile, resource) {
|
|
|
74
73
|
this._url = subtreeResource.getUrlComponent(true);
|
|
75
74
|
|
|
76
75
|
this._ready = false;
|
|
77
|
-
this._readyPromise = undefined;
|
|
78
76
|
}
|
|
79
77
|
|
|
80
78
|
Object.defineProperties(Implicit3DTileContent.prototype, {
|
|
@@ -135,26 +133,6 @@ Object.defineProperties(Implicit3DTileContent.prototype, {
|
|
|
135
133
|
},
|
|
136
134
|
},
|
|
137
135
|
|
|
138
|
-
/**
|
|
139
|
-
* Gets the promise that will be resolved when the tile's content is ready to render.
|
|
140
|
-
*
|
|
141
|
-
* @memberof Implicit3DTileContent.prototype
|
|
142
|
-
*
|
|
143
|
-
* @type {Promise<Implicit3DTileContent>}
|
|
144
|
-
* @readonly
|
|
145
|
-
* @deprecated
|
|
146
|
-
* @private
|
|
147
|
-
*/
|
|
148
|
-
readyPromise: {
|
|
149
|
-
get: function () {
|
|
150
|
-
deprecationWarning(
|
|
151
|
-
"Implicit3DTileContent.readyPromise",
|
|
152
|
-
"Implicit3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Implicit3DTileContent.ready to return true instead."
|
|
153
|
-
);
|
|
154
|
-
return this._readyPromise;
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
|
|
158
136
|
tileset: {
|
|
159
137
|
get: function () {
|
|
160
138
|
return this._tileset;
|
|
@@ -260,7 +238,6 @@ Implicit3DTileContent.fromSubtreeJson = async function (
|
|
|
260
238
|
content._implicitSubtree = subtree;
|
|
261
239
|
expandSubtree(content, subtree);
|
|
262
240
|
content._ready = true;
|
|
263
|
-
content._readyPromise = Promise.resolve(content);
|
|
264
241
|
|
|
265
242
|
return content;
|
|
266
243
|
};
|