Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polyline entity updates with correct ellipsoid #3174

Merged
merged 2 commits into from
Nov 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Change Log
* Entities have a reference to their entity collection.
* Entity collections have a reference to their owner (usually a data source, but can be a `CompositeEntityCollection`).
* `GeoJsonDataSource.load` now takes an optional `describeProperty` function for generating feature description properties. [#3140](https://github.com/AnalyticalGraphicsInc/cesium/pull/3140)
* Fixed a bug which caused `Entity` polyline graphics to be incorrect when a scene's ellipsoid was not WGS84. [#3174](https://github.com/AnalyticalGraphicsInc/cesium/pull/3174)

### 1.15 - 2015-11-02

Expand Down
13 changes: 8 additions & 5 deletions Source/DataSources/PolylineGeometryUpdater.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,13 @@ define([
/**
* @private
*/
var generateCartesianArcOptions = {
positions : undefined,
granularity : undefined,
height : undefined,
ellipsoid : undefined
};

var DynamicGeometryUpdater = function(primitives, geometryUpdater) {
var sceneId = geometryUpdater._scene.id;

Expand All @@ -446,12 +453,8 @@ define([
this._primitives = primitives;
this._geometryUpdater = geometryUpdater;
this._positions = [];
};

var generateCartesianArcOptions = {
positions : undefined,
granularity : undefined,
height : undefined
generateCartesianArcOptions.ellipsoid = geometryUpdater._scene.globe.ellipsoid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scene.globe is not guaranteed to exist, generally we prefer scene.mapProjection.ellipsoid for this kind of thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emackey, can you submit a separate issue for this. A quick search for scene.globe. shows that there are quite a few places we are access a property on globe without checking. For the specific case of scene.globe.ellipsoid, we should probably add an ES5 getter for scene.ellipsoid so that this mistake is harder to make.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, thanks.

};

DynamicGeometryUpdater.prototype.update = function(time) {
Expand Down