Skip to content

Commit

Permalink
Merge pull request #1 from TerriaJS/cesiumUpgrade
Browse files Browse the repository at this point in the history
Upgrade Cesium
  • Loading branch information
kring committed Apr 28, 2015
2 parents f08c5d4 + 4c8a5e0 commit 4d1a4ab
Show file tree
Hide file tree
Showing 49 changed files with 578 additions and 260 deletions.
4 changes: 4 additions & 0 deletions Apps/Sandcastle/CesiumSandcastle.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ a.linkButton:focus, a.linkButton:hover {
font-weight: bold;
background-color: #F42;
border-radius: 3px;
border: none;
}

.CodeMirror pre.errorLine {
Expand All @@ -215,6 +216,7 @@ a.linkButton:focus, a.linkButton:hover {
font-weight: bold;
background-color: #FE2;
border-radius: 3px;
border: none;
}

.CodeMirror pre.hintLine {
Expand All @@ -228,6 +230,7 @@ a.linkButton:focus, a.linkButton:hover {
font-weight: bold;
background-color: #2E2;
border-radius: 3px;
border: none;
}

.CodeMirror pre.highlightLine {
Expand All @@ -241,6 +244,7 @@ a.linkButton:focus, a.linkButton:hover {
font-weight: bold;
background-color: #CEF;
border-radius: 3px;
border: none;
}

.CodeMirror pre.searchLine {
Expand Down
37 changes: 36 additions & 1 deletion Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ require({
var searchRegExp;
var hintTimer;
var currentTab = '';
var newDemo;
var demoHtml = '';
var demoJs = '';

Expand Down Expand Up @@ -263,7 +264,16 @@ require({
function makeLineLabel(msg, className) {
var element = document.createElement('abbr');
element.className = className;
element.innerHTML = ' ';
switch (className) {
case 'hintMarker':
element.innerHTML = '▲';
break;
case 'errorMarker':
element.innerHTML = '×';
break;
default:
element.innerHTML = '▶';
}
element.title = msg;
return element;
}
Expand Down Expand Up @@ -821,6 +831,28 @@ require({
}
}

registry.byId('buttonNew').on('click', function() {
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
var confirmChange = true;
if (demoHtml !== htmlText || demoJs !== jsText) {
confirmChange = window.confirm('You have unsaved changes. Are you sure you want to navigate away from this demo?');
}
if(confirmChange){
loadFromGallery(newDemo);
var demoSrc = newDemo.name + '.html';
var queries = window.location.search.substring(1).split('&');
for(var i = 0; i < queries.length; i++){
var key = queries[i].split('=')[0];
if(key === "src"){
if (demoSrc !== queries[i].split('=')[1].replace('%20', ' ')) {
window.history.pushState(newDemo, newDemo.name, '?src=' + demoSrc + '&label=' + currentTab);
}
}
}
document.title = newDemo.name + ' - Cesium Sandcastle';
}
});
// Clicking the 'Run' button simply reloads the iframe.
registry.byId('buttonRun').on('click', function() {
CodeMirror.commands.runCesium(jsEditor);
Expand Down Expand Up @@ -1015,6 +1047,9 @@ require({
demoLink.href = 'gallery/' + encodeURIComponent(demo.name) + '.html';
tab.appendChild(demoLink);

if(demo.name === "Hello World") {
newDemo = demo;
}
demoLink.onclick = function(e) {
if (mouse.isMiddle(e)) {
window.open('gallery/' + demo.name + '.html');
Expand Down
4 changes: 4 additions & 0 deletions Apps/Sandcastle/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
<div id="appLayout" data-dojo-type="dijit.layout.BorderContainer" data-dojo-props="design: 'headline', gutters: true, liveSplitters: true">
<div id="toolbar" data-dojo-type="dijit.Toolbar" data-dojo-props="region: 'top'">
<div class="cesiumTitle"><a href="http://cesiumjs.org/" target="_blank"><img src="./images/Cesium_Logo_Color_Overlay.png" style="width: 118px"/></a></div>
<div id="buttonNew" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass: 'dijitIconFile', showLabel: true">
New
</div>
<span data-dojo-type="dijit.ToolbarSeparator"></span>
<div id="buttonRun" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass: 'dijitIconFunction', showLabel: true">
Run (F8)
</div>
Expand Down
20 changes: 19 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
Change Log
==========

### 1.8 -2015-04-01
### 1.9 - 2015-05-01
* Breaking changes
* Removed `ColorMaterialProperty.fromColor`, previously deprecated in 1.6. Pass a `Color` directly to the `ColorMaterialProperty` constructor instead.
* Removed `CompositeEntityCollection.entities` and `EntityCollection.entities`, both previously deprecated in 1.6. Use `CompositeEntityCollection.values` and `EntityCollection.values` instead.
* Removed `DataSourceDisplay.getScene` and `DataSourceDisplay.getDataSources`, both previously deprecated in 1.6. Use `DataSourceDisplay.scene` and `DataSourceDisplay.dataSources` instead.
* `Entity` no longer takes a string id as it's constructor argument. Pass an options object with `id` property instead. This was previously deprecated in 1.6.
* Removed `Model.readyToRender`, previously deprecated in 1.6. Use `Model.readyPromise` instead.
* Deprecated
*
* An exception is now thrown if `Primitive.modelMatrix` is not the identity matrix when in in 2D or Columbus View.
* Fix a bug which caused `Entity.viewFrom` to be ignored when flying to, zooming to, or tracking an Entity.
* The `InfoBox` title is now correctly updated if the name of `viewer.selectedEntity` changes on the fly. [#2644](https://github.com/AnalyticalGraphicsInc/cesium/pull/2644)
* Fixed a bug that caused `Corridor` and `PolylineVolume` geometry to be incorrect for sharp corners [#2626](https://github.com/AnalyticalGraphicsInc/cesium/pull/2626)
* Fixed crash when modifying a translucent entity geometry outline. [#2630](https://github.com/AnalyticalGraphicsInc/cesium/pull/2630)
* Fixed crash when loading KML GroundOverlays that spanned 360 degrees. [#2639](https://github.com/AnalyticalGraphicsInc/cesium/pull/2639)
* Fixed `Geocoder` styling issue in Safari. [#2658](https://github.com/AnalyticalGraphicsInc/cesium/pull/2658).
* Added number of cached shaders to the `CesiumInspector` debugging widget.

### 1.8 - 2015-04-01

* Breaking changes
* Removed the `eye`, `target`, and `up` parameters to `Camera.lookAt` which were deprecated in Cesium 1.6. Use the `target` and `offset`.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu
* [Gilles Cébélieu (IGN France)](https://github.com/gcebelieu)
* [Guillaume Beraudo](https://github.com/gberaudo)
* [Thomas Hirsch](https://github.com/relet)
* [Ayush Khandelwal](https://github.com/ayk115)
* [Aditya Raisinghani](https://github.com/adi2412)

Also see [our contributors page](http://cesiumjs.org/contributors.html) for more information.
2 changes: 1 addition & 1 deletion Source/Core/CorridorGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ define([
Cartesian3.subtract(backward, backwardProjection, backwardProjection);
Cartesian3.normalize(backwardProjection, backwardProjection);

var doCorner = !CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, CesiumMath.EPSILON1);
var doCorner = !CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, CesiumMath.EPSILON7);

if (doCorner) {
cornerDirection = Cartesian3.cross(cornerDirection, normal, cornerDirection);
Expand Down
6 changes: 2 additions & 4 deletions Source/Core/EllipseGeometry.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,8 @@ define([
* @param {Ellipsoid} [options.ellipsoid=Ellipsoid.WGS84] The ellipsoid the ellipse will be on.
* @param {Number} [options.height=0.0] The height above the ellipsoid.
* @param {Number} [options.extrudedHeight] The height of the extrusion.
* @param {Number} [options.rotation=0.0] The angle from north (clockwise) in radians.
* @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates, in radians. A positive rotation is counter-clockwise.
* @param {Number} [options.rotation=0.0] The angle of rotation counter-clockwise from north.
* @param {Number} [options.stRotation=0.0] The rotation of the texture coordinates counter-clockwise from north.
* @param {Number} [options.granularity=CesiumMath.RADIANS_PER_DEGREE] The angular distance between points on the ellipse in radians.
* @param {VertexFormat} [options.vertexFormat=VertexFormat.DEFAULT] The vertex attributes to be computed.
*
Expand All @@ -611,8 +611,6 @@ define([
*
* @see EllipseGeometry.createGeometry
*
* @demo {@link http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Ellipse.html|Cesium Sandcastle Ellipse Demo}
*
* @example
* // Create an ellipse.
* var ellipse = new Cesium.EllipseGeometry({
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/PolylineVolumeGeometryLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ define([
Cartesian3.subtract(backward, backwardProjection, backwardProjection);
Cartesian3.normalize(backwardProjection, backwardProjection);

var doCorner = !CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, CesiumMath.EPSILON1);
var doCorner = !CesiumMath.equalsEpsilon(Math.abs(Cartesian3.dot(forwardProjection, backwardProjection)), 1.0, CesiumMath.EPSILON7);

if (doCorner) {
cornerDirection = Cartesian3.cross(cornerDirection, surfaceNormal, cornerDirection);
Expand Down
20 changes: 0 additions & 20 deletions Source/DataSources/ColorMaterialProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'../Core/Color',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/DeveloperError',
'../Core/Event',
'./ConstantProperty',
Expand All @@ -13,7 +12,6 @@ define([
Color,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Event,
ConstantProperty,
Expand All @@ -36,24 +34,6 @@ define([
this.color = color;
};

/**
* Creates a new instance that represents a constant color.
*
* @param {Color} color The color.
* @returns {ColorMaterialProperty} A new instance configured to represent the provided color.
* @deprecated
*/
ColorMaterialProperty.fromColor = function(color) {
deprecationWarning('ColorMaterialProperty.fromColor', 'ColorMaterialProperty.fromColor was deprecated in Cesium 1.6. It will be removed in 1.9. Use "new ColorMaterialProperty(color)" instead.');

//>>includeStart('debug', pragmas.debug);
if (!defined(color)) {
throw new DeveloperError('color is required');
}
//>>includeEnd('debug');
return new ColorMaterialProperty(color);
};

defineProperties(ColorMaterialProperty.prototype, {
/**
* Gets a value indicating if this property is constant. A property is considered
Expand Down
16 changes: 0 additions & 16 deletions Source/DataSources/CompositeEntityCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ define([
'../Core/createGuid',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/DeveloperError',
'../Core/Math',
'./Entity',
Expand All @@ -12,7 +11,6 @@ define([
createGuid,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
CesiumMath,
Entity,
Expand Down Expand Up @@ -163,20 +161,6 @@ define([
return this._id;
}
},
/**
* Gets the array of Entity instances in the collection.
* This array should not be modified directly.
* @memberof CompositeEntityCollection.prototype
* @readonly
* @type {Entity[]}
* @deprecated
*/
entities : {
get : function() {
deprecationWarning('CompositeEntityCollection.entities', 'EntityCollection.entities has been deprecated and will be removed in Cesium 1.9, use EntityCollection.values instead');
return this._composite.values;
}
},
/**
* Gets the array of Entity instances in the collection.
* This array should not be modified directly.
Expand Down
24 changes: 0 additions & 24 deletions Source/DataSources/DataSourceDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/destroyObject',
'../Core/DeveloperError',
'../Core/EventHelper',
Expand All @@ -31,7 +30,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
destroyObject,
DeveloperError,
EventHelper,
Expand Down Expand Up @@ -96,8 +94,6 @@ define([
}

var defaultDataSource = new CustomDataSource();
var visualizers = this._visualizersCallback(this._scene, defaultDataSource);
defaultDataSource._visualizers = visualizers;
this._onDataSourceAdded(undefined, defaultDataSource);
this._defaultDataSource = defaultDataSource;
};
Expand Down Expand Up @@ -164,26 +160,6 @@ define([
}
});

/**
* Gets the scene being used for display.
* @deprecated
* @returns {Scene} The scene.
*/
DataSourceDisplay.prototype.getScene = function() {
deprecationWarning('DataSourceDisplay.getScene', 'DataSourceDisplay.getScene was deprecated on Cesium 1.5 and will be removed in Cesium 1.9, used the DataSourceDisplay.scene property instead.');
return this.scene;
};

/**
* Gets the collection of data sources to be displayed.
* @deprecated
* @returns {DataSourceCollection} The collection of data sources.
*/
DataSourceDisplay.prototype.getDataSources = function() {
deprecationWarning('DataSourceDisplay.getDataSources', 'DataSourceDisplay.getDataSources was deprecated on Cesium 1.5 and will be removed in Cesium 1.9, used the DataSourceDisplay.dataSources property instead.');
return this.dataSources;
};

/**
* Returns true if this object was destroyed; otherwise, false.
* <br /><br />
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/EllipseGraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ define([
* @param {Property} [options.outlineColor=Color.BLACK] A Property specifying the {@link Color} of the outline.
* @param {Property} [options.outlineWidth=1.0] A numeric Property specifying the width of the outline.
* @param {Property} [options.numberOfVerticalLines=16] A numeric Property specifying the number of vertical lines to draw along the perimeter for the outline.
* @param {Property} [options.rotation=0.0] A numeric property specifying the rotation of the ellipse clockwise from north.
* @param {Property} [options.rotation=0.0] A numeric property specifying the rotation of the ellipse counter-clockwise from north.
* @param {Property} [options.stRotation=0.0] A numeric property specifying the rotation of the ellipse texture counter-clockwise from north.
* @param {Property} [options.granularity=Cesium.Math.RADIANS_PER_DEGREE] A numeric Property specifying the angular distance between points on the ellipse.
*
Expand Down
8 changes: 0 additions & 8 deletions Source/DataSources/Entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ define([
'../Core/defaultValue',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/DeveloperError',
'../Core/Event',
'../Core/Matrix3',
Expand Down Expand Up @@ -37,7 +36,6 @@ define([
defaultValue,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Event,
Matrix3,
Expand Down Expand Up @@ -120,12 +118,6 @@ define([
options = defaultValue(options, defaultValue.EMPTY_OBJECT);

var id = options.id;
if (typeof options === 'string') {
deprecationWarning('Entity', 'The Entity constructor taking a string was deprecated in Cesium 1.5. It will be removed in 1.9. Use "new Entity({ id : \'id\'})" instead.');
id = options;
options = defaultValue.EMPTY_OBJECT;
}

if (!defined(id)) {
id = createGuid();
}
Expand Down
16 changes: 0 additions & 16 deletions Source/DataSources/EntityCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ define([
'../Core/createGuid',
'../Core/defined',
'../Core/defineProperties',
'../Core/deprecationWarning',
'../Core/DeveloperError',
'../Core/Event',
'../Core/Iso8601',
Expand All @@ -17,7 +16,6 @@ define([
createGuid,
defined,
defineProperties,
deprecationWarning,
DeveloperError,
Event,
Iso8601,
Expand Down Expand Up @@ -127,20 +125,6 @@ define([
return this._id;
}
},
/**
* Gets the array of Entity instances in the collection.
* This array should not be modified directly.
* @memberof EntityCollection.prototype
* @readonly
* @type {Entity[]}
* @deprecated
*/
entities : {
get : function() {
deprecationWarning('EntityCollection.entities', 'EntityCollection.entities has been deprecated and will be removed in Cesium 1.9, use EntityCollection.values instead');
return this._entities.values;
}
},
/**
* Gets the array of Entity instances in the collection.
* This array should not be modified directly.
Expand Down
Loading

0 comments on commit 4d1a4ab

Please sign in to comment.