You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: CHANGES.md
+4
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,8 @@ Change Log
9
9
10
10
##### Deprecated :hourglass_flowing_sand:
11
11
*`Scene.clampToHeight` now takes an optional `width` argument before the `result` argument. The previous function definition will no longer work in 1.56. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
12
+
*`PolylineGeometry.followSurface` has been superceded by `PolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
13
+
*`SimplePolylineGeometry.followSurface` has been superceded by `SimplePolylineGeometry.arcType`. The previous definition will no longer work in 1.57. Replace `followSurface: false` with `arcType: Cesium.ArcType.NONE` and `followSurface: true` with `arcType: Cesium.ArcType.GEODESIC`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
12
14
13
15
##### Additions :tada:
14
16
* Added support for textured ground entities (entities with unspecified `height`) and `GroundPrimitives` on 3D Tiles. [#7434](https://github.com/AnalyticalGraphicsInc/cesium/pull/7434)
@@ -17,6 +19,7 @@ Change Log
17
19
* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
18
20
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/AnalyticalGraphicsInc/cesium/pull/7361)
19
21
* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/AnalyticalGraphicsInc/cesium/pull/7484)
22
+
* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
20
23
21
24
##### Fixes :wrench:
22
25
* Fixed 3D Tiles performance regression. [#7482](https://github.com/AnalyticalGraphicsInc/cesium/pull/7482)
@@ -28,6 +31,7 @@ Change Log
28
31
* Fixed Sandcastle's "Open in New Window" button not displaying imagery due to blob URI limitations. [#7250](https://github.com/AnalyticalGraphicsInc/cesium/pull/7250)
29
32
* Fixed an issue where setting `scene.globe.cartographicLimitRectangle` to `undefined` would cause a crash. [#7477](https://github.com/AnalyticalGraphicsInc/cesium/issues/7477)
30
33
* Fixed `PrimitiveCollection.removeAll` to no longer `contain` removed primitives. [#7491](https://github.com/AnalyticalGraphicsInc/cesium/pull/7491)
34
+
* Fixed `GeoJsonDataSource` to use polygons and polylines that use rhumb lines. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
Copy file name to clipboardexpand all lines: Source/Core/GroundPolylineGeometry.js
+73-10
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
define([
2
2
'./ApproximateTerrainHeights',
3
+
'./ArcType',
3
4
'./arrayRemoveDuplicates',
4
5
'./BoundingSphere',
5
6
'./Cartesian3',
@@ -13,6 +14,7 @@ define([
13
14
'./defineProperties',
14
15
'./Ellipsoid',
15
16
'./EllipsoidGeodesic',
17
+
'./EllipsoidRhumbLine',
16
18
'./EncodedCartesian3',
17
19
'./GeographicProjection',
18
20
'./Geometry',
@@ -25,6 +27,7 @@ define([
25
27
'./WebMercatorProjection'
26
28
],function(
27
29
ApproximateTerrainHeights,
30
+
ArcType,
28
31
arrayRemoveDuplicates,
29
32
BoundingSphere,
30
33
Cartesian3,
@@ -38,6 +41,7 @@ define([
38
41
defineProperties,
39
42
Ellipsoid,
40
43
EllipsoidGeodesic,
44
+
EllipsoidRhumbLine,
41
45
EncodedCartesian3,
42
46
GeographicProjection,
43
47
Geometry,
@@ -80,6 +84,7 @@ define([
80
84
* @param {Number} [options.width=1.0] The screen space width in pixels.
81
85
* @param {Number} [options.granularity=9999.0] The distance interval in meters used for interpolating options.points. Defaults to 9999.0 meters. Zero indicates no interpolation.
82
86
* @param {Boolean} [options.loop=false] Whether during geometry creation a line segment will be added between the last and first line positions to make this Polyline a loop.
87
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
83
88
*
84
89
* @exception {DeveloperError} At least two positions are required.
85
90
*
@@ -104,6 +109,9 @@ define([
104
109
if((!defined(positions))||(positions.length<2)){
105
110
thrownewDeveloperError('At least two positions are required.');
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
499
501
* @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
500
502
* @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
503
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
636
643
* @param {Boolean} [options.closeTop=true] When false, leaves off the top of an extruded polygon open.
637
644
* @param {Boolean} [options.closeBottom=true] When false, leaves off the bottom of an extruded polygon open.
645
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
219
243
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
220
244
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
245
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link ArcType.GEODESIC} and {@link ArcType.RHUMB}.
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
427
460
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
428
461
* @param {Boolean} [options.perPositionHeight=false] Use the height of options.positions for each position instead of using options.height to determine the height.
462
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of path the outline must follow. Valid options are {@link LinkType.GEODESIC} and {@link ArcType.RHUMB}.
Copy file name to clipboardexpand all lines: Source/Core/PolygonPipeline.js
+154
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,7 @@ define([
2
2
'../ThirdParty/earcut-2.1.1',
3
3
'./Cartesian2',
4
4
'./Cartesian3',
5
+
'./Cartographic',
5
6
'./Check',
6
7
'./ComponentDatatype',
7
8
'./defaultValue',
@@ -16,6 +17,7 @@ define([
16
17
earcut,
17
18
Cartesian2,
18
19
Cartesian3,
20
+
Cartographic,
19
21
Check,
20
22
ComponentDatatype,
21
23
defaultValue,
@@ -227,6 +229,158 @@ define([
227
229
});
228
230
};
229
231
232
+
varsubdivisionC0Scratch=newCartographic();
233
+
varsubdivisionC1Scratch=newCartographic();
234
+
varsubdivisionC2Scratch=newCartographic();
235
+
varsubdivisionCart2Scratch0=newCartesian2();
236
+
varsubdivisionCart2Scratch1=newCartesian2();
237
+
varsubdivisionCart2Scratch2=newCartesian2();
238
+
varsubdivisionMidCart2Scratch=newCartesian2();
239
+
240
+
/**
241
+
* Subdivides positions on rhumb lines and raises points to the surface of the ellipsoid.
242
+
*
243
+
* @param {Ellipsoid} ellipsoid The ellipsoid the polygon in on.
244
+
* @param {Cartesian3[]} positions An array of {@link Cartesian3} positions of the polygon.
245
+
* @param {Number[]} indices An array of indices that determines the triangles in the polygon.
246
+
* @param {Number} [granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
247
+
*
248
+
* @exception {DeveloperError} At least three indices are required.
249
+
* @exception {DeveloperError} The number of indices must be divisable by three.
250
+
* @exception {DeveloperError} Granularity must be greater than zero.
Copy file name to clipboardexpand all lines: Source/Core/PolylineGeometry.js
+51-21
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,13 @@
1
1
define([
2
+
'./ArcType',
2
3
'./arrayRemoveDuplicates',
3
4
'./BoundingSphere',
4
5
'./Cartesian3',
5
6
'./Color',
6
7
'./ComponentDatatype',
7
8
'./defaultValue',
8
9
'./defined',
10
+
'./deprecationWarning',
9
11
'./DeveloperError',
10
12
'./Ellipsoid',
11
13
'./Geometry',
@@ -18,13 +20,15 @@ define([
18
20
'./PrimitiveType',
19
21
'./VertexFormat'
20
22
],function(
23
+
ArcType,
21
24
arrayRemoveDuplicates,
22
25
BoundingSphere,
23
26
Cartesian3,
24
27
Color,
25
28
ComponentDatatype,
26
29
defaultValue,
27
30
defined,
31
+
deprecationWarning,
28
32
DeveloperError,
29
33
Ellipsoid,
30
34
Geometry,
@@ -87,8 +91,8 @@ define([
87
91
* @param {Number} [options.width=1.0] The width in pixels.
88
92
* @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.
89
93
* @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
90
-
* @param {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc.
91
-
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer.
94
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
95
+
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
92
96
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
93
97
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
deprecationWarning('PolylineGeometry.followSurface','PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead.');
* Breaks a {@link Polyline} into segments such that it does not cross the ±180 degree meridian of an ellipsoid.
124
167
*
@@ -287,6 +330,97 @@ define([
287
330
returnnewPositions;
288
331
};
289
332
333
+
varscratchCartographic0=newCartographic();
334
+
varscratchCartographic1=newCartographic();
335
+
336
+
/**
337
+
* Subdivides polyline and raises all points to the specified height using Rhumb lines. Returns an array of numbers to represent the positions.
338
+
* @param {Object} options Object with the following properties:
339
+
* @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
340
+
* @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
341
+
* @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
342
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
343
+
* @returns {Number[]} A new array of positions of type {Number} that have been subdivided and raised to the surface of the ellipsoid.
344
+
*
345
+
* @example
346
+
* var positions = Cesium.Cartesian3.fromDegreesArray([
347
+
* -105.0, 40.0,
348
+
* -100.0, 38.0,
349
+
* -105.0, 35.0,
350
+
* -100.0, 32.0
351
+
* ]);
352
+
* var surfacePositions = Cesium.PolylinePipeline.generateRhumbArc({
* Subdivides polyline and raises all points to the specified height. Returns an array of new {Cartesian3} positions.
292
426
* @param {Object} options Object with the following properties:
@@ -317,5 +451,35 @@ define([
317
451
returnnewPositions;
318
452
};
319
453
454
+
/**
455
+
* Subdivides polyline and raises all points to the specified height using Rhumb Lines. Returns an array of new {Cartesian3} positions.
456
+
* @param {Object} options Object with the following properties:
457
+
* @param {Cartesian3[]} options.positions The array of type {Cartesian3} representing positions.
458
+
* @param {Number|Number[]} [options.height=0.0] A number or array of numbers representing the heights of each position.
459
+
* @param {Number} [options.granularity = CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude. Determines the number of positions in the buffer.
460
+
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid on which the positions lie.
461
+
* @returns {Cartesian3[]} A new array of cartesian3 positions that have been subdivided and raised to the surface of the ellipsoid.
462
+
*
463
+
* @example
464
+
* var positions = Cesium.Cartesian3.fromDegreesArray([
465
+
* -105.0, 40.0,
466
+
* -100.0, 38.0,
467
+
* -105.0, 35.0,
468
+
* -100.0, 32.0
469
+
* ]);
470
+
* var surfacePositions = Cesium.PolylinePipeline.generateCartesianRhumbArc({
Copy file name to clipboardexpand all lines: Source/Core/SimplePolylineGeometry.js
+44-13
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
define([
2
+
'./ArcType',
2
3
'./BoundingSphere',
3
4
'./Cartesian3',
4
5
'./Color',
5
6
'./ComponentDatatype',
6
7
'./defaultValue',
7
8
'./defined',
9
+
'./deprecationWarning',
8
10
'./DeveloperError',
9
11
'./Ellipsoid',
10
12
'./Geometry',
@@ -15,12 +17,14 @@ define([
15
17
'./PolylinePipeline',
16
18
'./PrimitiveType'
17
19
],function(
20
+
ArcType,
18
21
BoundingSphere,
19
22
Cartesian3,
20
23
Color,
21
24
ComponentDatatype,
22
25
defaultValue,
23
26
defined,
27
+
deprecationWarning,
24
28
DeveloperError,
25
29
Ellipsoid,
26
30
Geometry,
@@ -83,8 +87,8 @@ define([
83
87
* @param {Cartesian3[]} options.positions An array of {@link Cartesian3} defining the positions in the polyline as a line strip.
84
88
* @param {Color[]} [options.colors] An Array of {@link Color} defining the per vertex or per segment colors.
85
89
* @param {Boolean} [options.colorsPerVertex=false] A boolean that determines whether the colors will be flat across each segment of the line or interpolated across the vertices.
86
-
* @param {Boolean} [options.followSurface=true] A boolean that determines whether positions will be adjusted to the surface of the ellipsoid via a great arc.
87
-
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.followSurface=true. Determines the number of positions in the buffer.
90
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
91
+
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The distance, in radians, between each latitude and longitude if options.arcType is not ArcType.NONE. Determines the number of positions in the buffer.
88
92
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid to be used as a reference.
89
93
*
90
94
* @exception {DeveloperError} At least two positions are required.
deprecationWarning('PolylineGeometry.followSurface','PolylineGeometry.followSurface is deprecated and will be removed in Cesium 1.55. Use PolylineGeometry.arcType instead.');
Copy file name to clipboardexpand all lines: Source/DataSources/PolygonGraphics.js
+13
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,7 @@ define([
44
44
* @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the polygon casts or receives shadows from each light source.
45
45
* @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this polygon will be displayed.
46
46
* @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this polygon will classify terrain, 3D Tiles, or both when on the ground.
47
+
* @param {Property} [options.arcType=ArcType.GEODESIC] The type of line the polygon edges must follow.
47
48
* @param {ConstantProperty} [options.zIndex=0] A property specifying the zIndex used for ordering ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.
* Gets or sets the {@link ArcType} Property specifying the type of lines the polygon edges use.
268
+
* @memberof PolygonGraphics.prototype
269
+
* @type {Property}
270
+
* @default ArcType.GEODESIC
271
+
*/
272
+
arcType : createPropertyDescriptor('arcType'),
273
+
263
274
/**
264
275
* Gets or sets the zIndex Prperty specifying the ordering of ground geometry. Only has an effect if the polygon is constant and neither height or extrudedHeight are specified.
Copy file name to clipboardexpand all lines: Source/DataSources/PolylineGraphics.js
+19-3
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
define([
2
+
'../Core/ArcType',
2
3
'../Core/defaultValue',
3
4
'../Core/defined',
4
5
'../Core/defineProperties',
@@ -7,6 +8,7 @@ define([
7
8
'./createMaterialPropertyDescriptor',
8
9
'./createPropertyDescriptor'
9
10
],function(
11
+
ArcType,
10
12
defaultValue,
11
13
defined,
12
14
defineProperties,
@@ -26,13 +28,13 @@ define([
26
28
*
27
29
* @param {Object} [options] Object with the following properties:
28
30
* @param {Property} [options.positions] A Property specifying the array of {@link Cartesian3} positions that define the line strip.
29
-
* @param {Property} [options.followSurface=true] A boolean Property specifying whether the line segments should be great arcs or linearly connected.
31
+
* @param {ArcType} [options.arcType=ArcType.GEODESIC] The type of line the polyline segments must follow.
30
32
* @param {Property} [options.clampToGround=false] A boolean Property specifying whether the Polyline should be clamped to the ground.
31
33
* @param {Property} [options.width=1.0] A numeric Property specifying the width in pixels.
32
34
* @param {Property} [options.show=true] A boolean Property specifying the visibility of the polyline.
33
35
* @param {MaterialProperty} [options.material=Color.WHITE] A Property specifying the material used to draw the polyline.
34
36
* @param {MaterialProperty} [options.depthFailMaterial] A property specifying the material used to draw the polyline when it is below the terrain.
35
-
* @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if followSurface is true.
37
+
* @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE.
36
38
* @param {Property} [options.shadows=ShadowMode.DISABLED] An enum Property specifying whether the polyline casts or receives shadows from each light source.
37
39
* @param {Property} [options.distanceDisplayCondition] A Property specifying at what distance from the camera that this polyline will be displayed.
38
40
* @param {Property} [options.classificationType=ClassificationType.BOTH] An enum Property specifying whether this polyline will classify terrain, 3D Tiles, or both when on the ground.
@@ -52,6 +54,8 @@ define([
52
54
this._positionsSubscription=undefined;
53
55
this._followSurface=undefined;
54
56
this._followSurfaceSubscription=undefined;
57
+
this._arcType=undefined;
58
+
this._arcTypeSubscription=undefined;
55
59
this._clampToGround=undefined;
56
60
this._clampToGroundSubscription=undefined;
57
61
this._granularity=undefined;
@@ -136,10 +140,20 @@ define([
136
140
* should be great arcs or linearly connected.
137
141
* @memberof PolylineGraphics.prototype
138
142
* @type {Property}
143
+
* @deprecated This property has been deprecated. Use {@link PolylineGraphics#arcType} instead.
* Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if followSurface is true and clampToGround is false.
167
+
* Gets or sets the numeric Property specifying the angular distance between each latitude and longitude if arcType is not ArcType.NONE and clampToGround is false.
0 commit comments