@cesium/engine 2.2.0 → 2.4.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 (139) hide show
  1. package/Build/Workers/{AttributeCompression-8a5a065e.js → AttributeCompression-f9f6c717.js} +1 -1
  2. package/Build/Workers/{AxisAlignedBoundingBox-379015ef.js → AxisAlignedBoundingBox-4bfd84f3.js} +1 -1
  3. package/Build/Workers/{BoundingRectangle-57f2b24f.js → BoundingRectangle-5fd6403a.js} +1 -1
  4. package/Build/Workers/{BoxGeometry-ecabfc78.js → BoxGeometry-af7d05ef.js} +1 -1
  5. package/Build/Workers/{Color-14d1a36d.js → Color-e5bfda3f.js} +1 -1
  6. package/Build/Workers/{CoplanarPolygonGeometryLibrary-048c3c14.js → CoplanarPolygonGeometryLibrary-59c69b0a.js} +1 -1
  7. package/Build/Workers/{CorridorGeometryLibrary-520c8619.js → CorridorGeometryLibrary-63907365.js} +1 -1
  8. package/Build/Workers/{CylinderGeometry-119068b8.js → CylinderGeometry-dbaa1678.js} +1 -1
  9. package/Build/Workers/{CylinderGeometryLibrary-135b0858.js → CylinderGeometryLibrary-7bf291b4.js} +1 -1
  10. package/Build/Workers/{EllipseGeometry-2dfc3523.js → EllipseGeometry-6508b78b.js} +1 -1
  11. package/Build/Workers/{EllipseGeometryLibrary-0a1e0170.js → EllipseGeometryLibrary-21262a28.js} +1 -1
  12. package/Build/Workers/{EllipseOutlineGeometry-c5251669.js → EllipseOutlineGeometry-2a2510bb.js} +1 -1
  13. package/Build/Workers/{EllipsoidGeodesic-dcff5cbd.js → EllipsoidGeodesic-5b3623dc.js} +1 -1
  14. package/Build/Workers/{EllipsoidGeometry-d10a5221.js → EllipsoidGeometry-8155e3a2.js} +1 -1
  15. package/Build/Workers/{EllipsoidOutlineGeometry-7039a0ae.js → EllipsoidOutlineGeometry-c045678d.js} +1 -1
  16. package/Build/Workers/{EllipsoidRhumbLine-b672d507.js → EllipsoidRhumbLine-ef872433.js} +1 -1
  17. package/Build/Workers/{EllipsoidTangentPlane-857186be.js → EllipsoidTangentPlane-546c0d5e.js} +1 -1
  18. package/Build/Workers/{EncodedCartesian3-e8bbca36.js → EncodedCartesian3-57415c8a.js} +1 -1
  19. package/Build/Workers/{FrustumGeometry-400fa1b7.js → FrustumGeometry-d3ff16d0.js} +31 -3
  20. package/Build/Workers/{GeometryAttribute-7a2de5c6.js → GeometryAttribute-13da9466.js} +1 -1
  21. package/Build/Workers/{GeometryInstance-3fb607b7.js → GeometryInstance-34d9e21e.js} +1 -1
  22. package/Build/Workers/{GeometryPipeline-916636fa.js → GeometryPipeline-03bc5709.js} +1 -1
  23. package/Build/Workers/{IndexDatatype-b8f3e09d.js → IndexDatatype-2643aa47.js} +1 -1
  24. package/Build/Workers/{IntersectionTests-b4d02d4d.js → IntersectionTests-85350792.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-96fe1752.js → OrientedBoundingBox-29fb0fcd.js} +1 -1
  29. package/Build/Workers/{Plane-c27e1ac6.js → Plane-4c3d403b.js} +1 -1
  30. package/Build/Workers/{PolygonGeometryLibrary-931f1ec6.js → PolygonGeometryLibrary-d447448d.js} +1 -1
  31. package/Build/Workers/PolygonPipeline-460cce4e.js +1344 -0
  32. package/Build/Workers/{PolylinePipeline-6d5c63e5.js → PolylinePipeline-7119eb3f.js} +1 -1
  33. package/Build/Workers/{PolylineVolumeGeometryLibrary-f068c1fb.js → PolylineVolumeGeometryLibrary-d25f0050.js} +1 -1
  34. package/Build/Workers/{PrimitivePipeline-879f996a.js → PrimitivePipeline-e648752b.js} +1 -1
  35. package/Build/Workers/{RectangleGeometryLibrary-2d6f36f3.js → RectangleGeometryLibrary-bb378fb6.js} +1 -1
  36. package/Build/Workers/{TerrainEncoding-82882059.js → TerrainEncoding-c8e029a2.js} +1 -1
  37. package/Build/Workers/Transforms-e2d4a55a.js +14713 -0
  38. package/Build/Workers/{WallGeometryLibrary-db7a64fb.js → WallGeometryLibrary-3e0819ec.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 +1 -1
  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/BingMapsGeocoderService.js +19 -1
  89. package/Source/Core/CartographicGeocoderService.js +15 -0
  90. package/Source/Core/Credit.js +1 -1
  91. package/Source/Core/FrustumGeometry.js +3 -2
  92. package/Source/Core/GeocoderService.js +32 -1
  93. package/Source/Core/GoogleMaps.js +56 -0
  94. package/Source/Core/Ion.js +2 -1
  95. package/Source/Core/IonGeocoderService.js +17 -2
  96. package/Source/Core/OpenCageGeocoderService.js +18 -1
  97. package/Source/Core/OrthographicFrustum.js +13 -0
  98. package/Source/Core/PeliasGeocoderService.js +14 -1
  99. package/Source/Core/PerspectiveFrustum.js +14 -0
  100. package/Source/Core/Request.js +3 -2
  101. package/Source/Core/RequestScheduler.js +10 -4
  102. package/Source/Core/Resource.js +240 -233
  103. package/Source/DataSources/DataSourceDisplay.js +2 -2
  104. package/Source/DataSources/EntityCluster.js +126 -128
  105. package/Source/DataSources/ModelVisualizer.js +5 -3
  106. package/Source/Renderer/UniformState.js +3 -2
  107. package/Source/Renderer/demodernizeShader.js +5 -5
  108. package/Source/Scene/ArcGisBaseMapType.js +12 -0
  109. package/Source/Scene/ArcGisMapServerImageryProvider.js +162 -20
  110. package/Source/Scene/ArcGisMapService.js +84 -0
  111. package/Source/Scene/Camera.js +8 -7
  112. package/Source/Scene/Cesium3DTile.js +4 -3
  113. package/Source/Scene/Cesium3DTileset.js +6 -5
  114. package/Source/Scene/CreditDisplay.js +112 -16
  115. package/Source/Scene/GlobeSurfaceTileProvider.js +4 -4
  116. package/Source/Scene/GltfJsonLoader.js +12 -0
  117. package/Source/Scene/GltfLoader.js +6 -37
  118. package/Source/Scene/IonImageryProvider.js +11 -11
  119. package/Source/Scene/Model/MaterialPipelineStage.js +12 -12
  120. package/Source/Scene/Model/Model.js +90 -47
  121. package/Source/Scene/Model/UniformType.js +1 -1
  122. package/Source/Scene/Picking.js +3 -2
  123. package/Source/Scene/QuadtreePrimitive.js +3 -2
  124. package/Source/Scene/SceneTransforms.js +3 -2
  125. package/Source/Scene/ScreenSpaceCameraController.js +140 -32
  126. package/Source/Scene/Vector3DTilePoints.js +25 -13
  127. package/Source/Scene/createGooglePhotorealistic3DTileset.js +53 -0
  128. package/Source/Shaders/AtmosphereCommon.glsl +51 -8
  129. package/Source/Shaders/AtmosphereCommon.js +51 -8
  130. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +1 -1
  131. package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +1 -1
  132. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +3 -3
  133. package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +3 -3
  134. package/Source/Widget/CesiumWidget.js +12 -0
  135. package/index.d.ts +244 -17
  136. package/index.js +14 -10
  137. package/package.json +4 -4
  138. package/Build/Workers/PolygonPipeline-32fc92cc.js +0 -1345
  139. package/Build/Workers/Transforms-9052372a.js +0 -14715
package/index.d.ts CHANGED
@@ -887,6 +887,11 @@ export class BingMapsGeocoderService {
887
887
  * The key for the Bing geocoder service
888
888
  */
889
889
  readonly key: string;
890
+ /**
891
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
892
+ * the geocoder service.
893
+ */
894
+ readonly credit: Credit | undefined;
890
895
  /**
891
896
  * @param query - The query to be sent to the geocoder service
892
897
  */
@@ -2716,6 +2721,11 @@ export class Cartographic {
2716
2721
  */
2717
2722
  export class CartographicGeocoderService {
2718
2723
  constructor();
2724
+ /**
2725
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
2726
+ * the geocoder service.
2727
+ */
2728
+ readonly credit: Credit | undefined;
2719
2729
  /**
2720
2730
  * @param query - The query to be sent to the geocoder service
2721
2731
  */
@@ -4818,7 +4828,7 @@ export class CorridorOutlineGeometry {
4818
4828
  /**
4819
4829
  * A credit contains data pertaining to how to display attributions/credits for certain content on the screen.
4820
4830
  * @example
4821
- * //Create a credit with a tooltip, image and link
4831
+ * // Create a credit with a tooltip, image and link
4822
4832
  * const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
4823
4833
  * @param html - An string representing an html code snippet
4824
4834
  * @param [showOnScreen = false] - If true, the credit will be visible in the main credit container. Otherwise, it will appear in a popover
@@ -6595,6 +6605,7 @@ export namespace GeocoderService {
6595
6605
  type Result = {
6596
6606
  displayName: string;
6597
6607
  destination: Rectangle | Cartesian3;
6608
+ attributions?: object[];
6598
6609
  };
6599
6610
  }
6600
6611
 
@@ -6604,6 +6615,17 @@ export namespace GeocoderService {
6604
6615
  */
6605
6616
  export class GeocoderService {
6606
6617
  constructor();
6618
+ /**
6619
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
6620
+ * the geocoder service.
6621
+ */
6622
+ readonly credit: Credit | undefined;
6623
+ /**
6624
+ * Parses credits from the geocoder result attributions, if present.
6625
+ * @param geocoderResult - The geocoder result
6626
+ * @returns A list of credits if present in the result, otherwise undefined
6627
+ */
6628
+ static getCreditsFromResult(geocoderResult: GeocoderService.Result): Credit[] | undefined;
6607
6629
  /**
6608
6630
  * @param query - The query to be sent to the geocoder service
6609
6631
  * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
@@ -7591,6 +7613,24 @@ export class GoogleEarthEnterpriseTerrainProvider {
7591
7613
  loadTileDataAvailability(x: number, y: number, level: number): undefined;
7592
7614
  }
7593
7615
 
7616
+ /**
7617
+ * Default settings for accessing the Google Maps API.
7618
+ * <br/>
7619
+ * An API key is only required if you are using any Google Maps APIs, such as {@link createGooglePhotorealistic3DTileset}.
7620
+ * A default key is provided for evaluation purposes only.
7621
+ * Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}
7622
+ */
7623
+ export namespace GoogleMaps {
7624
+ /**
7625
+ * Gets or sets the default Google Maps API key.
7626
+ */
7627
+ var defaultApiKey: string;
7628
+ /**
7629
+ * Gets or sets the default Google Map Tiles API endpoint.
7630
+ */
7631
+ var mapTilesApiEndpoint: string | Resource;
7632
+ }
7633
+
7594
7634
  /**
7595
7635
  * Represents a Gregorian date in a more precise format than the JavaScript Date object.
7596
7636
  * In addition to submillisecond precision, this object can also represent leap seconds.
@@ -8545,6 +8585,11 @@ export class IonGeocoderService {
8545
8585
  accessToken?: string;
8546
8586
  server?: string | Resource;
8547
8587
  });
8588
+ /**
8589
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
8590
+ * the geocoder service.
8591
+ */
8592
+ readonly credit: Credit | undefined;
8548
8593
  /**
8549
8594
  * @param query - The query to be sent to the geocoder service
8550
8595
  * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
@@ -11591,6 +11636,11 @@ export class OpenCageGeocoderService {
11591
11636
  * Optional params passed to OpenCage in order to customize geocoding
11592
11637
  */
11593
11638
  readonly params: any;
11639
+ /**
11640
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
11641
+ * the geocoder service.
11642
+ */
11643
+ readonly credit: Credit | undefined;
11594
11644
  /**
11595
11645
  * @param query - The query to be sent to the geocoder service
11596
11646
  */
@@ -12113,6 +12163,11 @@ export class PeliasGeocoderService {
12113
12163
  * The Resource used to access the Pelias endpoint.
12114
12164
  */
12115
12165
  readonly url: Resource;
12166
+ /**
12167
+ * Gets the credit to display after a geocode is performed. Typically this is used to credit
12168
+ * the geocoder service.
12169
+ */
12170
+ readonly credit: Credit | undefined;
12116
12171
  /**
12117
12172
  * @param query - The query to be sent to the geocoder service
12118
12173
  * @param [type = GeocodeType.SEARCH] - The type of geocode to perform.
@@ -14398,6 +14453,7 @@ export enum ReferenceFrame {
14398
14453
  * @param [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.
14399
14454
  * @param [options.throttleByServer = false] - Whether to throttle the request by server.
14400
14455
  * @param [options.type = RequestType.OTHER] - The type of request.
14456
+ * @param [options.serverKey] - A key used to identify the server that a request is going to.
14401
14457
  */
14402
14458
  export class Request {
14403
14459
  constructor(options?: {
@@ -14409,6 +14465,7 @@ export class Request {
14409
14465
  throttle?: boolean;
14410
14466
  throttleByServer?: boolean;
14411
14467
  type?: RequestType;
14468
+ serverKey?: string;
14412
14469
  });
14413
14470
  /**
14414
14471
  * The URL to request.
@@ -14524,11 +14581,14 @@ export namespace RequestScheduler {
14524
14581
  */
14525
14582
  var maximumRequestsPerServer: number;
14526
14583
  /**
14527
- * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>
14584
+ * A per server key list of overrides to use for throttling instead of <code>maximumRequestsPerServer</code>.
14585
+ * Useful when streaming data from a known HTTP/2 or HTTP/3 server.
14586
+ * @example
14587
+ * RequestScheduler.requestsByServer["myserver.com:443"] = 18;
14528
14588
  * @example
14529
14589
  * RequestScheduler.requestsByServer = {
14530
- * 'api.cesium.com:443': 18,
14531
- * 'assets.cesium.com:443': 18
14590
+ * "api.cesium.com:443": 18,
14591
+ * "assets.cesium.com:443": 18,
14532
14592
  * };
14533
14593
  */
14534
14594
  var requestsByServer: any;
@@ -14601,6 +14661,7 @@ export namespace Resource {
14601
14661
  * @property [retryCallback] - The Function to call when a request for this resource fails. If it returns true, the request will be retried.
14602
14662
  * @property [retryAttempts = 0] - The number of times the retryCallback should be called before giving up.
14603
14663
  * @property [request] - A Request object that will be used. Intended for internal use only.
14664
+ * @property [parseUrl = true] - If true, parse the url for query parameters; otherwise store the url without change
14604
14665
  */
14605
14666
  type ConstructorOptions = {
14606
14667
  url: string;
@@ -14611,6 +14672,7 @@ export namespace Resource {
14611
14672
  retryCallback?: Resource.RetryCallback;
14612
14673
  retryAttempts?: number;
14613
14674
  request?: Request;
14675
+ parseUrl?: boolean;
14614
14676
  };
14615
14677
  /**
14616
14678
  * A function that returns the value of the property.
@@ -25284,6 +25346,15 @@ export class Appearance {
25284
25346
  getRenderState(): any;
25285
25347
  }
25286
25348
 
25349
+ /**
25350
+ * ArcGisBaseMapType enumerates the ArcGIS image tile layers that are supported by default.
25351
+ */
25352
+ export enum ArcGisBaseMapType {
25353
+ SATELLITE = 1,
25354
+ OCEANS = 2,
25355
+ HILLSHADE = 3
25356
+ }
25357
+
25287
25358
  export namespace ArcGisMapServerImageryProvider {
25288
25359
  /**
25289
25360
  * Initialization options for the ArcGisMapServerImageryProvider constructor
@@ -25301,8 +25372,7 @@ export namespace ArcGisMapServerImageryProvider {
25301
25372
  * that no tiles are discarded, construct and pass a {@link NeverTileDiscardPolicy} for this
25302
25373
  * parameter.
25303
25374
  * @property [usePreCachedTilesIfAvailable = true] - If true, the server's pre-cached
25304
- * tiles are used if they are available. If false, any pre-cached tiles are ignored and the
25305
- * 'export' service is used.
25375
+ * tiles are used if they are available. Exporting Tiles is only supported with deprecated APIs.
25306
25376
  * @property [layers] - A comma-separated list of the layers to show, or undefined if all layers should be shown.
25307
25377
  * @property [enablePickFeatures = true] - If true, {@link ArcGisMapServerImageryProvider#pickFeatures} will invoke
25308
25378
  * the Identify service on the MapServer and return the features included in the response. If false,
@@ -25341,15 +25411,35 @@ export namespace ArcGisMapServerImageryProvider {
25341
25411
 
25342
25412
  /**
25343
25413
  * <div class="notice">
25344
- * To construct a ArcGisMapServerImageryProvider call {@link ArcGisMapServerImageryProvider.fromUrl}. Do not call the constructor directly.
25414
+ * This object is normally not instantiated directly, use {@link ArcGisMapServerImageryProvider.fromBasemapType} or {@link ArcGisMapServerImageryProvider.fromUrl}.
25345
25415
  * </div>
25346
25416
  *
25347
25417
  * Provides tiled imagery hosted by an ArcGIS MapServer. By default, the server's pre-cached tiles are
25348
25418
  * used, if available.
25419
+ *
25420
+ * <br/>
25421
+ *
25422
+ * An {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security| ArcGIS Access Token } is required to authenticate requests to an ArcGIS Image Tile service.
25423
+ * To access secure ArcGIS resources, it's required to create an ArcGIS developer
25424
+ * account or an ArcGIS online account, then implement an authentication method to obtain an access token.
25349
25425
  * @example
25426
+ * // Set the default access token for accessing ArcGIS Image Tile service
25427
+ * Cesium.ArcGisMapService.defaultAccessToken = "<ArcGIS Access Token>";
25428
+ *
25429
+ * // Add a base layer from a default ArcGIS basemap
25430
+ * const viewer = new Cesium.Viewer("cesiumContainer", {
25431
+ * baseLayer: Cesium.ImageryLayer.fromProviderAsync(
25432
+ * Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
25433
+ * Cesium.ArcGisBaseMapType.SATELLITE
25434
+ * )
25435
+ * ),
25436
+ * });
25437
+ * @example
25438
+ * // Create an imagery provider from the url directly
25350
25439
  * const esri = await Cesium.ArcGisMapServerImageryProvider.fromUrl(
25351
- * "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
25352
- * );
25440
+ * "https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer", {
25441
+ * token: "<ArcGIS Access Token>"
25442
+ * });
25353
25443
  * @param [options] - Object describing initialization options
25354
25444
  */
25355
25445
  export class ArcGisMapServerImageryProvider {
@@ -25361,6 +25451,31 @@ export class ArcGisMapServerImageryProvider {
25361
25451
  * without communicating with the server.
25362
25452
  */
25363
25453
  enablePickFeatures: boolean;
25454
+ /**
25455
+ * Creates an {@link ImageryProvider} which provides tiled imagery from an ArcGIS base map.
25456
+ * @example
25457
+ * // Set the default access token for accessing ArcGIS Image Tile service
25458
+ * Cesium.ArcGisMapService.defaultAccessToken = "<ArcGIS Access Token>";
25459
+ *
25460
+ * // Add a base layer from a default ArcGIS basemap
25461
+ * const provider = await Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
25462
+ * Cesium.ArcGisBaseMapType.SATELLITE);
25463
+ * @example
25464
+ * // Add a base layer from a default ArcGIS Basemap
25465
+ * const viewer = new Cesium.Viewer("cesiumContainer", {
25466
+ * baseLayer: Cesium.ImageryLayer.fromProviderAsync(
25467
+ * Cesium.ArcGisMapServerImageryProvider.fromBasemapType(
25468
+ * Cesium.ArcGisBaseMapType.HILLSHADE, {
25469
+ * token: "<ArcGIS Access Token>"
25470
+ * }
25471
+ * )
25472
+ * ),
25473
+ * });
25474
+ * @param style - The style of the ArcGIS base map imagery. Valid options are {@link ArcGisBaseMapType.SATELLITE}, {@link ArcGisBaseMapType.OCEANS}, and {@link ArcGisBaseMapType.HILLSHADE}.
25475
+ * @param [options] - Object describing initialization options.
25476
+ * @returns A promise that resolves to the created ArcGisMapServerImageryProvider.
25477
+ */
25478
+ static fromBasemapType(style: ArcGisBaseMapType, options?: ArcGisMapServerImageryProvider.ConstructorOptions): Promise<ArcGisMapServerImageryProvider>;
25364
25479
  /**
25365
25480
  * Gets the URL of the ArcGIS MapServer.
25366
25481
  */
@@ -25531,6 +25646,34 @@ export class ArcGisMapServerImageryProvider {
25531
25646
  pickFeatures(x: number, y: number, level: number, longitude: number, latitude: number): Promise<ImageryLayerFeatureInfo[]> | undefined;
25532
25647
  }
25533
25648
 
25649
+ /**
25650
+ * Default options for accessing the ArcGIS image tile service.
25651
+ *
25652
+ * An ArcGIS access token is required to access ArcGIS image tile layers.
25653
+ * A default token is provided for evaluation purposes only.
25654
+ * To obtain an access token, go to {@link https://developers.arcgis.com} and create a free account.
25655
+ * More info can be found in the {@link https://developers.arcgis.com/documentation/mapping-apis-and-services/security/ | ArcGIS developer guide}.
25656
+ */
25657
+ export namespace ArcGisMapService {
25658
+ /**
25659
+ * Gets or sets the default ArcGIS access token.
25660
+ */
25661
+ var defaultAccessToken: string;
25662
+ /**
25663
+ * Gets or sets the URL of the ArcGIS World Imagery tile service.
25664
+ */
25665
+ var defaultWorldImageryServer: string | Resource;
25666
+ /**
25667
+ * Gets or sets the URL of the ArcGIS World Hillshade tile service.
25668
+ */
25669
+ var defaultWorldHillshadeServer: string | Resource;
25670
+ /**
25671
+ * Gets or sets the URL of the ArcGIS World Oceans tile service.
25672
+ */
25673
+ var defaultWorldOceanServer: string | Resource;
25674
+ function getDefaultTokenCredit(providedKey: string): string | undefined;
25675
+ }
25676
+
25534
25677
  /**
25535
25678
  * An enum describing the x, y, and z axes and helper conversion functions.
25536
25679
  */
@@ -28808,7 +28951,7 @@ export namespace Cesium3DTileset {
28808
28951
  * try {
28809
28952
  * const tileset = await Cesium.Cesium3DTileset.fromUrl(
28810
28953
  * "http://localhost:8002/tilesets/Seattle/tileset.json"
28811
- * });
28954
+ * );
28812
28955
  * scene.primitives.add(tileset);
28813
28956
  * } catch (error) {
28814
28957
  * console.error(`Error creating tileset: ${error}`);
@@ -29526,7 +29669,7 @@ export class Cesium3DTileset {
29526
29669
  * try {
29527
29670
  * const tileset = await Cesium.Cesium3DTileset.fromUrl(
29528
29671
  * "http://localhost:8002/tilesets/Seattle/tileset.json"
29529
- * });
29672
+ * );
29530
29673
  * scene.primitives.add(tileset);
29531
29674
  * } catch (error) {
29532
29675
  * console.error(`Error creating tileset: ${error}`);
@@ -29555,9 +29698,9 @@ export class Cesium3DTileset {
29555
29698
  * });
29556
29699
  * scene.primitives.add(tileset);
29557
29700
  * @param url - The url to a tileset JSON file.
29558
- * @param options - An object describing initialization options
29701
+ * @param [options] - An object describing initialization options
29559
29702
  */
29560
- static fromUrl(url: Resource | string, options: Cesium3DTileset.ConstructorOptions): Promise<Cesium3DTileset>;
29703
+ static fromUrl(url: Resource | string, options?: Cesium3DTileset.ConstructorOptions): Promise<Cesium3DTileset>;
29561
29704
  /**
29562
29705
  * Provides a hook to override the method used to request the tileset json
29563
29706
  * useful when fetching tilesets from remote servers
@@ -30272,7 +30415,13 @@ export class ConeEmitter {
30272
30415
  /**
30273
30416
  * The credit display is responsible for displaying credits on screen.
30274
30417
  * @example
30275
- * const creditDisplay = new Cesium.CreditDisplay(creditContainer);
30418
+ * // Add a credit with a tooltip, image and link to display onscreen
30419
+ * const credit = new Cesium.Credit(`<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>`, true);
30420
+ * viewer.creditDisplay.addStaticCredit(credit);
30421
+ * @example
30422
+ * // Add a credit with a plaintext link to display in the lightbox
30423
+ * const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
30424
+ * viewer.creditDisplay.addStaticCredit(credit);
30276
30425
  * @param container - The HTML element where credits will be displayed
30277
30426
  * @param [delimiter = ' • '] - The string to separate text credits
30278
30427
  * @param [viewport = document.body] - The HTML element that will contain the credits popup
@@ -30285,16 +30434,41 @@ export class CreditDisplay {
30285
30434
  container: HTMLElement;
30286
30435
  /**
30287
30436
  * Adds a credit to the list of current credits to be displayed in the credit container
30437
+ * for the next frame
30288
30438
  * @param credit - The credit to display
30289
30439
  */
30290
30440
  addCredit(credit: Credit): void;
30441
+ /**
30442
+ * Adds a {@link Credit} that will show on screen or in the lightbox until
30443
+ * the next frame. This is mostly for internal use. Use {@link CreditDisplay.addStaticCredit} to add a persistent credit to the screen.
30444
+ * @param credit - The credit to display in the next frame.
30445
+ */
30446
+ addCreditToNextFrame(credit: Credit): void;
30291
30447
  /**
30292
30448
  * Adds credits that will persist until they are removed
30293
30449
  * @param credit - The credit to added to defaults
30294
30450
  */
30295
30451
  addDefaultCredit(credit: Credit): void;
30296
30452
  /**
30297
- * Removes a default credit
30453
+ * Adds a {@link Credit} that will show on screen or in the lightbox until removed with {@link CreditDisplay.removeStaticCredit}.
30454
+ * @example
30455
+ * // Add a credit with a tooltip, image and link to display onscreen
30456
+ * const credit = new Cesium.Credit(`<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>`, true);
30457
+ * viewer.creditDisplay.addStaticCredit(credit);
30458
+ * @example
30459
+ * // Add a credit with a plaintext link to display in the lightbox
30460
+ * const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank">Cesium</a>');
30461
+ * viewer.creditDisplay.addStaticCredit(credit);
30462
+ * @param credit - The credit to added
30463
+ */
30464
+ addStaticCredit(credit: Credit): void;
30465
+ /**
30466
+ * Removes a static credit shown on screen or in the lightbox.
30467
+ * @param credit - The credit to be removed.
30468
+ */
30469
+ removeStaticCredit(credit: Credit): void;
30470
+ /**
30471
+ * Removes a default credit.
30298
30472
  * @param credit - The credit to be removed from defaults
30299
30473
  */
30300
30474
  removeDefaultCredit(credit: Credit): void;
@@ -36581,6 +36755,27 @@ export class Model {
36581
36755
  * } catch (error) {
36582
36756
  * console.log(`Failed to load model. ${error}`);
36583
36757
  * }
36758
+ * @example
36759
+ * // Load a model and play the last animation at half speed
36760
+ * let animations;
36761
+ * try {
36762
+ * const model = await Cesium.Model.fromGltfAsync({
36763
+ * url: "../../SampleData/models/CesiumMan/Cesium_Man.glb",
36764
+ * gltfCallback: gltf => {
36765
+ * animations = gltf.animations
36766
+ * }
36767
+ * });
36768
+ * viewer.scene.primitives.add(model);
36769
+ * model.readyEvent.addEventListener(() => {
36770
+ * model.activeAnimations.add({
36771
+ * index: animations.length - 1,
36772
+ * loop: Cesium.ModelAnimationLoop.REPEAT,
36773
+ * multiplier: 0.5,
36774
+ * });
36775
+ * });
36776
+ * } catch (error) {
36777
+ * console.log(`Failed to load model. ${error}`);
36778
+ * }
36584
36779
  * @param options - Object with the following properties:
36585
36780
  * @param options.url - The url to the .gltf or .glb file.
36586
36781
  * @param [options.basePath = ''] - The base path that paths in the glTF JSON are relative to.
@@ -36628,6 +36823,7 @@ export class Model {
36628
36823
  * @param [options.instanceFeatureIdLabel = "instanceFeatureId_0"] - Label of the instance feature ID set used for picking and styling. If instanceFeatureIdLabel is set to an integer N, it is converted to the string "instanceFeatureId_N" automatically. If both per-primitive and per-instance feature IDs are present, the instance feature IDs take priority.
36629
36824
  * @param [options.pointCloudShading] - Options for constructing a {@link PointCloudShading} object to control point attenuation and lighting.
36630
36825
  * @param [options.classificationType] - Determines whether terrain, 3D Tiles or both will be classified by this model. This cannot be set after the model has loaded.
36826
+ * @param [options.gltfCallback] - A function that is called with the loaded gltf object once loaded.
36631
36827
  * @returns A promise that resolves to the created model when it is ready to render.
36632
36828
  */
36633
36829
  static fromGltfAsync(options: {
@@ -36677,9 +36873,18 @@ export class Model {
36677
36873
  instanceFeatureIdLabel?: string | number;
36678
36874
  pointCloudShading?: any;
36679
36875
  classificationType?: ClassificationType;
36876
+ gltfCallback?: Model.GltfCallback;
36680
36877
  }): Promise<Model>;
36681
36878
  }
36682
36879
 
36880
+ export namespace Model {
36881
+ /**
36882
+ * Interface for the function that is called with the loaded gltf object once loaded.
36883
+ * @param gltf - The gltf object
36884
+ */
36885
+ type GltfCallback = (gltf: any) => void;
36886
+ }
36887
+
36683
36888
  /**
36684
36889
  * <div class="notice">
36685
36890
  * Create animations by calling {@link ModelAnimationCollection#add}. Do not call the constructor directly.
@@ -37230,7 +37435,7 @@ export enum UniformType {
37230
37435
  /**
37231
37436
  * A 3x3 matrix of floating point values.
37232
37437
  */
37233
- MAT3 = "mat2",
37438
+ MAT3 = "mat3",
37234
37439
  /**
37235
37440
  * A 3x3 matrix of floating point values.
37236
37441
  */
@@ -40522,7 +40727,7 @@ export class ScreenSpaceCameraController {
40522
40727
  */
40523
40728
  lookEventTypes: CameraEventType | any[] | undefined;
40524
40729
  /**
40525
- * The minimum height the camera must be before picking the terrain instead of the ellipsoid.
40730
+ * The minimum height the camera must be before picking the terrain or scene content instead of the ellipsoid.
40526
40731
  */
40527
40732
  minimumPickingTerrainHeight: number;
40528
40733
  /**
@@ -43057,6 +43262,24 @@ export function createElevationBandMaterial(options: {
43057
43262
  layers: createElevationBandMaterialBand[];
43058
43263
  }): Material;
43059
43264
 
43265
+ /**
43266
+ * Creates a {@link Cesium3DTileset} instance for the Google Photorealistic 3D Tiles tileset.
43267
+ * @example
43268
+ * Cesium.GoogleMaps.defaultApiKey = "your-api-key";
43269
+ *
43270
+ * const viewer = new Cesium.Viewer("cesiumContainer");
43271
+ *
43272
+ * try {
43273
+ * const tileset = await Cesium.createGooglePhotorealistic3DTileset();
43274
+ * viewer.scene.primitives.add(tileset));
43275
+ * } catch (error) {
43276
+ * console.log(`Error creating tileset: ${error}`);
43277
+ * }
43278
+ * @param [key = GoogleMaps.defaultApiKey] - Your API key to access Google Photorealistic 3D Tiles. See {@link https://developers.google.com/maps/documentation/javascript/get-api-key} for instructions on how to create your own key.
43279
+ * @param [options] - An object describing initialization options.
43280
+ */
43281
+ export function createGooglePhotorealistic3DTileset(key?: string, options?: Cesium3DTileset.ConstructorOptions): Promise<Cesium3DTileset>;
43282
+
43060
43283
  /**
43061
43284
  * Creates a {@link Cesium3DTileset} instance for the
43062
43285
  * {@link https://cesium.com/content/cesium-osm-buildings/|Cesium OSM Buildings}
@@ -43332,6 +43555,10 @@ export class CesiumWidget {
43332
43555
  * The terrain provider providing surface geometry for the globe.
43333
43556
  */
43334
43557
  terrainProvider: TerrainProvider;
43558
+ /**
43559
+ * Manages the list of credits to display on screen and in the lightbox.
43560
+ */
43561
+ creditDisplay: CreditDisplay;
43335
43562
  /**
43336
43563
  * Gets the camera.
43337
43564
  */
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- globalThis.CESIUM_VERSION = "1.104";
1
+ globalThis.CESIUM_VERSION = "1.105.1";
2
2
  export { default as AutomaticUniforms } from './Source/Renderer/AutomaticUniforms.js';
3
3
  export { default as Buffer } from './Source/Renderer/Buffer.js';
4
4
  export { default as BufferUsage } from './Source/Renderer/BufferUsage.js';
@@ -287,6 +287,7 @@ export { default as GoogleEarthEnterpriseMetadata } from './Source/Core/GoogleEa
287
287
  export { default as GoogleEarthEnterpriseTerrainData } from './Source/Core/GoogleEarthEnterpriseTerrainData.js';
288
288
  export { default as GoogleEarthEnterpriseTerrainProvider } from './Source/Core/GoogleEarthEnterpriseTerrainProvider.js';
289
289
  export { default as GoogleEarthEnterpriseTileInformation } from './Source/Core/GoogleEarthEnterpriseTileInformation.js';
290
+ export { default as GoogleMaps } from './Source/Core/GoogleMaps.js';
290
291
  export { default as GregorianDate } from './Source/Core/GregorianDate.js';
291
292
  export { default as GroundPolylineGeometry } from './Source/Core/GroundPolylineGeometry.js';
292
293
  export { default as HeadingPitchRange } from './Source/Core/HeadingPitchRange.js';
@@ -474,7 +475,9 @@ export { default as wrapFunction } from './Source/Core/wrapFunction.js';
474
475
  export { default as writeTextToCanvas } from './Source/Core/writeTextToCanvas.js';
475
476
  export { default as AlphaMode } from './Source/Scene/AlphaMode.js';
476
477
  export { default as Appearance } from './Source/Scene/Appearance.js';
478
+ export { default as ArcGisBaseMapType } from './Source/Scene/ArcGisBaseMapType.js';
477
479
  export { default as ArcGisMapServerImageryProvider } from './Source/Scene/ArcGisMapServerImageryProvider.js';
480
+ export { default as ArcGisMapService } from './Source/Scene/ArcGisMapService.js';
478
481
  export { default as AttributeType } from './Source/Scene/AttributeType.js';
479
482
  export { default as AutoExposure } from './Source/Scene/AutoExposure.js';
480
483
  export { default as Axis } from './Source/Scene/Axis.js';
@@ -778,6 +781,7 @@ export { default as buildVoxelDrawCommands } from './Source/Scene/buildVoxelDraw
778
781
  export { default as computeFlyToLocationForRectangle } from './Source/Scene/computeFlyToLocationForRectangle.js';
779
782
  export { default as createBillboardPointCallback } from './Source/Scene/createBillboardPointCallback.js';
780
783
  export { default as createElevationBandMaterial } from './Source/Scene/createElevationBandMaterial.js';
784
+ export { default as createGooglePhotorealistic3DTileset } from './Source/Scene/createGooglePhotorealistic3DTileset.js';
781
785
  export { default as createOsmBuildings } from './Source/Scene/createOsmBuildings.js';
782
786
  export { default as createOsmBuildingsAsync } from './Source/Scene/createOsmBuildingsAsync.js';
783
787
  export { default as createTangentSpaceDebugPrimitive } from './Source/Scene/createTangentSpaceDebugPrimitive.js';
@@ -1027,6 +1031,15 @@ export { default as _shaderssolarRadius } from './Source/Shaders/Builtin/Constan
1027
1031
  export { default as _shadersthreePiOver2 } from './Source/Shaders/Builtin/Constants/threePiOver2.js';
1028
1032
  export { default as _shaderstwoPi } from './Source/Shaders/Builtin/Constants/twoPi.js';
1029
1033
  export { default as _shaderswebMercatorMaxLatitude } from './Source/Shaders/Builtin/Constants/webMercatorMaxLatitude.js';
1034
+ export { default as _shadersdepthRangeStruct } from './Source/Shaders/Builtin/Structs/depthRangeStruct.js';
1035
+ export { default as _shadersmaterial } from './Source/Shaders/Builtin/Structs/material.js';
1036
+ export { default as _shadersmaterialInput } from './Source/Shaders/Builtin/Structs/materialInput.js';
1037
+ export { default as _shadersmodelMaterial } from './Source/Shaders/Builtin/Structs/modelMaterial.js';
1038
+ export { default as _shadersmodelVertexOutput } from './Source/Shaders/Builtin/Structs/modelVertexOutput.js';
1039
+ export { default as _shaderspbrParameters } from './Source/Shaders/Builtin/Structs/pbrParameters.js';
1040
+ export { default as _shadersray } from './Source/Shaders/Builtin/Structs/ray.js';
1041
+ export { default as _shadersraySegment } from './Source/Shaders/Builtin/Structs/raySegment.js';
1042
+ export { default as _shadersshadowParameters } from './Source/Shaders/Builtin/Structs/shadowParameters.js';
1030
1043
  export { default as _shadersHSBToRGB } from './Source/Shaders/Builtin/Functions/HSBToRGB.js';
1031
1044
  export { default as _shadersHSLToRGB } from './Source/Shaders/Builtin/Functions/HSLToRGB.js';
1032
1045
  export { default as _shadersRGBToHSB } from './Source/Shaders/Builtin/Functions/RGBToHSB.js';
@@ -1111,13 +1124,4 @@ export { default as _shaderswindowToEyeCoordinates } from './Source/Shaders/Buil
1111
1124
  export { default as _shaderswriteDepthClamp } from './Source/Shaders/Builtin/Functions/writeDepthClamp.js';
1112
1125
  export { default as _shaderswriteLogDepth } from './Source/Shaders/Builtin/Functions/writeLogDepth.js';
1113
1126
  export { default as _shaderswriteNonPerspective } from './Source/Shaders/Builtin/Functions/writeNonPerspective.js';
1114
- export { default as _shadersdepthRangeStruct } from './Source/Shaders/Builtin/Structs/depthRangeStruct.js';
1115
- export { default as _shadersmaterial } from './Source/Shaders/Builtin/Structs/material.js';
1116
- export { default as _shadersmaterialInput } from './Source/Shaders/Builtin/Structs/materialInput.js';
1117
- export { default as _shadersmodelMaterial } from './Source/Shaders/Builtin/Structs/modelMaterial.js';
1118
- export { default as _shadersmodelVertexOutput } from './Source/Shaders/Builtin/Structs/modelVertexOutput.js';
1119
- export { default as _shaderspbrParameters } from './Source/Shaders/Builtin/Structs/pbrParameters.js';
1120
- export { default as _shadersray } from './Source/Shaders/Builtin/Structs/ray.js';
1121
- export { default as _shadersraySegment } from './Source/Shaders/Builtin/Structs/raySegment.js';
1122
- export { default as _shadersshadowParameters } from './Source/Shaders/Builtin/Structs/shadowParameters.js';
1123
1127
  export { default as createTaskProcessorWorker } from './Source/WorkersES6/createTaskProcessorWorker.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cesium/engine",
3
- "version": "2.2.0",
3
+ "version": "2.4.0",
4
4
  "description": "CesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin.",
5
5
  "keywords": [
6
6
  "3D",
@@ -36,12 +36,12 @@
36
36
  "@zip.js/zip.js": "2.4.x",
37
37
  "autolinker": "^4.0.0",
38
38
  "bitmap-sdf": "^1.0.3",
39
- "dompurify": "^2.2.2",
39
+ "dompurify": "^3.0.2",
40
40
  "earcut": "^2.2.4",
41
41
  "grapheme-splitter": "^1.0.4",
42
42
  "jsep": "^1.3.8",
43
- "kdbush": "^3.0.0",
44
- "ktx-parse": "^0.4.5",
43
+ "kdbush": "^4.0.1",
44
+ "ktx-parse": "^0.5.0",
45
45
  "lerc": "^2.0.0",
46
46
  "mersenne-twister": "^1.1.0",
47
47
  "meshoptimizer": "^0.18.1",