Skip to content

Commit

Permalink
Merge pull request #4157 from AndreyOrlov/issue4131-kml-corridor-clam…
Browse files Browse the repository at this point in the history
…p-to-ground-error

fix issue #4131
  • Loading branch information
Tom Fili authored Aug 2, 2016
2 parents 950eee4 + 0abc4f8 commit 70be258
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Change Log

### 1.25 - 2016-09-01

* Fixed an issue causing error if KML has a clamped to ground LineString with color. [#4131](https://github.com/AnalyticalGraphicsInc/cesium/issues/4131)
* Camera flights now disable collision with the terrain until all of the terrain in the area has finished loading. This prevents the camera from being moved to be above lower resolution terrain when flying to a position close to higher resolution terrain. [#4075](https://github.com/AnalyticalGraphicsInc/cesium/issues/4075)

### 1.24 - 2016-08-01
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
* [Erik Andersson](https://github.com/e-andersson)
* [Simulation Curriculum](http://www.simulationcurriculum.com/)
* [Dave Whipps](https://github.com/dwhipps)
* [Geoscan](https://www.geoscan.aero)
* [Andrey Orlov](https://github.com/AndreyOrlov)

## [Individual CLA](http://www.agi.com/licenses/individual-cla-agi-v1.0.txt)
* [Victor Berchet](https://github.com/vicb)
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/KmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -1150,7 +1150,7 @@ define([
entity.corridor = corridor;
corridor.positions = coordinates;
if (defined(polyline)) {
corridor.material = defined(polyline.material) ? polyline.material.color : Color.WHITE;
corridor.material = defined(polyline.material) ? polyline.material.color.getValue(Iso8601.MINIMUM_VALUE) : Color.WHITE;
corridor.width = defaultValue(polyline.width, 1.0);
} else {
corridor.material = Color.WHITE;
Expand Down
24 changes: 24 additions & 0 deletions Specs/DataSources/KmlDataSourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3827,4 +3827,28 @@ defineSuite([
expect(entity.polygon.height.getValue()).toEqual(0);
});
});

it('when a LineString is clamped to ground and tesselated, entity has a corridor geometry and ColorProperty', function() {
var kml = '<?xml version="1.0" encoding="UTF-8"?>\
<Placemark>\
<Style>\
<LineStyle>\
<color>FFFF0000</color>\
</LineStyle>\
</Style>\
<LineString>\
<altitudeMode>clampToGround</altitudeMode>\
<tessellate>true</tessellate>\
<coordinates>1,2,3\
4,5,6\
</coordinates>\
</LineString>\
</Placemark>';
var clampToGroundOptions = Object.assign({ clampToGround : true }, options);
return KmlDataSource.load(parser.parseFromString(kml, "text/xml"), clampToGroundOptions).then(function(dataSource) {
var entity = dataSource.entities.values[0];
expect(entity.corridor).toBeDefined();
expect(entity.corridor.material).toBeInstanceOf(ColorMaterialProperty);
});
});
});

0 comments on commit 70be258

Please sign in to comment.