Skip to content

Commit

Permalink
Merge pull request #8191 from AnalyticalGraphicsInc/dynamic-rhumb
Browse files Browse the repository at this point in the history
Make dynamic polyline create the given arcType
  • Loading branch information
Hannah authored Sep 20, 2019
2 parents 5180481 + e5dbde0 commit 58624ba
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Change Log
* Fixed per-feature post processing from sometimes selecting the wrong feature. [#7929](https://github.com/AnalyticalGraphicsInc/cesium/pull/7929)
* Fixed labels not showing for individual entities in data sources when clustering is enabled. [#6087](https://github.com/AnalyticalGraphicsInc/cesium/issues/6087)
* Fixed a crash for 3D Tiles that have zero volume. [#7945](https://github.com/AnalyticalGraphicsInc/cesium/pull/7945)
* Fixed a bug where dynamic polylines did not use the given arcType. [#8191](https://github.com/AnalyticalGraphicsInc/cesium/issues/8191)

### 1.61 - 2019-09-03

Expand Down
6 changes: 5 additions & 1 deletion Source/DataSources/PolylineGeometryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,11 @@ define([
generateCartesianArcOptions.positions = positions;
generateCartesianArcOptions.granularity = Property.getValueOrUndefined(polyline._granularity, time);
generateCartesianArcOptions.height = PolylinePipeline.extractHeights(positions, globe.ellipsoid);
positions = PolylinePipeline.generateCartesianArc(generateCartesianArcOptions);
if (arcType === ArcType.GEODESIC) {
positions = PolylinePipeline.generateCartesianArc(generateCartesianArcOptions);
} else {
positions = PolylinePipeline.generateCartesianRhumbArc(generateCartesianArcOptions);
}
}

line.show = true;
Expand Down
17 changes: 17 additions & 0 deletions Specs/DataSources/PolylineGeometryUpdaterSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,23 @@ describe('DataSources/PolylineGeometryUpdater', function() {
expect(scene.groundPrimitives.length).toBe(0);
});

it('calls generateCartesianRhumbArc for RHUMB arcType', function() {
var entity = createBasicPolyline();
entity.polyline.width = createDynamicProperty(1);
entity.polyline.arcType = ArcType.RHUMB;

var updater = new PolylineGeometryUpdater(entity, scene);
var dynamicUpdater = updater.createDynamicUpdater(scene.primitives, scene.groundPrimitives);
spyOn(PolylinePipeline, 'generateCartesianRhumbArc').and.callThrough();
dynamicUpdater.update(time);
expect(PolylinePipeline.generateCartesianRhumbArc).toHaveBeenCalled();
dynamicUpdater.destroy();
updater.destroy();

expect(scene.primitives.length).toBe(0);
expect(scene.groundPrimitives.length).toBe(0);
});

it('arcType GEODESIC with undefined globe does not call generateCartesianArc', function() {
if (!Entity.supportsPolylinesOnTerrain(scene)) {
return;
Expand Down

0 comments on commit 58624ba

Please sign in to comment.