@cesium/engine 2.1.0 → 2.3.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.
Files changed (240) hide show
  1. package/Build/Workers/{AttributeCompression-8a5a065e.js → AttributeCompression-f9f6c717.js} +1 -1
  2. package/Build/Workers/{AxisAlignedBoundingBox-a6f9f0e5.js → AxisAlignedBoundingBox-31fadcf0.js} +1 -1
  3. package/Build/Workers/{BoundingRectangle-b0a68595.js → BoundingRectangle-995f0079.js} +1 -1
  4. package/Build/Workers/{BoxGeometry-baedd794.js → BoxGeometry-7eb1af60.js} +1 -1
  5. package/Build/Workers/{Color-f85df1be.js → Color-2dc49658.js} +1 -1
  6. package/Build/Workers/{CoplanarPolygonGeometryLibrary-30516950.js → CoplanarPolygonGeometryLibrary-d7d972d6.js} +1 -1
  7. package/Build/Workers/{CorridorGeometryLibrary-5d5d3b3a.js → CorridorGeometryLibrary-1f5ef7b3.js} +1 -1
  8. package/Build/Workers/{CylinderGeometry-d899ae26.js → CylinderGeometry-23c67a6c.js} +1 -1
  9. package/Build/Workers/{CylinderGeometryLibrary-135b0858.js → CylinderGeometryLibrary-7bf291b4.js} +1 -1
  10. package/Build/Workers/{EllipseGeometry-a49f8449.js → EllipseGeometry-37014da4.js} +1 -1
  11. package/Build/Workers/{EllipseGeometryLibrary-cba7edde.js → EllipseGeometryLibrary-92ab6b1e.js} +1 -1
  12. package/Build/Workers/{EllipseOutlineGeometry-8095c8cb.js → EllipseOutlineGeometry-12b6fef5.js} +1 -1
  13. package/Build/Workers/{EllipsoidGeodesic-dcff5cbd.js → EllipsoidGeodesic-5b3623dc.js} +1 -1
  14. package/Build/Workers/{EllipsoidGeometry-ed93f571.js → EllipsoidGeometry-508da15c.js} +1 -1
  15. package/Build/Workers/{EllipsoidOutlineGeometry-e4854854.js → EllipsoidOutlineGeometry-40d97455.js} +1 -1
  16. package/Build/Workers/{EllipsoidRhumbLine-b672d507.js → EllipsoidRhumbLine-ef872433.js} +1 -1
  17. package/Build/Workers/{EllipsoidTangentPlane-7ae1aa9a.js → EllipsoidTangentPlane-46d4d9c2.js} +1 -1
  18. package/Build/Workers/{EncodedCartesian3-e8bbca36.js → EncodedCartesian3-57415c8a.js} +1 -1
  19. package/Build/Workers/{FrustumGeometry-b62db3e3.js → FrustumGeometry-38605e69.js} +32 -4
  20. package/Build/Workers/{GeometryAttribute-780af4fa.js → GeometryAttribute-a466e9c7.js} +1 -1
  21. package/Build/Workers/{GeometryInstance-3fb607b7.js → GeometryInstance-34d9e21e.js} +1 -1
  22. package/Build/Workers/{GeometryPipeline-36b61c99.js → GeometryPipeline-dcf79306.js} +1 -1
  23. package/Build/Workers/{IndexDatatype-b8f3e09d.js → IndexDatatype-2643aa47.js} +1 -1
  24. package/Build/Workers/{IntersectionTests-e889fcf0.js → IntersectionTests-88c49b2e.js} +1 -1
  25. package/Build/Workers/{Math-dad82b4d.js → Math-0a2ac845.js} +12 -2
  26. package/Build/Workers/{Matrix2-1e403d0e.js → Matrix2-e1298525.js} +1 -1
  27. package/Build/Workers/{Matrix3-fa806b97.js → Matrix3-41c58dde.js} +1 -1
  28. package/Build/Workers/{OrientedBoundingBox-43478ac8.js → OrientedBoundingBox-2dd47921.js} +5 -3
  29. package/Build/Workers/{Plane-c27e1ac6.js → Plane-4c3d403b.js} +1 -1
  30. package/Build/Workers/{PolygonGeometryLibrary-38a98276.js → PolygonGeometryLibrary-59126025.js} +1 -1
  31. package/Build/Workers/PolygonPipeline-1fe328c0.js +1344 -0
  32. package/Build/Workers/{PolylinePipeline-30e4cec9.js → PolylinePipeline-896735cc.js} +1 -1
  33. package/Build/Workers/{PolylineVolumeGeometryLibrary-90551d26.js → PolylineVolumeGeometryLibrary-9c0639f7.js} +1 -1
  34. package/Build/Workers/{PrimitivePipeline-558d9cb0.js → PrimitivePipeline-fc1a47ff.js} +1 -1
  35. package/Build/Workers/{RectangleGeometryLibrary-815c68df.js → RectangleGeometryLibrary-a23c9ebe.js} +1 -1
  36. package/Build/Workers/{TerrainEncoding-341ead52.js → TerrainEncoding-51b8b33b.js} +1 -1
  37. package/Build/Workers/Transforms-bc45e707.js +14699 -0
  38. package/Build/Workers/{WallGeometryLibrary-ccf90976.js → WallGeometryLibrary-007e9883.js} +1 -1
  39. package/Build/Workers/{WebMercatorProjection-76a3fcc0.js → WebMercatorProjection-13ed1a6e.js} +1 -1
  40. package/Build/Workers/{arrayRemoveDuplicates-fac118a8.js → arrayRemoveDuplicates-d2061e85.js} +1 -1
  41. package/Build/Workers/cesiumWorkerBootstrapper.js +1 -1
  42. package/Build/Workers/combineGeometry.js +1 -1
  43. package/Build/Workers/createBoxGeometry.js +1 -1
  44. package/Build/Workers/createBoxOutlineGeometry.js +1 -1
  45. package/Build/Workers/createCircleGeometry.js +1 -1
  46. package/Build/Workers/createCircleOutlineGeometry.js +1 -1
  47. package/Build/Workers/createCoplanarPolygonGeometry.js +1 -1
  48. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +1 -1
  49. package/Build/Workers/createCorridorGeometry.js +1 -1
  50. package/Build/Workers/createCorridorOutlineGeometry.js +1 -1
  51. package/Build/Workers/createCylinderGeometry.js +1 -1
  52. package/Build/Workers/createCylinderOutlineGeometry.js +1 -1
  53. package/Build/Workers/createEllipseGeometry.js +1 -1
  54. package/Build/Workers/createEllipseOutlineGeometry.js +1 -1
  55. package/Build/Workers/createEllipsoidGeometry.js +1 -1
  56. package/Build/Workers/createEllipsoidOutlineGeometry.js +1 -1
  57. package/Build/Workers/createFrustumGeometry.js +1 -1
  58. package/Build/Workers/createFrustumOutlineGeometry.js +1 -1
  59. package/Build/Workers/createGeometry.js +1 -1
  60. package/Build/Workers/createGroundPolylineGeometry.js +1 -1
  61. package/Build/Workers/createPlaneGeometry.js +1 -1
  62. package/Build/Workers/createPlaneOutlineGeometry.js +1 -1
  63. package/Build/Workers/createPolygonGeometry.js +1 -1
  64. package/Build/Workers/createPolygonOutlineGeometry.js +1 -1
  65. package/Build/Workers/createPolylineGeometry.js +1 -1
  66. package/Build/Workers/createPolylineVolumeGeometry.js +1 -1
  67. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +1 -1
  68. package/Build/Workers/createRectangleGeometry.js +1 -1
  69. package/Build/Workers/createRectangleOutlineGeometry.js +1 -1
  70. package/Build/Workers/createSimplePolylineGeometry.js +1 -1
  71. package/Build/Workers/createSphereGeometry.js +1 -1
  72. package/Build/Workers/createSphereOutlineGeometry.js +1 -1
  73. package/Build/Workers/createVectorTileClampedPolylines.js +1 -1
  74. package/Build/Workers/createVectorTileGeometries.js +1 -1
  75. package/Build/Workers/createVectorTilePoints.js +1 -1
  76. package/Build/Workers/createVectorTilePolygons.js +1 -1
  77. package/Build/Workers/createVectorTilePolylines.js +1 -1
  78. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
  79. package/Build/Workers/createVerticesFromHeightmap.js +5 -8
  80. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +10 -15
  81. package/Build/Workers/createWallGeometry.js +1 -1
  82. package/Build/Workers/createWallOutlineGeometry.js +1 -1
  83. package/Build/Workers/decodeDraco.js +1 -1
  84. package/Build/Workers/decodeI3S.js +1 -1
  85. package/Build/Workers/package.js +1 -1
  86. package/Build/Workers/transferTypedArrayTest.js +1 -1
  87. package/Build/Workers/upsampleQuantizedTerrainMesh.js +1 -1
  88. package/Source/Core/ArcGISTiledElevationTerrainProvider.js +291 -191
  89. package/Source/Core/BingMapsGeocoderService.js +19 -1
  90. package/Source/Core/CartographicGeocoderService.js +15 -0
  91. package/Source/Core/CesiumTerrainProvider.js +571 -434
  92. package/Source/Core/Credit.js +1 -1
  93. package/Source/Core/CustomHeightmapTerrainProvider.js +12 -0
  94. package/Source/Core/EllipsoidTerrainProvider.js +17 -10
  95. package/Source/Core/FrustumGeometry.js +4 -3
  96. package/Source/Core/GeocoderService.js +32 -1
  97. package/Source/Core/GoogleEarthEnterpriseMetadata.js +86 -34
  98. package/Source/Core/GoogleEarthEnterpriseTerrainProvider.js +119 -82
  99. package/Source/Core/Ion.js +1 -1
  100. package/Source/Core/IonGeocoderService.js +17 -2
  101. package/Source/Core/IonResource.js +14 -3
  102. package/Source/Core/OpenCageGeocoderService.js +18 -1
  103. package/Source/Core/OrientedBoundingBox.js +4 -2
  104. package/Source/Core/OrthographicFrustum.js +13 -0
  105. package/Source/Core/PeliasGeocoderService.js +14 -1
  106. package/Source/Core/PerspectiveFrustum.js +14 -0
  107. package/Source/Core/Request.js +3 -2
  108. package/Source/Core/RequestScheduler.js +10 -5
  109. package/Source/Core/Resource.js +230 -236
  110. package/Source/Core/TerrainProvider.js +9 -14
  111. package/Source/Core/TileProviderError.js +8 -8
  112. package/Source/Core/VRTheWorldTerrainProvider.js +193 -124
  113. package/Source/Core/buildModuleUrl.js +4 -3
  114. package/Source/Core/createWorldTerrain.js +20 -2
  115. package/Source/Core/createWorldTerrainAsync.js +48 -0
  116. package/Source/Core/sampleTerrain.js +9 -10
  117. package/Source/Core/sampleTerrainMostDetailed.js +66 -72
  118. package/Source/DataSources/Cesium3DTilesetVisualizer.js +37 -26
  119. package/Source/DataSources/DataSourceDisplay.js +2 -2
  120. package/Source/DataSources/Entity.js +6 -1
  121. package/Source/DataSources/EntityCluster.js +126 -128
  122. package/Source/DataSources/ModelVisualizer.js +104 -34
  123. package/Source/DataSources/PolygonGraphics.js +1 -1
  124. package/Source/Renderer/UniformState.js +3 -2
  125. package/Source/Renderer/demodernizeShader.js +5 -5
  126. package/Source/Scene/ArcGisBaseMapType.js +12 -0
  127. package/Source/Scene/ArcGisMapServerImageryProvider.js +694 -376
  128. package/Source/Scene/ArcGisMapService.js +83 -0
  129. package/Source/Scene/BingMapsImageryProvider.js +511 -305
  130. package/Source/Scene/BufferLoader.js +29 -34
  131. package/Source/Scene/Camera.js +8 -7
  132. package/Source/Scene/Cesium3DTile.js +392 -254
  133. package/Source/Scene/Cesium3DTileBatchTable.js +2 -2
  134. package/Source/Scene/Cesium3DTileContent.js +16 -0
  135. package/Source/Scene/Cesium3DTileContentFactory.js +4 -4
  136. package/Source/Scene/Cesium3DTilePass.js +8 -11
  137. package/Source/Scene/Cesium3DTileStyleEngine.js +1 -1
  138. package/Source/Scene/Cesium3DTilesVoxelProvider.js +225 -117
  139. package/Source/Scene/Cesium3DTileset.js +756 -482
  140. package/Source/Scene/Cesium3DTilesetBaseTraversal.js +301 -0
  141. package/Source/Scene/Cesium3DTilesetMostDetailedTraversal.js +33 -46
  142. package/Source/Scene/Cesium3DTilesetSkipTraversal.js +421 -0
  143. package/Source/Scene/Cesium3DTilesetTraversal.js +219 -671
  144. package/Source/Scene/ClassificationPrimitive.js +7 -0
  145. package/Source/Scene/Composite3DTileContent.js +69 -26
  146. package/Source/Scene/CreditDisplay.js +132 -20
  147. package/Source/Scene/DepthPlane.js +1 -1
  148. package/Source/Scene/Empty3DTileContent.js +31 -1
  149. package/Source/Scene/Geometry3DTileContent.js +47 -7
  150. package/Source/Scene/Globe.js +5 -1
  151. package/Source/Scene/GlobeSurfaceTile.js +2 -1
  152. package/Source/Scene/GlobeSurfaceTileProvider.js +53 -30
  153. package/Source/Scene/GltfBufferViewLoader.js +47 -91
  154. package/Source/Scene/GltfDracoLoader.js +110 -112
  155. package/Source/Scene/GltfImageLoader.js +71 -78
  156. package/Source/Scene/GltfIndexBufferLoader.js +108 -121
  157. package/Source/Scene/GltfJsonLoader.js +87 -74
  158. package/Source/Scene/GltfLoader.js +381 -300
  159. package/Source/Scene/GltfStructuralMetadataLoader.js +109 -110
  160. package/Source/Scene/GltfTextureLoader.js +97 -96
  161. package/Source/Scene/GltfVertexBufferLoader.js +128 -133
  162. package/Source/Scene/GoogleEarthEnterpriseImageryProvider.js +353 -225
  163. package/Source/Scene/GoogleEarthEnterpriseMapsProvider.js +491 -331
  164. package/Source/Scene/GridImageryProvider.js +267 -104
  165. package/Source/Scene/GroundPolylinePrimitive.js +12 -1
  166. package/Source/Scene/GroundPrimitive.js +8 -1
  167. package/Source/Scene/I3SDataProvider.js +214 -113
  168. package/Source/Scene/I3SFeature.js +7 -6
  169. package/Source/Scene/I3SLayer.js +26 -37
  170. package/Source/Scene/I3SNode.js +59 -66
  171. package/Source/Scene/Imagery.js +6 -1
  172. package/Source/Scene/ImageryLayer.js +299 -48
  173. package/Source/Scene/ImageryLayerCollection.js +26 -0
  174. package/Source/Scene/ImageryProvider.js +129 -111
  175. package/Source/Scene/Implicit3DTileContent.js +72 -23
  176. package/Source/Scene/ImplicitSubtree.js +66 -45
  177. package/Source/Scene/IonImageryProvider.js +482 -275
  178. package/Source/Scene/MapboxImageryProvider.js +272 -112
  179. package/Source/Scene/MapboxStyleImageryProvider.js +270 -111
  180. package/Source/Scene/MetadataSchemaLoader.js +26 -36
  181. package/Source/Scene/Model/B3dmLoader.js +42 -46
  182. package/Source/Scene/Model/GeoJsonLoader.js +8 -32
  183. package/Source/Scene/Model/I3dmLoader.js +48 -74
  184. package/Source/Scene/Model/MaterialPipelineStage.js +12 -12
  185. package/Source/Scene/Model/Model.js +514 -135
  186. package/Source/Scene/Model/Model3DTileContent.js +83 -31
  187. package/Source/Scene/Model/ModelAnimationCollection.js +3 -3
  188. package/Source/Scene/Model/ModelDrawCommand.js +15 -26
  189. package/Source/Scene/Model/ModelUtility.js +16 -16
  190. package/Source/Scene/Model/PntsLoader.js +27 -32
  191. package/Source/Scene/Model/UniformType.js +1 -1
  192. package/Source/Scene/Multiple3DTileContent.js +134 -115
  193. package/Source/Scene/Picking.js +3 -2
  194. package/Source/Scene/PointCloud.js +11 -19
  195. package/Source/Scene/Primitive.js +20 -0
  196. package/Source/Scene/QuadtreePrimitive.js +5 -2
  197. package/Source/Scene/QuadtreeTileProvider.js +4 -8
  198. package/Source/Scene/ResourceCache.js +47 -105
  199. package/Source/Scene/ResourceCacheStatistics.js +24 -58
  200. package/Source/Scene/ResourceLoader.js +5 -17
  201. package/Source/Scene/ResourceLoaderState.js +12 -4
  202. package/Source/Scene/Scene.js +65 -0
  203. package/Source/Scene/SceneTransforms.js +3 -2
  204. package/Source/Scene/ScreenSpaceCameraController.js +2 -2
  205. package/Source/Scene/SingleTileImageryProvider.js +382 -209
  206. package/Source/Scene/Terrain.js +196 -0
  207. package/Source/Scene/TileCoordinatesImageryProvider.js +267 -104
  208. package/Source/Scene/TileMapServiceImageryProvider.js +177 -85
  209. package/Source/Scene/Tileset3DTileContent.js +47 -5
  210. package/Source/Scene/TimeDynamicPointCloud.js +15 -2
  211. package/Source/Scene/UrlTemplateImageryProvider.js +343 -215
  212. package/Source/Scene/Vector3DTileClampedPolylines.js +96 -84
  213. package/Source/Scene/Vector3DTileContent.js +47 -22
  214. package/Source/Scene/Vector3DTileGeometry.js +57 -52
  215. package/Source/Scene/Vector3DTilePoints.js +97 -81
  216. package/Source/Scene/Vector3DTilePolygons.js +118 -117
  217. package/Source/Scene/Vector3DTilePolylines.js +86 -82
  218. package/Source/Scene/Vector3DTilePrimitive.js +0 -1
  219. package/Source/Scene/VoxelContent.js +61 -63
  220. package/Source/Scene/VoxelPrimitive.js +39 -91
  221. package/Source/Scene/VoxelProvider.js +2 -2
  222. package/Source/Scene/WebMapServiceImageryProvider.js +272 -111
  223. package/Source/Scene/WebMapTileServiceImageryProvider.js +270 -107
  224. package/Source/Scene/computeFlyToLocationForRectangle.js +33 -37
  225. package/Source/Scene/createOsmBuildings.js +6 -0
  226. package/Source/Scene/createOsmBuildingsAsync.js +82 -0
  227. package/Source/Scene/createWorldImagery.js +14 -5
  228. package/Source/Scene/createWorldImageryAsync.js +39 -0
  229. package/Source/Shaders/AtmosphereCommon.glsl +51 -8
  230. package/Source/Shaders/AtmosphereCommon.js +51 -8
  231. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +1 -1
  232. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +1 -1
  233. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +3 -3
  234. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +3 -3
  235. package/Source/Widget/CesiumWidget.js +67 -27
  236. package/index.d.ts +2429 -1475
  237. package/index.js +324 -315
  238. package/package.json +4 -4
  239. package/Build/Workers/PolygonPipeline-d31ff61c.js +0 -1345
  240. package/Build/Workers/Transforms-9e9df299.js +0 -14714
