@cesium/engine 2.1.0 → 2.2.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/{AxisAlignedBoundingBox-a6f9f0e5.js → AxisAlignedBoundingBox-379015ef.js} +1 -1
- package/Build/Workers/{BoundingRectangle-b0a68595.js → BoundingRectangle-57f2b24f.js} +1 -1
- package/Build/Workers/{BoxGeometry-baedd794.js → BoxGeometry-ecabfc78.js} +1 -1
- package/Build/Workers/{Color-f85df1be.js → Color-14d1a36d.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-30516950.js → CoplanarPolygonGeometryLibrary-048c3c14.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-5d5d3b3a.js → CorridorGeometryLibrary-520c8619.js} +1 -1
- package/Build/Workers/{CylinderGeometry-d899ae26.js → CylinderGeometry-119068b8.js} +1 -1
- package/Build/Workers/{EllipseGeometry-a49f8449.js → EllipseGeometry-2dfc3523.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-cba7edde.js → EllipseGeometryLibrary-0a1e0170.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-8095c8cb.js → EllipseOutlineGeometry-c5251669.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-ed93f571.js → EllipsoidGeometry-d10a5221.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-e4854854.js → EllipsoidOutlineGeometry-7039a0ae.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-7ae1aa9a.js → EllipsoidTangentPlane-857186be.js} +1 -1
- package/Build/Workers/{FrustumGeometry-b62db3e3.js → FrustumGeometry-400fa1b7.js} +2 -2
- package/Build/Workers/{GeometryAttribute-780af4fa.js → GeometryAttribute-7a2de5c6.js} +1 -1
- package/Build/Workers/{GeometryPipeline-36b61c99.js → GeometryPipeline-916636fa.js} +1 -1
- package/Build/Workers/{IntersectionTests-e889fcf0.js → IntersectionTests-b4d02d4d.js} +1 -1
- package/Build/Workers/{OrientedBoundingBox-43478ac8.js → OrientedBoundingBox-96fe1752.js} +5 -3
- package/Build/Workers/{PolygonGeometryLibrary-38a98276.js → PolygonGeometryLibrary-931f1ec6.js} +1 -1
- package/Build/Workers/{PolygonPipeline-d31ff61c.js → PolygonPipeline-32fc92cc.js} +1 -1
- package/Build/Workers/{PolylinePipeline-30e4cec9.js → PolylinePipeline-6d5c63e5.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-90551d26.js → PolylineVolumeGeometryLibrary-f068c1fb.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-558d9cb0.js → PrimitivePipeline-879f996a.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-815c68df.js → RectangleGeometryLibrary-2d6f36f3.js} +1 -1
- package/Build/Workers/{TerrainEncoding-341ead52.js → TerrainEncoding-82882059.js} +1 -1
- package/Build/Workers/{Transforms-9e9df299.js → Transforms-9052372a.js} +6 -5
- package/Build/Workers/{WallGeometryLibrary-ccf90976.js → WallGeometryLibrary-db7a64fb.js} +1 -1
- package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
- package/Build/Workers/combineGeometry.js +1 -1
- package/Build/Workers/createBoxGeometry.js +1 -1
- package/Build/Workers/createBoxOutlineGeometry.js +1 -1
- package/Build/Workers/createCircleGeometry.js +1 -1
- package/Build/Workers/createCircleOutlineGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
- package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createCorridorGeometry.js +1 -1
- package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
- package/Build/Workers/createCylinderGeometry.js +1 -1
- package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipseGeometry.js +1 -1
- package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
- package/Build/Workers/createEllipsoidGeometry.js +1 -1
- package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
- package/Build/Workers/createFrustumGeometry.js +1 -1
- package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
- package/Build/Workers/createGeometry.js +1 -1
- package/Build/Workers/createGroundPolylineGeometry.js +1 -1
- package/Build/Workers/createPlaneGeometry.js +1 -1
- package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
- package/Build/Workers/createPolygonGeometry.js +1 -1
- package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
- package/Build/Workers/createPolylineGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
- package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
- package/Build/Workers/createRectangleGeometry.js +1 -1
- package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
- package/Build/Workers/createSimplePolylineGeometry.js +1 -1
- package/Build/Workers/createSphereGeometry.js +1 -1
- package/Build/Workers/createSphereOutlineGeometry.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +1 -1
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +10 -15
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/package.js +1 -1
- package/Build/Workers/transferTypedArrayTest.js +1 -1
- package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
- package/Source/Core/ArcGISTiledElevationTerrainProvider.js +291 -191
- package/Source/Core/CesiumTerrainProvider.js +571 -434
- package/Source/Core/CustomHeightmapTerrainProvider.js +12 -0
- package/Source/Core/EllipsoidTerrainProvider.js +17 -10
- package/Source/Core/FrustumGeometry.js +1 -1
- package/Source/Core/GoogleEarthEnterpriseMetadata.js +86 -34
- package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +119 -82
- package/Source/Core/Ion.js +1 -1
- package/Source/Core/IonResource.js +14 -3
- package/Source/Core/OrientedBoundingBox.js +4 -2
- package/Source/Core/RequestScheduler.js +1 -1
- package/Source/Core/Resource.js +2 -2
- package/Source/Core/TerrainProvider.js +9 -14
- package/Source/Core/TileProviderError.js +8 -8
- package/Source/Core/VRTheWorldTerrainProvider.js +193 -124
- package/Source/Core/buildModuleUrl.js +4 -3
- package/Source/Core/createWorldTerrain.js +20 -2
- package/Source/Core/createWorldTerrainAsync.js +48 -0
- package/Source/Core/sampleTerrain.js +9 -10
- package/Source/Core/sampleTerrainMostDetailed.js +66 -72
- package/Source/DataSources/Cesium3DTilesetVisualizer.js +37 -26
- package/Source/DataSources/Entity.js +6 -1
- package/Source/DataSources/ModelVisualizer.js +99 -31
- package/Source/DataSources/PolygonGraphics.js +1 -1
- package/Source/Scene/ArcGisMapServerImageryProvider.js +552 -376
- package/Source/Scene/BingMapsImageryProvider.js +511 -305
- package/Source/Scene/BufferLoader.js +29 -34
- package/Source/Scene/Cesium3DTile.js +388 -251
- package/Source/Scene/Cesium3DTileBatchTable.js +2 -2
- package/Source/Scene/Cesium3DTileContent.js +16 -0
- package/Source/Scene/Cesium3DTileContentFactory.js +4 -4
- package/Source/Scene/Cesium3DTilePass.js +8 -11
- package/Source/Scene/Cesium3DTileStyleEngine.js +1 -1
- package/Source/Scene/Cesium3DTilesVoxelProvider.js +225 -117
- package/Source/Scene/Cesium3DTileset.js +755 -481
- package/Source/Scene/Cesium3DTilesetBaseTraversal.js +301 -0
- package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +33 -46
- package/Source/Scene/Cesium3DTilesetSkipTraversal.js +421 -0
- package/Source/Scene/Cesium3DTilesetTraversal.js +219 -671
- package/Source/Scene/ClassificationPrimitive.js +7 -0
- package/Source/Scene/Composite3DTileContent.js +69 -26
- package/Source/Scene/CreditDisplay.js +20 -4
- package/Source/Scene/DepthPlane.js +1 -1
- package/Source/Scene/Empty3DTileContent.js +31 -1
- package/Source/Scene/Geometry3DTileContent.js +47 -7
- package/Source/Scene/Globe.js +5 -1
- package/Source/Scene/GlobeSurfaceTile.js +2 -1
- package/Source/Scene/GlobeSurfaceTileProvider.js +50 -27
- package/Source/Scene/GltfBufferViewLoader.js +47 -91
- package/Source/Scene/GltfDracoLoader.js +110 -112
- package/Source/Scene/GltfImageLoader.js +71 -78
- package/Source/Scene/GltfIndexBufferLoader.js +108 -121
- package/Source/Scene/GltfJsonLoader.js +75 -74
- package/Source/Scene/GltfLoader.js +392 -280
- package/Source/Scene/GltfStructuralMetadataLoader.js +109 -110
- package/Source/Scene/GltfTextureLoader.js +97 -96
- package/Source/Scene/GltfVertexBufferLoader.js +128 -133
- package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +353 -225
- package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +491 -331
- package/Source/Scene/GridImageryProvider.js +267 -104
- package/Source/Scene/GroundPolylinePrimitive.js +12 -1
- package/Source/Scene/GroundPrimitive.js +8 -1
- package/Source/Scene/I3SDataProvider.js +214 -113
- package/Source/Scene/I3SFeature.js +7 -6
- package/Source/Scene/I3SLayer.js +26 -37
- package/Source/Scene/I3SNode.js +59 -66
- package/Source/Scene/Imagery.js +6 -1
- package/Source/Scene/ImageryLayer.js +299 -48
- package/Source/Scene/ImageryLayerCollection.js +26 -0
- package/Source/Scene/ImageryProvider.js +129 -111
- package/Source/Scene/Implicit3DTileContent.js +72 -23
- package/Source/Scene/ImplicitSubtree.js +66 -45
- package/Source/Scene/IonImageryProvider.js +471 -264
- package/Source/Scene/MapboxImageryProvider.js +272 -112
- package/Source/Scene/MapboxStyleImageryProvider.js +270 -111
- package/Source/Scene/MetadataSchemaLoader.js +26 -36
- package/Source/Scene/Model/B3dmLoader.js +42 -46
- package/Source/Scene/Model/GeoJsonLoader.js +8 -32
- package/Source/Scene/Model/I3dmLoader.js +48 -74
- package/Source/Scene/Model/Model.js +470 -132
- package/Source/Scene/Model/Model3DTileContent.js +83 -31
- package/Source/Scene/Model/ModelAnimationCollection.js +3 -3
- package/Source/Scene/Model/ModelDrawCommand.js +15 -26
- package/Source/Scene/Model/ModelUtility.js +16 -16
- package/Source/Scene/Model/PntsLoader.js +27 -32
- package/Source/Scene/Multiple3DTileContent.js +134 -115
- package/Source/Scene/PointCloud.js +11 -19
- package/Source/Scene/Primitive.js +20 -0
- package/Source/Scene/QuadtreePrimitive.js +2 -0
- package/Source/Scene/QuadtreeTileProvider.js +4 -8
- package/Source/Scene/ResourceCache.js +47 -105
- package/Source/Scene/ResourceCacheStatistics.js +24 -58
- package/Source/Scene/ResourceLoader.js +5 -17
- package/Source/Scene/ResourceLoaderState.js +12 -4
- package/Source/Scene/Scene.js +65 -0
- package/Source/Scene/ScreenSpaceCameraController.js +1 -1
- package/Source/Scene/SingleTileImageryProvider.js +382 -209
- package/Source/Scene/Terrain.js +196 -0
- package/Source/Scene/TileCoordinatesImageryProvider.js +267 -104
- package/Source/Scene/TileMapServiceImageryProvider.js +177 -85
- package/Source/Scene/Tileset3DTileContent.js +47 -5
- package/Source/Scene/TimeDynamicPointCloud.js +15 -2
- package/Source/Scene/UrlTemplateImageryProvider.js +343 -215
- package/Source/Scene/Vector3DTileClampedPolylines.js +96 -84
- package/Source/Scene/Vector3DTileContent.js +47 -22
- package/Source/Scene/Vector3DTileGeometry.js +57 -52
- package/Source/Scene/Vector3DTilePoints.js +72 -68
- package/Source/Scene/Vector3DTilePolygons.js +118 -117
- package/Source/Scene/Vector3DTilePolylines.js +86 -82
- package/Source/Scene/Vector3DTilePrimitive.js +0 -1
- package/Source/Scene/VoxelContent.js +61 -63
- package/Source/Scene/VoxelPrimitive.js +39 -91
- package/Source/Scene/VoxelProvider.js +2 -2
- package/Source/Scene/WebMapServiceImageryProvider.js +272 -111
- package/Source/Scene/WebMapTileServiceImageryProvider.js +270 -107
- package/Source/Scene/computeFlyToLocationForRectangle.js +33 -37
- package/Source/Scene/createOsmBuildings.js +6 -0
- package/Source/Scene/createOsmBuildingsAsync.js +82 -0
- package/Source/Scene/createWorldImagery.js +14 -5
- package/Source/Scene/createWorldImageryAsync.js +39 -0
- package/Source/Widget/CesiumWidget.js +55 -27
- package/index.d.ts +2158 -1395
- package/index.js +58 -51
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import Check from "./Check.js";
|
|
|
2
2
|
import Credit from "./Credit.js";
|
|
3
3
|
import defaultValue from "./defaultValue.js";
|
|
4
4
|
import defined from "./defined.js";
|
|
5
|
+
import deprecationWarning from "./deprecationWarning.js";
|
|
5
6
|
import Ellipsoid from "./Ellipsoid.js";
|
|
6
7
|
import Event from "./Event.js";
|
|
7
8
|
import GeographicTilingScheme from "./GeographicTilingScheme.js";
|
|
@@ -89,6 +90,7 @@ function CustomHeightmapTerrainProvider(options) {
|
|
|
89
90
|
}
|
|
90
91
|
this._credit = credit;
|
|
91
92
|
|
|
93
|
+
this._ready = true;
|
|
92
94
|
this._readyPromise = Promise.resolve(true);
|
|
93
95
|
}
|
|
94
96
|
|
|
@@ -137,9 +139,14 @@ Object.defineProperties(CustomHeightmapTerrainProvider.prototype, {
|
|
|
137
139
|
* @memberof CustomHeightmapTerrainProvider.prototype
|
|
138
140
|
* @type {boolean}
|
|
139
141
|
* @readonly
|
|
142
|
+
* @deprecated
|
|
140
143
|
*/
|
|
141
144
|
ready: {
|
|
142
145
|
get: function () {
|
|
146
|
+
deprecationWarning(
|
|
147
|
+
"CustomHeightmapTerrainProvider.ready",
|
|
148
|
+
"CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
149
|
+
);
|
|
143
150
|
return true;
|
|
144
151
|
},
|
|
145
152
|
},
|
|
@@ -149,9 +156,14 @@ Object.defineProperties(CustomHeightmapTerrainProvider.prototype, {
|
|
|
149
156
|
* @memberof CustomHeightmapTerrainProvider.prototype
|
|
150
157
|
* @type {Promise<boolean>}
|
|
151
158
|
* @readonly
|
|
159
|
+
* @deprecated
|
|
152
160
|
*/
|
|
153
161
|
readyPromise: {
|
|
154
162
|
get: function () {
|
|
163
|
+
deprecationWarning(
|
|
164
|
+
"CustomHeightmapTerrainProvider.readyPromise",
|
|
165
|
+
"CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
166
|
+
);
|
|
155
167
|
return this._readyPromise;
|
|
156
168
|
},
|
|
157
169
|
},
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import defaultValue from "./defaultValue.js";
|
|
2
2
|
import defined from "./defined.js";
|
|
3
|
+
import deprecationWarning from "./deprecationWarning.js";
|
|
3
4
|
import Ellipsoid from "./Ellipsoid.js";
|
|
4
5
|
import Event from "./Event.js";
|
|
5
6
|
import GeographicTilingScheme from "./GeographicTilingScheme.js";
|
|
@@ -42,6 +43,7 @@ function EllipsoidTerrainProvider(options) {
|
|
|
42
43
|
);
|
|
43
44
|
|
|
44
45
|
this._errorEvent = new Event();
|
|
46
|
+
this._ready = true;
|
|
45
47
|
this._readyPromise = Promise.resolve(true);
|
|
46
48
|
}
|
|
47
49
|
|
|
@@ -62,7 +64,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
66
|
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
|
|
65
|
-
* the source of the terrain.
|
|
67
|
+
* the source of the terrain.
|
|
66
68
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
67
69
|
* @type {Credit}
|
|
68
70
|
* @readonly
|
|
@@ -74,8 +76,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
74
76
|
},
|
|
75
77
|
|
|
76
78
|
/**
|
|
77
|
-
* Gets the tiling scheme used by this provider.
|
|
78
|
-
* not be called before {@link EllipsoidTerrainProvider#ready} returns true.
|
|
79
|
+
* Gets the tiling scheme used by this provider.
|
|
79
80
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
80
81
|
* @type {GeographicTilingScheme}
|
|
81
82
|
* @readonly
|
|
@@ -91,9 +92,14 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
91
92
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
92
93
|
* @type {boolean}
|
|
93
94
|
* @readonly
|
|
95
|
+
* @deprecated
|
|
94
96
|
*/
|
|
95
97
|
ready: {
|
|
96
98
|
get: function () {
|
|
99
|
+
deprecationWarning(
|
|
100
|
+
"EllipsoidTerrainProvider.ready",
|
|
101
|
+
"EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
102
|
+
);
|
|
97
103
|
return true;
|
|
98
104
|
},
|
|
99
105
|
},
|
|
@@ -103,9 +109,14 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
103
109
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
104
110
|
* @type {Promise<boolean>}
|
|
105
111
|
* @readonly
|
|
112
|
+
* @deprecated
|
|
106
113
|
*/
|
|
107
114
|
readyPromise: {
|
|
108
115
|
get: function () {
|
|
116
|
+
deprecationWarning(
|
|
117
|
+
"EllipsoidTerrainProvider.readyPromise",
|
|
118
|
+
"EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
119
|
+
);
|
|
109
120
|
return this._readyPromise;
|
|
110
121
|
},
|
|
111
122
|
},
|
|
@@ -113,8 +124,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
113
124
|
/**
|
|
114
125
|
* Gets a value indicating whether or not the provider includes a water mask. The water mask
|
|
115
126
|
* indicates which areas of the globe are water rather than land, so they can be rendered
|
|
116
|
-
* as a reflective surface with animated waves.
|
|
117
|
-
* called before {@link EllipsoidTerrainProvider#ready} returns true.
|
|
127
|
+
* as a reflective surface with animated waves.
|
|
118
128
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
119
129
|
* @type {boolean}
|
|
120
130
|
* @readonly
|
|
@@ -127,7 +137,6 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
127
137
|
|
|
128
138
|
/**
|
|
129
139
|
* Gets a value indicating whether or not the requested tiles include vertex normals.
|
|
130
|
-
* This function should not be called before {@link EllipsoidTerrainProvider#ready} returns true.
|
|
131
140
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
132
141
|
* @type {boolean}
|
|
133
142
|
* @readonly
|
|
@@ -139,8 +148,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
139
148
|
},
|
|
140
149
|
/**
|
|
141
150
|
* Gets an object that can be used to determine availability of terrain from this provider, such as
|
|
142
|
-
* at points and in rectangles.
|
|
143
|
-
* {@link TerrainProvider#ready} returns true. This property may be undefined if availability
|
|
151
|
+
* at points and in rectangles. This property may be undefined if availability
|
|
144
152
|
* information is not available.
|
|
145
153
|
* @memberof EllipsoidTerrainProvider.prototype
|
|
146
154
|
* @type {TileAvailability}
|
|
@@ -154,8 +162,7 @@ Object.defineProperties(EllipsoidTerrainProvider.prototype, {
|
|
|
154
162
|
});
|
|
155
163
|
|
|
156
164
|
/**
|
|
157
|
-
* Requests the geometry for a given tile.
|
|
158
|
-
* {@link TerrainProvider#ready} returns true. The result includes terrain
|
|
165
|
+
* Requests the geometry for a given tile. The result includes terrain
|
|
159
166
|
* data and indicates that all child tiles are available.
|
|
160
167
|
*
|
|
161
168
|
* @param {number} x The X coordinate of the tile for which to request geometry.
|
|
@@ -295,8 +295,8 @@ FrustumGeometry._computeNearFarPlanes = function (
|
|
|
295
295
|
|
|
296
296
|
let inverseView;
|
|
297
297
|
let inverseViewProjection;
|
|
298
|
+
const projection = frustum.projectionMatrix;
|
|
298
299
|
if (frustumType === PERSPECTIVE) {
|
|
299
|
-
const projection = frustum.projectionMatrix;
|
|
300
300
|
const viewProjection = Matrix4.multiply(
|
|
301
301
|
projection,
|
|
302
302
|
view,
|
|
@@ -4,6 +4,7 @@ import Check from "./Check.js";
|
|
|
4
4
|
import Credit from "./Credit.js";
|
|
5
5
|
import defaultValue from "./defaultValue.js";
|
|
6
6
|
import defined from "./defined.js";
|
|
7
|
+
import deprecationWarning from "./deprecationWarning.js";
|
|
7
8
|
import GoogleEarthEnterpriseTileInformation from "./GoogleEarthEnterpriseTileInformation.js";
|
|
8
9
|
import isBitSet from "./isBitSet.js";
|
|
9
10
|
import loadAndExecuteScript from "./loadAndExecuteScript.js";
|
|
@@ -30,37 +31,23 @@ const defaultKey = stringToBuffer(
|
|
|
30
31
|
);
|
|
31
32
|
|
|
32
33
|
/**
|
|
34
|
+
* <div class="notice">
|
|
35
|
+
* To construct GoogleEarthEnterpriseMetadata, call {@link GoogleEarthEnterpriseMetadata.fromUrl}. Do not call the constructor directly.
|
|
36
|
+
* </div>
|
|
37
|
+
*
|
|
33
38
|
* Provides metadata using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
|
|
34
39
|
* and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
|
|
35
40
|
*
|
|
36
41
|
* @alias GoogleEarthEnterpriseMetadata
|
|
37
42
|
* @constructor
|
|
38
43
|
*
|
|
39
|
-
* @param {Resource|string} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery
|
|
44
|
+
* @param {Resource|string} [resourceOrUrl] The url of the Google Earth Enterprise server hosting the imagery. Deprecated.
|
|
40
45
|
*
|
|
41
46
|
* @see GoogleEarthEnterpriseImageryProvider
|
|
42
47
|
* @see GoogleEarthEnterpriseTerrainProvider
|
|
43
48
|
*
|
|
44
49
|
*/
|
|
45
50
|
function GoogleEarthEnterpriseMetadata(resourceOrUrl) {
|
|
46
|
-
//>>includeStart('debug', pragmas.debug);
|
|
47
|
-
Check.defined("resourceOrUrl", resourceOrUrl);
|
|
48
|
-
//>>includeEnd('debug');
|
|
49
|
-
|
|
50
|
-
let url = resourceOrUrl;
|
|
51
|
-
|
|
52
|
-
if (typeof url !== "string" && !(url instanceof Resource)) {
|
|
53
|
-
//>>includeStart('debug', pragmas.debug);
|
|
54
|
-
Check.typeOf.string("resourceOrUrl.url", resourceOrUrl.url);
|
|
55
|
-
//>>includeEnd('debug');
|
|
56
|
-
|
|
57
|
-
url = resourceOrUrl.url;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const resource = Resource.createIfNeeded(url);
|
|
61
|
-
resource.appendForwardSlash();
|
|
62
|
-
this._resource = resource;
|
|
63
|
-
|
|
64
51
|
/**
|
|
65
52
|
* True if imagery is available.
|
|
66
53
|
* @type {boolean}
|
|
@@ -109,25 +96,43 @@ function GoogleEarthEnterpriseMetadata(resourceOrUrl) {
|
|
|
109
96
|
*/
|
|
110
97
|
this.key = undefined;
|
|
111
98
|
|
|
99
|
+
this._resource = undefined;
|
|
112
100
|
this._quadPacketVersion = 1;
|
|
113
|
-
|
|
114
101
|
this._tileInfo = {};
|
|
115
102
|
this._subtreePromises = {};
|
|
116
103
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
104
|
+
this._readyPromise = Promise.resolve(true);
|
|
105
|
+
if (defined(resourceOrUrl)) {
|
|
106
|
+
deprecationWarning(
|
|
107
|
+
"GoogleEarthEnterpriseMetadata options.url",
|
|
108
|
+
"GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
let url = resourceOrUrl;
|
|
112
|
+
|
|
113
|
+
if (typeof url !== "string" && !(url instanceof Resource)) {
|
|
114
|
+
url = resourceOrUrl.url;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const resource = Resource.createIfNeeded(url);
|
|
118
|
+
resource.appendForwardSlash();
|
|
119
|
+
this._resource = resource;
|
|
120
|
+
|
|
121
|
+
const that = this;
|
|
122
|
+
this._readyPromise = requestDbRoot(this)
|
|
123
|
+
.then(function () {
|
|
124
|
+
return that.getQuadTreePacket("", that._quadPacketVersion);
|
|
125
|
+
})
|
|
126
|
+
.then(function () {
|
|
127
|
+
return true;
|
|
128
|
+
})
|
|
129
|
+
.catch(function (e) {
|
|
130
|
+
const message = `An error occurred while accessing ${
|
|
131
|
+
getMetadataResource(that, "", 1).url
|
|
132
|
+
}.`;
|
|
133
|
+
return Promise.reject(new RuntimeError(message));
|
|
134
|
+
});
|
|
135
|
+
}
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
|
|
@@ -172,14 +177,61 @@ Object.defineProperties(GoogleEarthEnterpriseMetadata.prototype, {
|
|
|
172
177
|
* @memberof GoogleEarthEnterpriseMetadata.prototype
|
|
173
178
|
* @type {Promise<boolean>}
|
|
174
179
|
* @readonly
|
|
180
|
+
* @deprecated
|
|
175
181
|
*/
|
|
176
182
|
readyPromise: {
|
|
177
183
|
get: function () {
|
|
184
|
+
deprecationWarning(
|
|
185
|
+
"GoogleEarthEnterpriseMetadata.readyPromise",
|
|
186
|
+
"GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."
|
|
187
|
+
);
|
|
178
188
|
return this._readyPromise;
|
|
179
189
|
},
|
|
180
190
|
},
|
|
181
191
|
});
|
|
182
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Creates a metadata object using the Google Earth Enterprise REST API. This is used by the GoogleEarthEnterpriseImageryProvider
|
|
195
|
+
* and GoogleEarthEnterpriseTerrainProvider to share metadata requests.
|
|
196
|
+
*
|
|
197
|
+
* @param {Resource|String} resourceOrUrl The url of the Google Earth Enterprise server hosting the imagery.
|
|
198
|
+
*
|
|
199
|
+
* @returns {Promise<GoogleEarthEnterpriseMetadata>} A promise which resolves to the created GoogleEarthEnterpriseMetadata instance/
|
|
200
|
+
*/
|
|
201
|
+
GoogleEarthEnterpriseMetadata.fromUrl = async function (resourceOrUrl) {
|
|
202
|
+
//>>includeStart('debug', pragmas.debug);
|
|
203
|
+
Check.defined("resourceOrUrl", resourceOrUrl);
|
|
204
|
+
//>>includeEnd('debug');
|
|
205
|
+
let url = resourceOrUrl;
|
|
206
|
+
|
|
207
|
+
if (typeof url !== "string" && !(url instanceof Resource)) {
|
|
208
|
+
//>>includeStart('debug', pragmas.debug);
|
|
209
|
+
Check.typeOf.string("resourceOrUrl.url", resourceOrUrl.url);
|
|
210
|
+
//>>includeEnd('debug');
|
|
211
|
+
|
|
212
|
+
url = resourceOrUrl.url;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const resource = Resource.createIfNeeded(url);
|
|
216
|
+
resource.appendForwardSlash();
|
|
217
|
+
|
|
218
|
+
const metadata = new GoogleEarthEnterpriseMetadata();
|
|
219
|
+
metadata._resource = resource;
|
|
220
|
+
|
|
221
|
+
try {
|
|
222
|
+
await requestDbRoot(metadata);
|
|
223
|
+
await metadata.getQuadTreePacket("", metadata._quadPacketVersion);
|
|
224
|
+
} catch (error) {
|
|
225
|
+
const message = `An error occurred while accessing ${
|
|
226
|
+
getMetadataResource(metadata, "", 1).url
|
|
227
|
+
}: ${error}`;
|
|
228
|
+
|
|
229
|
+
throw new RuntimeError(message);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
return metadata;
|
|
233
|
+
};
|
|
234
|
+
|
|
183
235
|
/**
|
|
184
236
|
* Converts a tiles (x, y, level) position into a quadkey used to request an image
|
|
185
237
|
* from a Google Earth Enterprise server.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import Check from "./Check.js";
|
|
1
2
|
import Credit from "./Credit.js";
|
|
2
3
|
import defaultValue from "./defaultValue.js";
|
|
3
4
|
import defined from "./defined.js";
|
|
4
|
-
import
|
|
5
|
+
import deprecationWarning from "./deprecationWarning.js";
|
|
5
6
|
import Event from "./Event.js";
|
|
6
7
|
import GeographicTilingScheme from "./GeographicTilingScheme.js";
|
|
7
8
|
import GoogleEarthEnterpriseMetadata from "./GoogleEarthEnterpriseMetadata.js";
|
|
@@ -67,46 +68,42 @@ TerrainCache.prototype.tidy = function () {
|
|
|
67
68
|
};
|
|
68
69
|
|
|
69
70
|
/**
|
|
71
|
+
* @typedef {Object} GoogleEarthEnterpriseTerrainProvider.ConstructorOptions
|
|
72
|
+
*
|
|
73
|
+
* Initialization options for GoogleEarthEnterpriseTerrainProvider constructor
|
|
74
|
+
*
|
|
75
|
+
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
|
|
76
|
+
* @property {Credit|string} [credit] A credit for the data source, which is displayed on the canvas.
|
|
77
|
+
* @property {Resource|string} [url] The url of the Google Earth Enterprise server hosting the imagery. Deprecated.
|
|
78
|
+
* @property {GoogleEarthEnterpriseMetadata} [metadata] A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider. Deprecated.
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* <div class="notice">
|
|
83
|
+
* To construct a GoogleEarthEnterpriseTerrainProvider, call {@link GoogleEarthEnterpriseTerrainProvider.fromMetadata}. Do not call the constructor directly.
|
|
84
|
+
* </div>
|
|
85
|
+
*
|
|
70
86
|
* Provides tiled terrain using the Google Earth Enterprise REST API.
|
|
71
87
|
*
|
|
72
88
|
* @alias GoogleEarthEnterpriseTerrainProvider
|
|
73
89
|
* @constructor
|
|
74
90
|
*
|
|
75
|
-
* @param {
|
|
76
|
-
* @param {Resource|string} options.url The url of the Google Earth Enterprise server hosting the imagery.
|
|
77
|
-
* @param {GoogleEarthEnterpriseMetadata} options.metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
|
|
78
|
-
* @param {Ellipsoid} [options.ellipsoid] The ellipsoid. If not specified, the WGS84 ellipsoid is used.
|
|
79
|
-
* @param {Credit|string} [options.credit] A credit for the data source, which is displayed on the canvas.
|
|
91
|
+
* @param {GoogleEarthEnterpriseTerrainProvider.ConstructorOptions} options An object describing initialization options
|
|
80
92
|
*
|
|
93
|
+
* @see GoogleEarthEnterpriseTerrainProvider.fromMetadata
|
|
94
|
+
* @see GoogleEarthEnterpriseMetadata.fromUrl
|
|
81
95
|
* @see GoogleEarthEnterpriseImageryProvider
|
|
82
96
|
* @see CesiumTerrainProvider
|
|
83
97
|
*
|
|
84
98
|
* @example
|
|
85
|
-
* const geeMetadata =
|
|
86
|
-
* const gee =
|
|
87
|
-
* metadata : geeMetadata
|
|
88
|
-
* });
|
|
99
|
+
* const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com");
|
|
100
|
+
* const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata);
|
|
89
101
|
*
|
|
90
102
|
* @see {@link http://www.w3.org/TR/cors/|Cross-Origin Resource Sharing}
|
|
91
103
|
*/
|
|
92
104
|
function GoogleEarthEnterpriseTerrainProvider(options) {
|
|
93
105
|
options = defaultValue(options, defaultValue.EMPTY_OBJECT);
|
|
94
106
|
|
|
95
|
-
//>>includeStart('debug', pragmas.debug);
|
|
96
|
-
if (!(defined(options.url) || defined(options.metadata))) {
|
|
97
|
-
throw new DeveloperError("options.url or options.metadata is required.");
|
|
98
|
-
}
|
|
99
|
-
//>>includeEnd('debug');
|
|
100
|
-
|
|
101
|
-
let metadata;
|
|
102
|
-
if (defined(options.metadata)) {
|
|
103
|
-
metadata = options.metadata;
|
|
104
|
-
} else {
|
|
105
|
-
const resource = Resource.createIfNeeded(options.url);
|
|
106
|
-
metadata = new GoogleEarthEnterpriseMetadata(resource);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
this._metadata = metadata;
|
|
110
107
|
this._tilingScheme = new GeographicTilingScheme({
|
|
111
108
|
numberOfLevelZeroTilesX: 2,
|
|
112
109
|
numberOfLevelZeroTilesY: 2,
|
|
@@ -133,16 +130,32 @@ function GoogleEarthEnterpriseTerrainProvider(options) {
|
|
|
133
130
|
this._terrainRequests = {};
|
|
134
131
|
|
|
135
132
|
this._errorEvent = new Event();
|
|
136
|
-
|
|
137
133
|
this._ready = false;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
134
|
+
|
|
135
|
+
if (defined(options.url)) {
|
|
136
|
+
deprecationWarning(
|
|
137
|
+
"GoogleEarthEnterpriseTerrainProvider options.url",
|
|
138
|
+
"options.url was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead."
|
|
139
|
+
);
|
|
140
|
+
const resource = Resource.createIfNeeded(options.url);
|
|
141
|
+
const that = this;
|
|
142
|
+
let metadataError;
|
|
143
|
+
this._readyPromise = GoogleEarthEnterpriseMetadata.fromUrl(resource)
|
|
144
|
+
.then((metadata) => {
|
|
145
|
+
if (!metadata.terrainPresent) {
|
|
146
|
+
const e = new RuntimeError(
|
|
147
|
+
`The server ${metadata.url} doesn't have terrain`
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return Promise.reject(e);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
TileProviderError.reportSuccess(metadataError);
|
|
154
|
+
that._metadata = metadata;
|
|
155
|
+
that._ready = true;
|
|
156
|
+
return true;
|
|
157
|
+
})
|
|
158
|
+
.catch((e) => {
|
|
146
159
|
metadataError = TileProviderError.reportError(
|
|
147
160
|
metadataError,
|
|
148
161
|
that,
|
|
@@ -153,26 +166,29 @@ function GoogleEarthEnterpriseTerrainProvider(options) {
|
|
|
153
166
|
undefined,
|
|
154
167
|
e
|
|
155
168
|
);
|
|
156
|
-
return Promise.reject(e);
|
|
157
|
-
}
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
throw e;
|
|
171
|
+
});
|
|
172
|
+
} else if (defined(options.metadata)) {
|
|
173
|
+
deprecationWarning(
|
|
174
|
+
"GoogleEarthEnterpriseTerrainProvider options.metadata",
|
|
175
|
+
"options.metadata was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead."
|
|
176
|
+
);
|
|
177
|
+
const metadata = options.metadata;
|
|
178
|
+
this._metadata = metadata;
|
|
179
|
+
const that = this;
|
|
180
|
+
this._readyPromise = Promise.resolve(this._metadata._readyPromise).then(
|
|
181
|
+
() => {
|
|
182
|
+
if (!metadata.terrainPresent) {
|
|
183
|
+
throw new RuntimeError(
|
|
184
|
+
`The server ${metadata.url} doesn't have terrain`
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
that._ready = true;
|
|
189
|
+
}
|
|
190
|
+
);
|
|
191
|
+
}
|
|
176
192
|
}
|
|
177
193
|
|
|
178
194
|
Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
@@ -201,22 +217,13 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
201
217
|
},
|
|
202
218
|
|
|
203
219
|
/**
|
|
204
|
-
* Gets the tiling scheme used by this provider.
|
|
205
|
-
* not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
|
|
220
|
+
* Gets the tiling scheme used by this provider.
|
|
206
221
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
207
222
|
* @type {TilingScheme}
|
|
208
223
|
* @readonly
|
|
209
224
|
*/
|
|
210
225
|
tilingScheme: {
|
|
211
226
|
get: function () {
|
|
212
|
-
//>>includeStart('debug', pragmas.debug);
|
|
213
|
-
if (!this._ready) {
|
|
214
|
-
throw new DeveloperError(
|
|
215
|
-
"tilingScheme must not be called before the imagery provider is ready."
|
|
216
|
-
);
|
|
217
|
-
}
|
|
218
|
-
//>>includeEnd('debug');
|
|
219
|
-
|
|
220
227
|
return this._tilingScheme;
|
|
221
228
|
},
|
|
222
229
|
},
|
|
@@ -240,9 +247,14 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
240
247
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
241
248
|
* @type {boolean}
|
|
242
249
|
* @readonly
|
|
250
|
+
* @deprecated
|
|
243
251
|
*/
|
|
244
252
|
ready: {
|
|
245
253
|
get: function () {
|
|
254
|
+
deprecationWarning(
|
|
255
|
+
"GoogleEarthEnterpriseTerrainProvider.ready",
|
|
256
|
+
"GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
257
|
+
);
|
|
246
258
|
return this._ready;
|
|
247
259
|
},
|
|
248
260
|
},
|
|
@@ -252,16 +264,21 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
252
264
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
253
265
|
* @type {Promise<boolean>}
|
|
254
266
|
* @readonly
|
|
267
|
+
* @deprecated
|
|
255
268
|
*/
|
|
256
269
|
readyPromise: {
|
|
257
270
|
get: function () {
|
|
271
|
+
deprecationWarning(
|
|
272
|
+
"GoogleEarthEnterpriseTerrainProvider.readyPromise",
|
|
273
|
+
"GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107."
|
|
274
|
+
);
|
|
258
275
|
return this._readyPromise;
|
|
259
276
|
},
|
|
260
277
|
},
|
|
261
278
|
|
|
262
279
|
/**
|
|
263
280
|
* Gets the credit to display when this terrain provider is active. Typically this is used to credit
|
|
264
|
-
* the source of the terrain.
|
|
281
|
+
* the source of the terrain.
|
|
265
282
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
266
283
|
* @type {Credit}
|
|
267
284
|
* @readonly
|
|
@@ -275,8 +292,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
275
292
|
/**
|
|
276
293
|
* Gets a value indicating whether or not the provider includes a water mask. The water mask
|
|
277
294
|
* indicates which areas of the globe are water rather than land, so they can be rendered
|
|
278
|
-
* as a reflective surface with animated waves.
|
|
279
|
-
* called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
|
|
295
|
+
* as a reflective surface with animated waves.
|
|
280
296
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
281
297
|
* @type {boolean}
|
|
282
298
|
* @readonly
|
|
@@ -289,7 +305,6 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
289
305
|
|
|
290
306
|
/**
|
|
291
307
|
* Gets a value indicating whether or not the requested tiles include vertex normals.
|
|
292
|
-
* This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
|
|
293
308
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
294
309
|
* @type {boolean}
|
|
295
310
|
* @readonly
|
|
@@ -302,8 +317,7 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
302
317
|
|
|
303
318
|
/**
|
|
304
319
|
* Gets an object that can be used to determine availability of terrain from this provider, such as
|
|
305
|
-
* at points and in rectangles.
|
|
306
|
-
* {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. This property may be undefined if availability
|
|
320
|
+
* at points and in rectangles. This property may be undefined if availability
|
|
307
321
|
* information is not available.
|
|
308
322
|
* @memberof GoogleEarthEnterpriseTerrainProvider.prototype
|
|
309
323
|
* @type {TileAvailability}
|
|
@@ -316,6 +330,41 @@ Object.defineProperties(GoogleEarthEnterpriseTerrainProvider.prototype, {
|
|
|
316
330
|
},
|
|
317
331
|
});
|
|
318
332
|
|
|
333
|
+
/**
|
|
334
|
+
* Creates a GoogleEarthTerrainProvider from GoogleEarthEnterpriseMetadata
|
|
335
|
+
*
|
|
336
|
+
* @param {GoogleEarthEnterpriseMetadata} metadata A metadata object that can be used to share metadata requests with a GoogleEarthEnterpriseImageryProvider.
|
|
337
|
+
* @param {GoogleEarthEnterpriseTerrainProvider.ConstructorOptions} options An object describing initialization options
|
|
338
|
+
* @returns {GoogleEarthEnterpriseTerrainProvider}
|
|
339
|
+
*
|
|
340
|
+
* @see GoogleEarthEnterpriseMetadata.fromUrl
|
|
341
|
+
*
|
|
342
|
+
* @exception {RuntimeError} metadata does not specify terrain
|
|
343
|
+
*
|
|
344
|
+
* @example
|
|
345
|
+
* const geeMetadata = await GoogleEarthEnterpriseMetadata.fromUrl("http://www.example.com");
|
|
346
|
+
* const gee = Cesium.GoogleEarthEnterpriseTerrainProvider.fromMetadata(geeMetadata);
|
|
347
|
+
*/
|
|
348
|
+
GoogleEarthEnterpriseTerrainProvider.fromMetadata = function (
|
|
349
|
+
metadata,
|
|
350
|
+
options
|
|
351
|
+
) {
|
|
352
|
+
//>>includeStart('debug', pragmas.debug);
|
|
353
|
+
Check.defined("metadata", metadata);
|
|
354
|
+
//>>includeEnd('debug');
|
|
355
|
+
|
|
356
|
+
if (!metadata.terrainPresent) {
|
|
357
|
+
throw new RuntimeError(`The server ${metadata.url} doesn't have terrain`);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const provider = new GoogleEarthEnterpriseTerrainProvider(options);
|
|
361
|
+
provider._metadata = metadata;
|
|
362
|
+
provider._readyPromise = Promise.resolve(true);
|
|
363
|
+
provider._ready = true;
|
|
364
|
+
|
|
365
|
+
return provider;
|
|
366
|
+
};
|
|
367
|
+
|
|
319
368
|
const taskProcessor = new TaskProcessor("decodeGoogleEarthEnterprisePacket");
|
|
320
369
|
|
|
321
370
|
// If the tile has its own terrain, then you can just use its child bitmask. If it was requested using it's parent
|
|
@@ -338,8 +387,7 @@ function computeChildMask(quadKey, info, metadata) {
|
|
|
338
387
|
}
|
|
339
388
|
|
|
340
389
|
/**
|
|
341
|
-
* Requests the geometry for a given tile.
|
|
342
|
-
* {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true. The result must include terrain data and
|
|
390
|
+
* Requests the geometry for a given tile. The result must include terrain data and
|
|
343
391
|
* may optionally include a water mask and an indication of which child tiles are available.
|
|
344
392
|
*
|
|
345
393
|
* @param {number} x The X coordinate of the tile for which to request geometry.
|
|
@@ -349,9 +397,6 @@ function computeChildMask(quadKey, info, metadata) {
|
|
|
349
397
|
* @returns {Promise<TerrainData>|undefined} A promise for the requested geometry. If this method
|
|
350
398
|
* returns undefined instead of a promise, it is an indication that too many requests are already
|
|
351
399
|
* pending and the request will be retried later.
|
|
352
|
-
*
|
|
353
|
-
* @exception {DeveloperError} This function must not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready}
|
|
354
|
-
* returns true.
|
|
355
400
|
*/
|
|
356
401
|
GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function (
|
|
357
402
|
x,
|
|
@@ -359,14 +404,6 @@ GoogleEarthEnterpriseTerrainProvider.prototype.requestTileGeometry = function (
|
|
|
359
404
|
level,
|
|
360
405
|
request
|
|
361
406
|
) {
|
|
362
|
-
//>>includeStart('debug', pragmas.debug)
|
|
363
|
-
if (!this._ready) {
|
|
364
|
-
throw new DeveloperError(
|
|
365
|
-
"requestTileGeometry must not be called before the terrain provider is ready."
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
//>>includeEnd('debug');
|
|
369
|
-
|
|
370
407
|
const quadKey = GoogleEarthEnterpriseMetadata.tileXYToQuadKey(x, y, level);
|
|
371
408
|
const terrainCache = this._terrainCache;
|
|
372
409
|
const metadata = this._metadata;
|
package/Source/Core/Ion.js
CHANGED
|
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
|
|
|
4
4
|
|
|
5
5
|
let defaultTokenCredit;
|
|
6
6
|
const defaultAccessToken =
|
|
7
|
-
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
|
|
7
|
+
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJkYjk1OWEzOS0wM2UzLTQ1MmItYjVhNi0xOGE2NDAyNDc4ZjYiLCJpZCI6MjU5LCJpYXQiOjE2ODA1MzgxNTl9.ANfifMhFxb5agKqgDghPl1R__jvaz6dcEbkoNFM-txE";
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Cesium ion API.
|
|
10
10
|
*
|