@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.
- package/Build/Workers/{AttributeCompression-8a5a065e.js → AttributeCompression-f9f6c717.js} +1 -1
- package/Build/Workers/{AxisAlignedBoundingBox-379015ef.js → AxisAlignedBoundingBox-4bfd84f3.js} +1 -1
- package/Build/Workers/{BoundingRectangle-57f2b24f.js → BoundingRectangle-5fd6403a.js} +1 -1
- package/Build/Workers/{BoxGeometry-ecabfc78.js → BoxGeometry-af7d05ef.js} +1 -1
- package/Build/Workers/{Color-14d1a36d.js → Color-e5bfda3f.js} +1 -1
- package/Build/Workers/{CoplanarPolygonGeometryLibrary-048c3c14.js → CoplanarPolygonGeometryLibrary-59c69b0a.js} +1 -1
- package/Build/Workers/{CorridorGeometryLibrary-520c8619.js → CorridorGeometryLibrary-63907365.js} +1 -1
- package/Build/Workers/{CylinderGeometry-119068b8.js → CylinderGeometry-dbaa1678.js} +1 -1
- package/Build/Workers/{CylinderGeometryLibrary-135b0858.js → CylinderGeometryLibrary-7bf291b4.js} +1 -1
- package/Build/Workers/{EllipseGeometry-2dfc3523.js → EllipseGeometry-6508b78b.js} +1 -1
- package/Build/Workers/{EllipseGeometryLibrary-0a1e0170.js → EllipseGeometryLibrary-21262a28.js} +1 -1
- package/Build/Workers/{EllipseOutlineGeometry-c5251669.js → EllipseOutlineGeometry-2a2510bb.js} +1 -1
- package/Build/Workers/{EllipsoidGeodesic-dcff5cbd.js → EllipsoidGeodesic-5b3623dc.js} +1 -1
- package/Build/Workers/{EllipsoidGeometry-d10a5221.js → EllipsoidGeometry-8155e3a2.js} +1 -1
- package/Build/Workers/{EllipsoidOutlineGeometry-7039a0ae.js → EllipsoidOutlineGeometry-c045678d.js} +1 -1
- package/Build/Workers/{EllipsoidRhumbLine-b672d507.js → EllipsoidRhumbLine-ef872433.js} +1 -1
- package/Build/Workers/{EllipsoidTangentPlane-857186be.js → EllipsoidTangentPlane-546c0d5e.js} +1 -1
- package/Build/Workers/{EncodedCartesian3-e8bbca36.js → EncodedCartesian3-57415c8a.js} +1 -1
- package/Build/Workers/{FrustumGeometry-400fa1b7.js → FrustumGeometry-d3ff16d0.js} +31 -3
- package/Build/Workers/{GeometryAttribute-7a2de5c6.js → GeometryAttribute-13da9466.js} +1 -1
- package/Build/Workers/{GeometryInstance-3fb607b7.js → GeometryInstance-34d9e21e.js} +1 -1
- package/Build/Workers/{GeometryPipeline-916636fa.js → GeometryPipeline-03bc5709.js} +1 -1
- package/Build/Workers/{IndexDatatype-b8f3e09d.js → IndexDatatype-2643aa47.js} +1 -1
- package/Build/Workers/{IntersectionTests-b4d02d4d.js → IntersectionTests-85350792.js} +1 -1
- package/Build/Workers/{Math-dad82b4d.js → Math-0a2ac845.js} +12 -2
- package/Build/Workers/{Matrix2-1e403d0e.js → Matrix2-e1298525.js} +1 -1
- package/Build/Workers/{Matrix3-fa806b97.js → Matrix3-41c58dde.js} +1 -1
- package/Build/Workers/{OrientedBoundingBox-96fe1752.js → OrientedBoundingBox-29fb0fcd.js} +1 -1
- package/Build/Workers/{Plane-c27e1ac6.js → Plane-4c3d403b.js} +1 -1
- package/Build/Workers/{PolygonGeometryLibrary-931f1ec6.js → PolygonGeometryLibrary-d447448d.js} +1 -1
- package/Build/Workers/PolygonPipeline-460cce4e.js +1344 -0
- package/Build/Workers/{PolylinePipeline-6d5c63e5.js → PolylinePipeline-7119eb3f.js} +1 -1
- package/Build/Workers/{PolylineVolumeGeometryLibrary-f068c1fb.js → PolylineVolumeGeometryLibrary-d25f0050.js} +1 -1
- package/Build/Workers/{PrimitivePipeline-879f996a.js → PrimitivePipeline-e648752b.js} +1 -1
- package/Build/Workers/{RectangleGeometryLibrary-2d6f36f3.js → RectangleGeometryLibrary-bb378fb6.js} +1 -1
- package/Build/Workers/{TerrainEncoding-82882059.js → TerrainEncoding-c8e029a2.js} +1 -1
- package/Build/Workers/Transforms-e2d4a55a.js +14713 -0
- package/Build/Workers/{WallGeometryLibrary-db7a64fb.js → WallGeometryLibrary-3e0819ec.js} +1 -1
- package/Build/Workers/{WebMercatorProjection-76a3fcc0.js → WebMercatorProjection-13ed1a6e.js} +1 -1
- package/Build/Workers/{arrayRemoveDuplicates-fac118a8.js → arrayRemoveDuplicates-d2061e85.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/createVectorTileClampedPolylines.js +1 -1
- package/Build/Workers/createVectorTileGeometries.js +1 -1
- package/Build/Workers/createVectorTilePoints.js +1 -1
- package/Build/Workers/createVectorTilePolygons.js +1 -1
- package/Build/Workers/createVectorTilePolylines.js +1 -1
- package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -1
- package/Build/Workers/createVerticesFromHeightmap.js +5 -8
- package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -1
- package/Build/Workers/createWallGeometry.js +1 -1
- package/Build/Workers/createWallOutlineGeometry.js +1 -1
- package/Build/Workers/decodeDraco.js +1 -1
- package/Build/Workers/decodeI3S.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/BingMapsGeocoderService.js +19 -1
- package/Source/Core/CartographicGeocoderService.js +15 -0
- package/Source/Core/Credit.js +1 -1
- package/Source/Core/FrustumGeometry.js +3 -2
- package/Source/Core/GeocoderService.js +32 -1
- package/Source/Core/GoogleMaps.js +56 -0
- package/Source/Core/Ion.js +2 -1
- package/Source/Core/IonGeocoderService.js +17 -2
- package/Source/Core/OpenCageGeocoderService.js +18 -1
- package/Source/Core/OrthographicFrustum.js +13 -0
- package/Source/Core/PeliasGeocoderService.js +14 -1
- package/Source/Core/PerspectiveFrustum.js +14 -0
- package/Source/Core/Request.js +3 -2
- package/Source/Core/RequestScheduler.js +10 -4
- package/Source/Core/Resource.js +240 -233
- package/Source/DataSources/DataSourceDisplay.js +2 -2
- package/Source/DataSources/EntityCluster.js +126 -128
- package/Source/DataSources/ModelVisualizer.js +5 -3
- package/Source/Renderer/UniformState.js +3 -2
- package/Source/Renderer/demodernizeShader.js +5 -5
- package/Source/Scene/ArcGisBaseMapType.js +12 -0
- package/Source/Scene/ArcGisMapServerImageryProvider.js +162 -20
- package/Source/Scene/ArcGisMapService.js +84 -0
- package/Source/Scene/Camera.js +8 -7
- package/Source/Scene/Cesium3DTile.js +4 -3
- package/Source/Scene/Cesium3DTileset.js +6 -5
- package/Source/Scene/CreditDisplay.js +112 -16
- package/Source/Scene/GlobeSurfaceTileProvider.js +4 -4
- package/Source/Scene/GltfJsonLoader.js +12 -0
- package/Source/Scene/GltfLoader.js +6 -37
- package/Source/Scene/IonImageryProvider.js +11 -11
- package/Source/Scene/Model/MaterialPipelineStage.js +12 -12
- package/Source/Scene/Model/Model.js +90 -47
- package/Source/Scene/Model/UniformType.js +1 -1
- package/Source/Scene/Picking.js +3 -2
- package/Source/Scene/QuadtreePrimitive.js +3 -2
- package/Source/Scene/SceneTransforms.js +3 -2
- package/Source/Scene/ScreenSpaceCameraController.js +140 -32
- package/Source/Scene/Vector3DTilePoints.js +25 -13
- package/Source/Scene/createGooglePhotorealistic3DTileset.js +53 -0
- package/Source/Shaders/AtmosphereCommon.glsl +51 -8
- package/Source/Shaders/AtmosphereCommon.js +51 -8
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.glsl +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionGenerate.js +1 -1
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.glsl +3 -3
- package/Source/Shaders/PostProcessStages/AmbientOcclusionModulate.js +3 -3
- package/Source/Widget/CesiumWidget.js +12 -0
- package/index.d.ts +244 -17
- package/index.js +14 -10
- package/package.json +4 -4
- package/Build/Workers/PolygonPipeline-32fc92cc.js +0 -1345
- package/Build/Workers/Transforms-9052372a.js +0 -14715
package/Build/Workers/package.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define(['./AttributeCompression-
|
|
1
|
+
define(['./AttributeCompression-f9f6c717', './Transforms-e2d4a55a', './Matrix2-e1298525', './Matrix3-41c58dde', './defaultValue-fe22d8c0', './TerrainEncoding-c8e029a2', './IndexDatatype-2643aa47', './Check-6ede7e26', './Math-0a2ac845', './OrientedBoundingBox-29fb0fcd', './createTaskProcessorWorker', './ComponentDatatype-cf1fa08e', './WebGLConstants-0b1ce7ba', './combine-d9581036', './RuntimeError-ef395448', './EllipsoidTangentPlane-546c0d5e', './AxisAlignedBoundingBox-4bfd84f3', './IntersectionTests-85350792', './Plane-4c3d403b'], (function (AttributeCompression, Transforms, Matrix2, Matrix3, defaultValue, TerrainEncoding, IndexDatatype, Check, Math$1, OrientedBoundingBox, createTaskProcessorWorker, ComponentDatatype, WebGLConstants, combine, RuntimeError, EllipsoidTangentPlane, AxisAlignedBoundingBox, IntersectionTests, Plane) { 'use strict';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Contains functions for operating on 2D triangles.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Check from "./Check.js";
|
|
2
|
+
import Credit from "./Credit.js";
|
|
2
3
|
import defaultValue from "./defaultValue.js";
|
|
3
4
|
import Rectangle from "./Rectangle.js";
|
|
4
5
|
import Resource from "./Resource.js";
|
|
@@ -39,6 +40,11 @@ function BingMapsGeocoderService(options) {
|
|
|
39
40
|
url: url,
|
|
40
41
|
queryParameters: queryParameters,
|
|
41
42
|
});
|
|
43
|
+
|
|
44
|
+
this._credit = new Credit(
|
|
45
|
+
`<img src="http:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png"\/>`,
|
|
46
|
+
false
|
|
47
|
+
);
|
|
42
48
|
}
|
|
43
49
|
|
|
44
50
|
Object.defineProperties(BingMapsGeocoderService.prototype, {
|
|
@@ -65,6 +71,18 @@ Object.defineProperties(BingMapsGeocoderService.prototype, {
|
|
|
65
71
|
return this._key;
|
|
66
72
|
},
|
|
67
73
|
},
|
|
74
|
+
/**
|
|
75
|
+
* Gets the credit to display after a geocode is performed. Typically this is used to credit
|
|
76
|
+
* the geocoder service.
|
|
77
|
+
* @memberof BingMapsGeocoderService.prototype
|
|
78
|
+
* @type {Credit|undefined}
|
|
79
|
+
* @readonly
|
|
80
|
+
*/
|
|
81
|
+
credit: {
|
|
82
|
+
get: function () {
|
|
83
|
+
return this._credit;
|
|
84
|
+
},
|
|
85
|
+
},
|
|
68
86
|
});
|
|
69
87
|
|
|
70
88
|
/**
|
|
@@ -73,7 +91,7 @@ Object.defineProperties(BingMapsGeocoderService.prototype, {
|
|
|
73
91
|
* @param {string} query The query to be sent to the geocoder service
|
|
74
92
|
* @returns {Promise<GeocoderService.Result[]>}
|
|
75
93
|
*/
|
|
76
|
-
BingMapsGeocoderService.prototype.geocode = function (query) {
|
|
94
|
+
BingMapsGeocoderService.prototype.geocode = async function (query) {
|
|
77
95
|
//>>includeStart('debug', pragmas.debug);
|
|
78
96
|
Check.typeOf.string("query", query);
|
|
79
97
|
//>>includeEnd('debug');
|
|
@@ -10,6 +10,21 @@ import Check from "./Check.js";
|
|
|
10
10
|
*/
|
|
11
11
|
function CartographicGeocoderService() {}
|
|
12
12
|
|
|
13
|
+
Object.defineProperties(CartographicGeocoderService.prototype, {
|
|
14
|
+
/**
|
|
15
|
+
* Gets the credit to display after a geocode is performed. Typically this is used to credit
|
|
16
|
+
* the geocoder service.
|
|
17
|
+
* @memberof CartographicGeocoderService.prototype
|
|
18
|
+
* @type {Credit|undefined}
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
credit: {
|
|
22
|
+
get: function () {
|
|
23
|
+
return undefined;
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
13
28
|
/**
|
|
14
29
|
* @function
|
|
15
30
|
*
|
package/Source/Core/Credit.js
CHANGED
|
@@ -17,7 +17,7 @@ const creditToId = {};
|
|
|
17
17
|
* @exception {DeveloperError} html is required.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
|
-
* //Create a credit with a tooltip, image and link
|
|
20
|
+
* // Create a credit with a tooltip, image and link
|
|
21
21
|
* const credit = new Cesium.Credit('<a href="https://cesium.com/" target="_blank"><img src="/images/cesium_logo.png" title="Cesium"/></a>');
|
|
22
22
|
*/
|
|
23
23
|
function Credit(html, showOnScreen) {
|
|
@@ -327,8 +327,9 @@ FrustumGeometry._computeNearFarPlanes = function (
|
|
|
327
327
|
);
|
|
328
328
|
|
|
329
329
|
if (!defined(inverseViewProjection)) {
|
|
330
|
-
|
|
331
|
-
|
|
330
|
+
const offCenterFrustum = frustum.offCenterFrustum;
|
|
331
|
+
if (defined(offCenterFrustum)) {
|
|
332
|
+
frustum = offCenterFrustum;
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
const near = frustumSplits[i];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import Credit from "./Credit.js";
|
|
2
|
+
import defined from "./defined.js";
|
|
1
3
|
import DeveloperError from "./DeveloperError.js";
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
6
|
* @typedef {object} GeocoderService.Result
|
|
5
7
|
* @property {string} displayName The display name for a location
|
|
6
8
|
* @property {Rectangle|Cartesian3} destination The bounding box for a location
|
|
9
|
+
* @property {object[]} [attributions]
|
|
7
10
|
*/
|
|
8
11
|
|
|
9
12
|
/**
|
|
@@ -16,7 +19,35 @@ import DeveloperError from "./DeveloperError.js";
|
|
|
16
19
|
* @see PeliasGeocoderService
|
|
17
20
|
* @see OpenCageGeocoderService
|
|
18
21
|
*/
|
|
19
|
-
function GeocoderService() {
|
|
22
|
+
function GeocoderService() {
|
|
23
|
+
DeveloperError.throwInstantiationError();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
Object.defineProperties(GeocoderService.prototype, {
|
|
27
|
+
/**
|
|
28
|
+
* Gets the credit to display after a geocode is performed. Typically this is used to credit
|
|
29
|
+
* the geocoder service.
|
|
30
|
+
* @memberof GeocoderService.prototype
|
|
31
|
+
* @type {Credit|undefined}
|
|
32
|
+
* @readonly
|
|
33
|
+
*/
|
|
34
|
+
credit: {
|
|
35
|
+
get: DeveloperError.throwInstantiationError,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Parses credits from the geocoder result attributions, if present.
|
|
41
|
+
* @param {GeocoderService.Result} geocoderResult The geocoder result
|
|
42
|
+
* @returns {Credit[]|undefined} A list of credits if present in the result, otherwise undefined
|
|
43
|
+
*/
|
|
44
|
+
GeocoderService.getCreditsFromResult = function (geocoderResult) {
|
|
45
|
+
if (defined(geocoderResult.attributions)) {
|
|
46
|
+
return geocoderResult.attributions.map(Credit.getIonCredit);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return undefined;
|
|
50
|
+
};
|
|
20
51
|
|
|
21
52
|
/**
|
|
22
53
|
* @function
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import Credit from "./Credit.js";
|
|
2
|
+
import defined from "./defined.js";
|
|
3
|
+
import Resource from "./Resource.js";
|
|
4
|
+
|
|
5
|
+
let defaultKeyCredit;
|
|
6
|
+
const defaultKey = "AIzaSyBESBYnp1EcqtlAcjMTJ65GjUsJtaCWVXA";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Default settings for accessing the Google Maps API.
|
|
10
|
+
* <br/>
|
|
11
|
+
* An API key is only required if you are using any Google Maps APIs, such as {@link createGooglePhotorealistic3DTileset}.
|
|
12
|
+
* A default key is provided for evaluation purposes only.
|
|
13
|
+
* Follow instructions for managing API keys for the Google Maps Platform at {@link https://developers.google.com/maps/documentation/embed/get-api-key}
|
|
14
|
+
*
|
|
15
|
+
* @see createGooglePhotorealistic3DTileset
|
|
16
|
+
* @see https://developers.google.com/maps/documentation/embed/get-api-key
|
|
17
|
+
*
|
|
18
|
+
* @namespace GoogleMaps
|
|
19
|
+
*/
|
|
20
|
+
const GoogleMaps = {};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Gets or sets the default Google Maps API key.
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
*/
|
|
27
|
+
GoogleMaps.defaultApiKey = defaultKey;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Gets or sets the default Google Map Tiles API endpoint.
|
|
31
|
+
*
|
|
32
|
+
* @type {string|Resource}
|
|
33
|
+
* @default https://tile.googleapis.com/v1/
|
|
34
|
+
*/
|
|
35
|
+
GoogleMaps.mapTilesApiEndpoint = new Resource({
|
|
36
|
+
url: "https://tile.googleapis.com/v1/",
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
GoogleMaps.getDefaultApiKeyCredit = function (providedKey) {
|
|
40
|
+
if (providedKey !== defaultKey) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!defined(defaultKeyCredit)) {
|
|
45
|
+
const defaultKeyMessage =
|
|
46
|
+
'<b> \
|
|
47
|
+
This application is using CesiumJS\'s default Google Maps API key. Please assign <i>Cesium.GoogleMaps.defaultApiKey</i> \
|
|
48
|
+
with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>';
|
|
49
|
+
|
|
50
|
+
defaultKeyCredit = new Credit(defaultKeyMessage, true);
|
|
51
|
+
defaultKeyCredit._isDefaultToken = true;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return defaultKeyCredit;
|
|
55
|
+
};
|
|
56
|
+
export default GoogleMaps;
|
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.eyJqdGkiOiIwZWQ3OWFlZC1kOTg3LTRlZjctYTAyYy0xNjFmODE1MWE2NGUiLCJpZCI6MjU5LCJpYXQiOjE2ODI5NDYzODh9.DEH4GpqliH-xsDE7h-ZCICtHgnGu32wdSjt4hFqw7lU";
|
|
8
8
|
/**
|
|
9
9
|
* Default settings for accessing the Cesium ion API.
|
|
10
10
|
*
|
|
@@ -49,6 +49,7 @@ Ion.getDefaultTokenCredit = function (providedKey) {
|
|
|
49
49
|
You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>';
|
|
50
50
|
|
|
51
51
|
defaultTokenCredit = new Credit(defaultTokenMessage, true);
|
|
52
|
+
defaultTokenCredit._isDefaultToken = true;
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
return defaultTokenCredit;
|
|
@@ -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.
|
|
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;
|
|
@@ -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');
|
|
@@ -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
|
/**
|
package/Source/Core/Request.js
CHANGED
|
@@ -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 =
|
|
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 =
|
|
170
|
+
result.state = RequestState.UNISSUED;
|
|
170
171
|
result.deferred = undefined;
|
|
171
172
|
result.cancelled = false;
|
|
172
173
|
|
|
@@ -65,18 +65,24 @@ 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
|
-
*
|
|
74
|
-
*
|
|
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
83
|
"assets.ion.cesium.com:443": 18,
|
|
84
|
+
"ibasemaps-api.arcgis.com:443": 18,
|
|
85
|
+
"tile.googleapis.com:443": 18,
|
|
80
86
|
};
|
|
81
87
|
|
|
82
88
|
/**
|
|
@@ -352,7 +358,7 @@ RequestScheduler.getServerKey = function (url) {
|
|
|
352
358
|
|
|
353
359
|
let uri = new Uri(url);
|
|
354
360
|
if (uri.scheme() === "") {
|
|
355
|
-
uri =
|
|
361
|
+
uri = uri.absoluteTo(pageUri);
|
|
356
362
|
uri.normalize();
|
|
357
363
|
}
|
|
358
364
|
|