@@ -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 DeveloperError from "./DeveloperError.js";
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 {object} options Object with the following properties:
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 = new GoogleEarthEnterpriseMetadata('http://www.example.com');
86
- * const gee = new Cesium.GoogleEarthEnterpriseTerrainProvider({
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
- const that = this;
139
- let metadataError;
140
- this._readyPromise = metadata.readyPromise
141
- .then(function (result) {
142
- if (!metadata.terrainPresent) {
143
- const e = new RuntimeError(
144
- `The server ${metadata.url} doesn't have terrain`
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
- TileProviderError.reportSuccess(metadataError);
160
- that._ready = result;
161
- return result;
162
- })
163
- .catch(function (e) {
164
- metadataError = TileProviderError.reportError(
165
- metadataError,
166
- that,
167
- that._errorEvent,
168
- e.message,
169
- undefined,
170
- undefined,
171
- undefined,
172
- e
173
- );
174
- return Promise.reject(e);
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. This function should
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. This function should not be called before {@link GoogleEarthEnterpriseTerrainProvider#ready} returns true.
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. This function should not be
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. This function should not be called before
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. This function should not be called before
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;
@@ -4,7 +4,7 @@ import Resource from "./Resource.js";
4
4
 
5
5
  let defaultTokenCredit;
6
6
  const defaultAccessToken =
7
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI4ZTMwYjM0Yy1lYTdkLTQ5YjEtOTUyYS01Y2YxMjE5OWJjMmEiLCJpZCI6MjU5LCJpYXQiOjE2Nzc2Nzk3MTZ9.OGOiqPh0He1XDVU6azp_c5w3jJcmPXcA1briVUcyrvQ";
7
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU";
8
8
  /**
9
9
  * Default settings for accessing the Cesium ion API.
10
10
  *
@@ -33,7 +33,7 @@ function IonGeocoderService(options) {
33
33
 
34
34
  const defaultTokenCredit = Ion.getDefaultTokenCredit(accessToken);
35
35
  if (defined(defaultTokenCredit)) {
36
- options.scene.frameState.creditDisplay.addDefaultCredit(
36
+ options.scene.frameState.creditDisplay.addStaticCredit(
37
37
  Credit.clone(defaultTokenCredit)
38
38
  );
39
39
  }
@@ -51,6 +51,21 @@ function IonGeocoderService(options) {
51
51
  this._pelias = new PeliasGeocoderService(searchEndpoint);
52
52
  }
53
53
 
54
+ Object.defineProperties(IonGeocoderService.prototype, {
55
+ /**
56
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
57
+ * the geocoder service.
58
+ * @memberof IonGeocoderService.prototype
59
+ * @type {Credit|undefined}
60
+ * @readonly
61
+ */
62
+ credit: {
63
+ get: function () {
64
+ return undefined;
65
+ },
66
+ },
67
+ });
68
+
54
69
  /**
55
70
  * @function
56
71
  *
@@ -58,7 +73,7 @@ function IonGeocoderService(options) {
58
73
  * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
59
74
  * @returns {Promise<GeocoderService.Result[]>}
60
75
  */
61
- IonGeocoderService.prototype.geocode = function (query, geocodeType) {
76
+ IonGeocoderService.prototype.geocode = async function (query, geocodeType) {
62
77
  return this._pelias.geocode(query, geocodeType);
63
78
  };
64
79
  export default IonGeocoderService;
@@ -16,7 +16,7 @@ import RuntimeError from "./RuntimeError.js";
16
16
  * @augments Resource
17
17
  *
18
18
  * @param {object} endpoint The result of the Cesium ion asset endpoint service.
19
- * @param {Resource} endpointResource The resource used to retreive the endpoint.
19
+ * @param {Resource} endpointResource The resource used to retrieve the endpoint.
20
20
  *
21
21
  * @see Ion
22
22
  * @see IonImageryProvider
@@ -87,8 +87,14 @@ if (defined(Object.create)) {
87
87
  * @returns {Promise<IonResource>} A Promise to am instance representing the Cesium ion Asset.
88
88
  *
89
89
  * @example
90
- * //Load a Cesium3DTileset with asset ID of 124624234
91
- * viewer.scene.primitives.add(new Cesium.Cesium3DTileset({ url: Cesium.IonResource.fromAssetId(124624234) }));
90
+ * // Load a Cesium3DTileset with asset ID of 124624234
91
+ * try {
92
+ * const resource = await Cesium.IonResource.fromAssetId(124624234);
93
+ * const tileset = await Cesium.Cesium3DTileset.fromUrl(resource);
94
+ * scene.primitives.add(tileset);
95
+ * } catch (error) {
96
+ * console.error(`Error creating tileset: ${error}`);
97
+ * }
92
98
  *
93
99
  * @example
94
100
  * //Load a CZML file with asset ID of 10890
@@ -197,6 +203,11 @@ IonResource.prototype._makeRequest = function (options) {
197
203
  options.headers = {};
198
204
  }
199
205
  options.headers.Authorization = `Bearer ${this._ionEndpoint.accessToken}`;
206
+ options.headers["X-Cesium-Client"] = "CesiumJS";
207
+ /* global CESIUM_VERSION */
208
+ if (typeof CESIUM_VERSION !== "undefined") {
209
+ options.headers["X-Cesium-Client-Version"] = CESIUM_VERSION;
210
+ }
200
211
 
201
212
  return Resource.prototype._makeRequest.call(this, options);
202
213
  };
@@ -1,6 +1,7 @@
1
1
  import Cartesian3 from "./Cartesian3.js";
2
2
  import Check from "./Check.js";
3
3
  import combine from "./combine.js";
4
+ import Credit from "./Credit.js";
4
5
  import defaultValue from "./defaultValue.js";
5
6
  import defined from "./defined.js";
6
7
  import Rectangle from "./Rectangle.js";
@@ -48,6 +49,10 @@ function OpenCageGeocoderService(url, apiKey, params) {
48
49
  url.setQueryParameters({ key: apiKey });
49
50
  this._url = url;
50
51
  this._params = defaultValue(params, {});
52
+ this._credit = new Credit(
53
+ `Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors`,
54
+ false
55
+ );
51
56
  }
52
57
 
53
58
  Object.defineProperties(OpenCageGeocoderService.prototype, {
@@ -73,6 +78,18 @@ Object.defineProperties(OpenCageGeocoderService.prototype, {
73
78
  return this._params;
74
79
  },
75
80
  },
81
+ /**
82
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
83
+ * the geocoder service.
84
+ * @memberof OpenCageGeocoderService.prototype
85
+ * @type {Credit|undefined}
86
+ * @readonly
87
+ */
88
+ credit: {
89
+ get: function () {
90
+ return this._credit;
91
+ },
92
+ },
76
93
  });
77
94
 
78
95
  /**
@@ -81,7 +98,7 @@ Object.defineProperties(OpenCageGeocoderService.prototype, {
81
98
  * @param {string} query The query to be sent to the geocoder service
82
99
  * @returns {Promise<GeocoderService.Result[]>}
83
100
  */
84
- OpenCageGeocoderService.prototype.geocode = function (query) {
101
+ OpenCageGeocoderService.prototype.geocode = async function (query) {
85
102
  //>>includeStart('debug', pragmas.debug);
86
103
  Check.typeOf.string("query", query);
87
104
  //>>includeEnd('debug');
@@ -24,7 +24,7 @@ import Rectangle from "./Rectangle.js";
24
24
  *
25
25
  * @param {Cartesian3} [center=Cartesian3.ZERO] The center of the box.
26
26
  * @param {Matrix3} [halfAxes=Matrix3.ZERO] The three orthogonal half-axes of the bounding box.
27
- * Equivalently, the transformation matrix, to rotate and scale a 1x1x1
27
+ * Equivalently, the transformation matrix, to rotate and scale a 2x2x2
28
28
  * cube centered at the origin.
29
29
  *
30
30
  *
@@ -46,7 +46,9 @@ function OrientedBoundingBox(center, halfAxes) {
46
46
  */
47
47
  this.center = Cartesian3.clone(defaultValue(center, Cartesian3.ZERO));
48
48
  /**
49
- * The transformation matrix, to rotate the box to the right position.
49
+ * The three orthogonal half-axes of the bounding box. Equivalently, the
50
+ * transformation matrix, to rotate and scale a 2x2x2 cube centered at the
51
+ * origin.
50
52
  * @type {Matrix3}
51
53
  * @default {@link Matrix3.ZERO}
52
54
  */
@@ -184,6 +184,19 @@ Object.defineProperties(OrthographicFrustum.prototype, {
184
184
  return this._offCenterFrustum.projectionMatrix;
185
185
  },
186
186
  },
187
+ /**
188
+ * Gets the orthographic projection matrix computed from the view frustum.
189
+ * @memberof OrthographicFrustum.prototype
190
+ * @type {OrthographicOffCenterFrustum}
191
+ * @readonly
192
+ * @private
193
+ */
194
+ offCenterFrustum: {
195
+ get: function () {
196
+ update(this);
197
+ return this._offCenterFrustum;
198
+ },
199
+ },
187
200
  });
188
201
 
189
202
  /**
@@ -44,6 +44,18 @@ Object.defineProperties(PeliasGeocoderService.prototype, {
44
44
  return this._url;
45
45
  },
46
46
  },
47
+ /**
48
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
49
+ * the geocoder service.
50
+ * @memberof PeliasGeocoderService.prototype
51
+ * @type {Credit|undefined}
52
+ * @readonly
53
+ */
54
+ credit: {
55
+ get: function () {
56
+ return undefined;
57
+ },
58
+ },
47
59
  });
48
60
 
49
61
  /**
@@ -53,7 +65,7 @@ Object.defineProperties(PeliasGeocoderService.prototype, {
53
65
  * @param {GeocodeType} [type=GeocodeType.SEARCH] The type of geocode to perform.
54
66
  * @returns {Promise<GeocoderService.Result[]>}
55
67
  */
56
- PeliasGeocoderService.prototype.geocode = function (query, type) {
68
+ PeliasGeocoderService.prototype.geocode = async function (query, type) {
57
69
  //>>includeStart('debug', pragmas.debug);
58
70
  Check.typeOf.string("query", query);
59
71
  //>>includeEnd('debug');
@@ -86,6 +98,7 @@ PeliasGeocoderService.prototype.geocode = function (query, type) {
86
98
  return {
87
99
  displayName: resultObject.properties.label,
88
100
  destination: destination,
101
+ attributions: results.attributions,
89
102
  };
90
103
  });
91
104
  });
@@ -274,6 +274,20 @@ Object.defineProperties(PerspectiveFrustum.prototype, {
274
274
  return this._sseDenominator;
275
275
  },
276
276
  },
277
+
278
+ /**
279
+ * Gets the orthographic projection matrix computed from the view frustum.
280
+ * @memberof PerspectiveFrustum.prototype
281
+ * @type {PerspectiveOffCenterFrustum}
282
+ * @readonly
283
+ * @private
284
+ */
285
+ offCenterFrustum: {
286
+ get: function () {
287
+ update(this);
288
+ return this._offCenterFrustum;
289
+ },
290
+ },
277
291
  });
278
292
 
279
293
  /**
@@ -18,6 +18,7 @@ import RequestType from "./RequestType.js";
18
18
  * @param {boolean} [options.throttle=false] Whether to throttle and prioritize the request. If false, the request will be sent immediately. If true, the request will be throttled and sent based on priority.
19
19
  * @param {boolean} [options.throttleByServer=false] Whether to throttle the request by server.
20
20
  * @param {RequestType} [options.type=RequestType.OTHER] The type of request.
21
+ * @param {string} [options.serverKey] A key used to identify the server that a request is going to.
21
22
  */
22
23
  function Request(options) {
23
24
  options = defaultValue(options, defaultValue.EMPTY_OBJECT);
@@ -105,7 +106,7 @@ function Request(options) {
105
106
  *
106
107
  * @private
107
108
  */
108
- this.serverKey = undefined;
109
+ this.serverKey = options.serverKey;
109
110
 
110
111
  /**
111
112
  * The current state of the request.
@@ -166,7 +167,7 @@ Request.prototype.clone = function (result) {
166
167
  result.serverKey = this.serverKey;
167
168
 
168
169
  // These get defaulted because the cloned request hasn't been issued
169
- result.state = this.RequestState.UNISSUED;
170
+ result.state = RequestState.UNISSUED;
170
171
  result.deferred = undefined;
171
172
  result.cancelled = false;
172
173
 
@@ -65,18 +65,23 @@ RequestScheduler.maximumRequests = 50;
65
65
  RequestScheduler.maximumRequestsPerServer = 6;
66
66
 
67
67
  /**
68
- * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
68
+ * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>.
69
+ * Useful when streaming data from a known HTTP/2 or HTTP/3 server.
69
70
  * @type {object}
70
71
  *
71
72
  * @example
73
+ * RequestScheduler.requestsByServer["myserver.com:443"] = 18;
74
+ *
75
+ * @example
72
76
  * RequestScheduler.requestsByServer = {
73
- * 'api.cesium.com:443': 18,
74
- * 'assets.cesium.com:443': 18
77
+ * "api.cesium.com:443": 18,
78
+ * "assets.cesium.com:443": 18,
75
79
  * };
76
80
  */
77
81
  RequestScheduler.requestsByServer = {
78
82
  "api.cesium.com:443": 18,
79
- "assets.cesium.com:443": 18,
83
+ "assets.ion.cesium.com:443": 18,
84
+ "ibasemaps-api.arcgis.com:443": 18,
80
85
  };
81
86
 
82
87
  /**
@@ -352,7 +357,7 @@ RequestScheduler.getServerKey = function (url) {
352
357
 
353
358
  let uri = new Uri(url);
354
359
  if (uri.scheme() === "") {
355
- uri = new Uri(url).absoluteTo(pageUri);
360
+ uri = uri.absoluteTo(pageUri);
356
361
  uri.normalize();
357
362
  }
358
363