Skip to content

Commit

Permalink
Merge branch 'master' into entity-terrain
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Fili committed Apr 20, 2016
2 parents 10881bd + 07a6e67 commit 3d6f1d8
Show file tree
Hide file tree
Showing 94 changed files with 2,605 additions and 3,120 deletions.
5 changes: 4 additions & 1 deletion .idea/runConfigurations/Run_tests.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions .travis.yml
Expand Up @@ -6,6 +6,11 @@ before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
script:
- echo 'deployPending' && echo -en 'travis_fold:start:script.deployPending\\r'
- npm run deploy-set-version -- --version $TRAVIS_BRANCH.$TRAVIS_BUILD_NUMBER
- npm run deploy-status -- --status pending --message 'Waiting for build'
- echo -en 'travis_fold:end:script.deployPending\\r'

- echo 'jsHint' && echo -en 'travis_fold:start:script.jsHint\\r'
- npm run jsHint -- --failTaskOnError
- echo -en 'travis_fold:end:script.jsHint\\r'
Expand All @@ -17,14 +22,18 @@ script:
- echo 'makeZipFile' && echo -en 'travis_fold:start:script.makeZipFile\\r'
- npm run clean
- npm run makeZipFile
- npm pack
- echo -en 'travis_fold:end:script.makeZipFile\\r'

- echo 'deploy' && echo -en 'travis_fold:start:script.deploy\\r'
- npm run deploy-s3 -- -b cesium-dev -d cesium/$TRAVIS_BRANCH --confirm -c 'no-cache'
- npm run deploy-status -- --status success --message Deployed
- echo -en 'travis_fold:end:script.deploy\\r'

- echo 'test non-webgl release' && echo -en 'travis_fold:start:script test.release\\r'
- npm run test -- --exclude WebGL --browsers Electron --failTaskOnError --release --suppressPassed
- echo -en 'travis_fold:end:script test.release\\r'

- echo 'cloc' && echo -en 'travis_fold:start:script.cloc\\r'
- npm run cloc
- echo -en 'travis_fold:end:script.cloc\\r'
after_success:
- npm run deploy-s3 -- -b cesium-dev -d cesium/$TRAVIS_BRANCH --confirm -c 'no-cache'
14 changes: 14 additions & 0 deletions Apps/Sandcastle/CesiumSandcastle.css
Expand Up @@ -254,3 +254,17 @@ a.linkButton:focus, a.linkButton:hover {
.CodeMirror-gutter-text {
cursor: default;
}

.gitHubIcon {
background-image: url('./images/gitHub16px.png');
width: 16px;
height: 16px;
text-align: center;
}

.shareIcon {
background-image: url('./images/share16px.png');
width: 16px;
height: 16px;
text-align: center;
}
122 changes: 109 additions & 13 deletions Apps/Sandcastle/CesiumSandcastle.js
Expand Up @@ -38,19 +38,21 @@ require({
'dojo/query',
'dojo/when',
'Sandcastle/LinkButton',
"dijit/Dialog",
"dijit/form/Form",
"dijit/form/Textarea",
"dijit/form/Button",
'Source/Cesium',
'CodeMirror/addon/hint/show-hint',
'CodeMirror/addon/hint/javascript-hint',
'CodeMirror/mode/javascript/javascript',
'CodeMirror/mode/css/css',
'CodeMirror/mode/xml/xml',
'CodeMirror/mode/htmlmixed/htmlmixed',
'dijit/form/Button',
'dijit/form/DropDownButton',
'dijit/form/ToggleButton',
'dijit/form/DropDownButton',
'dijit/form/TextBox',
'dijit/form/Textarea',
'dijit/Menu',
'dijit/MenuBar',
'dijit/PopupMenuBarItem',
Expand Down Expand Up @@ -79,6 +81,10 @@ require({
query,
when,
LinkButton,
Dialog,
Form,
TextArea,
Button,
Cesium) {
'use strict';

Expand Down Expand Up @@ -159,6 +165,10 @@ require({
var newDemo;
var demoHtml = '';
var demoJs = '';
var previousCode = '';
var runGist = false;
var gistCode;
var sandcastleUrl = '';

var galleryErrorMsg = document.createElement('span');
galleryErrorMsg.className = 'galleryError';
Expand Down Expand Up @@ -667,11 +677,33 @@ require({
}
}

var queryObject = {};
var gistId = ioQuery.queryToObject(window.location.search.substring(1)).gist;
if (window.location.search) {
queryObject = ioQuery.queryToObject(window.location.search.substring(1));
if (defined(gistId)) {
queryObject.gistId = gistId;
}
} else {
queryObject.src = 'Hello World.html';
queryObject.label = 'Showcases';
if (defined(gistId)) {
queryObject.gistId = gistId;
}
}

function loadFromGallery(demo) {
document.getElementById('saveAsFile').download = demo.name + '.html';
registry.byId('description').set('value', decodeHTML(demo.description).replace(/\\n/g, '\n'));
registry.byId('label').set('value', decodeHTML(demo.label).replace(/\\n/g, '\n'));

if (demo.name === 'Gist Import') {
jsEditor.setValue(gistCode);
htmlEditor.setValue('<style>\n@import url(../templates/bucket.css);\n</style>\n<div id=\"cesiumContainer\" class=\"fullSize\"></div>\n<div id=\"loadingOverlay\"><h1>Loading...</h1></div>\n<div id=\"toolbar\"></div>');
document.title = 'Gist Import - Cesium Sandcastle';
CodeMirror.commands.runCesium(jsEditor);
return;
}
return requestDemo(demo.name).then(function(value) {
demo.code = value;

Expand All @@ -692,7 +724,26 @@ require({

var scriptCode = scriptMatch[1];
demoJs = scriptCode.replace(/\s/g, '');
jsEditor.setValue(scriptCode);

if (defined(queryObject.gistId)) {
Cesium.loadJsonp('https://api.github.com/gists/' + queryObject.gistId + '?access_token=dd8f755c2e5d9bbb26806bb93eaa2291f2047c60')
.then(function(data) {
var files = data.data.files;
var code = files[Object.keys(files)[0]].content;
jsEditor.setValue(code);
demoJs = code.replace(/\s/g, '');
gistCode = code;
previousCode = code;
sandcastleUrl = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId;
CodeMirror.commands.runCesium(jsEditor);
clearRun();
}).otherwise(function(error) {
appendConsole('consoleError', 'Unable to GET from GitHub API. This could be due to too many request, try again in an hour or copy and paste the code from the gist: https://gist.github.com/' + gistId , true);
console.log(error);
});
} else {
jsEditor.setValue(scriptCode);
}
jsEditor.clearHistory();

var htmlText = '';
Expand Down Expand Up @@ -834,6 +885,47 @@ require({
}
}

registry.byId('buttonShareDrop').on('click', function() {
var textArea = document.getElementById('link');
textArea.value = '\n\n';
var code = jsEditor.getValue();
if (code === previousCode) {
textArea.value = sandcastleUrl;
textArea.select();
return;
}
previousCode = code;
var data = {
public : true,
files : {
'Cesium-Sandcastle.js' : {
content : code
}
}
};
return Cesium.loadWithXhr({
url : 'https://api.github.com/gists',
data : JSON.stringify(data),
method : 'POST'
}).then(function(content) {
sandcastleUrl = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + JSON.parse(content).id;
textArea.value = sandcastleUrl;
textArea.select();
}).otherwise(function(error) {
appendConsole('consoleError', 'Unable to POST to GitHub API. This could be due to too many POST requests, try again in an hour.', true);
console.log(error);
});
});

registry.byId('buttonImport').on('click', function() {
gistId = document.getElementById("gistId").value;
if (gistId.indexOf('/') !== -1) {
var index = gistId.lastIndexOf('/');
gistId = gistId.substring(index + 1);
}
window.location.href = Cesium.getBaseUri(window.location.href) + '?src=Hello%20World.html&label=Showcases&gist=' + gistId;
});

registry.byId('buttonNew').on('click', function() {
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
Expand All @@ -859,6 +951,7 @@ require({
});
// Clicking the 'Run' button simply reloads the iframe.
registry.byId('buttonRun').on('click', function() {
runGist = true;
CodeMirror.commands.runCesium(jsEditor);
});

Expand Down Expand Up @@ -944,14 +1037,6 @@ require({
this.originalResize(changeSize, resultSize);
};

var queryObject = {};
if (window.location.search) {
queryObject = ioQuery.queryToObject(window.location.search.substring(1));
} else {
queryObject.src = 'Hello World.html';
queryObject.label = 'Showcases';
}

function requestDemo(name) {
return xhr.get({
url : 'gallery/' + name + '.html',
Expand Down Expand Up @@ -986,10 +1071,20 @@ require({

// Select the demo to load upon opening based on the query parameter.
if (defined(queryObject.src)) {
var gistDemo = {
name : 'Gist Import',
code : demo.code,
description: 'Code imported from GitHub Gist'
};
if (demo.name === queryObject.src.replace('.html', '')) {
loadFromGallery(demo).then(function() {
window.history.replaceState(demo, demo.name, '?src=' + demo.name + '.html&label=' + queryObject.label);
document.title = demo.name + ' - Cesium Sandcastle';
if (defined(queryObject.gistId)) {
window.history.replaceState(gistDemo, gistDemo.name, '?src=Hello World.html&label=' + queryObject.label + '&gist=' + queryObject.gistId);
document.title = 'Gist Import - Cesium Sandcastle';
} else {
window.history.replaceState(demo, demo.name, '?src=' + demo.name + '.html&label=' + queryObject.label);
document.title = demo.name + ' - Cesium Sandcastle';
}
});
}
}
Expand Down Expand Up @@ -1068,6 +1163,7 @@ require({
if (mouse.isMiddle(e)) {
window.open('gallery/' + demo.name + '.html');
} else {
delete queryObject.gistId;
var htmlText = (htmlEditor.getValue()).replace(/\s/g, '');
var jsText = (jsEditor.getValue()).replace(/\s/g, '');
var confirmChange = true;
Expand Down
4 changes: 3 additions & 1 deletion Apps/Sandcastle/gallery/CZML Rectangle.html
Expand Up @@ -94,7 +94,9 @@
"material" : {
"image" : {
"image" : { "uri" : "../images/Cesium_Logo_Color.jpg" },
"alpha" : 0.5
"color" : {
"rgba" : [255, 255, 255, 128]
}
}
}
}
Expand Down
Binary file added Apps/Sandcastle/images/gitHub16px.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Apps/Sandcastle/images/share16px.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions Apps/Sandcastle/index.html
Expand Up @@ -78,6 +78,26 @@
</a>
</div>
</div>
<span data-dojo-type="dijit.ToolbarSeparator"></span>
<div id="buttonShareDrop" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'shareIcon', showLabel: true">
<span>Share</span>
<div id="dropDownShare" data-dojo-type="dijit.TooltipDialog" data-dojo-props="class: 'popDownDialog'">
Be sure to re-share if you make any changes.<br />
<textarea data-dojo-type="dijit.form.Textarea" id="link"
data-dojo-props="trim:true" style="width: 335px;"></textarea>
</div>
</div>
<span data-dojo-type="dijit.ToolbarSeparator"></span>
<div id="buttonImportDrop" data-dojo-type="dijit.form.DropDownButton" data-dojo-props="iconClass: 'gitHubIcon', showLabel: true">
<span>Import Gist</span>
<div id="dropDownImport" data-dojo-type="dijit.TooltipDialog" data-dojo-props="class: 'popDownDialog'">
<div>Gist Id or Url:<br/>
<textarea data-dojo-type="dijit.form.Textarea" id="gistId"
data-dojo-props="trim:true" style="width: 335px;"></textarea>
</div>
<div id="buttonImport" data-dojo-type="dijit.form.Button">Import</div>
</div>
</div>
<!--
<span data-dojo-type="dijit.ToolbarSeparator"></span>
<div id="buttonUpload" data-dojo-type="dijit.form.Button" data-dojo-props="iconClass: 'dijitIconDocuments', showLabel: true">
Expand Down
41 changes: 29 additions & 12 deletions CHANGES.md
@@ -1,32 +1,49 @@
Change Log
==========

### 1.21 - 2016-05-02

* Breaking changes
* Removed `ImageryMaterialProperty.alpha`. Use `ImageryMaterialProperty.color.alpha` instead.
* Removed `OpenStreetMapImageryProvider`. Use `createOpenStreetMapImageryProvider` instead.
* Deprecated
*
* Fixed issue causing the sun not to render. [#3801](https://github.com/AnalyticalGraphicsInc/cesium/pull/3801)
* Added ability to import and export Sandcastle example using GitHub Gists. [#3795](https://github.com/AnalyticalGraphicsInc/cesium/pull/3795)
* Fixed issue where `Camera.flyTo` does not go to the rectangle. [#3688](https://github.com/AnalyticalGraphicsInc/cesium/issues/3688)
* Fixed issue causing the fog to go dark and the atmosphere to flicker when the camera clips the globe. [#3178](https://github.com/AnalyticalGraphicsInc/cesium/issues/3178)
* Fixed a bug that caused an exception and rendering to stop when using `ArcGisMapServerImageryProvider` to connect to a MapServer specifying the Web Mercator projection and a fullExtent bigger than the valid extent of the projection. [#3854](https://github.com/AnalyticalGraphicsInc/cesium/pull/3854)

### 1.20 - 2016-04-01

* Breaking changes
* Removed `TileMapServiceImageryProvider`. Use `createTileMapServiceImageryProvider` instead.
* Removed `GroundPrimitive.geometryInstance`. Use `GroundPrimitive.geometryInstances` instead.
* Removed `definedNotNull`. Use `defined` instead.
* Removed ability to rotate the map in 2D.
* Fixed `TimeIntervalCollection.removeInterval` bug that resulted in too many intervals being removed
* `GroundPrimitive` throws a `DeveloperError` when passed an unsupported geometry type instead of crashing.
* `GeoJsonDataSource` now handles CRS `urn:ogc:def:crs:EPSG::4326`
* Removed ability to rotate the map in 2D due to the new infinite 2D scrolling feature.
* Deprecated
* Deprecated `ImageryMaterialProperty.alpha`. It will be removed in 1.21. Use `ImageryMaterialProperty.color.alpha` instead.
* Added infinite horizontal scrolling in 2D.
* Added a code example to Sandcastle for the [new 1-meter Pennsylvania terrain service](http://cesiumjs.org/2016/03/15/New-Cesium-Terrain-Service-Covering-Pennsylvania/).
* Fixed loading for KML `NetworkLink` to not append a `?` if there isn't a query string.
* Fixed handling of non-standard KML `styleUrl` references within a `StyleMap`.
* Fixed `Color.fromCssColorString` from reusing the input `result` alpha value in some cases.
* Fixed issue in KML where StyleMaps from external documents fail to load.
* Added translucent and colored image support to KML ground overlays
* Fix bug when upsampling exaggerated terrain where the terrain heights were exaggerated at twice the value. [#3607](https://github.com/AnalyticalGraphicsInc/cesium/issues/3607)
* All external urls are now https by default to make Cesium work better with non-server-based applications. [#3650](https://github.com/AnalyticalGraphicsInc/cesium/issues/3650)
* `GeoJsonDataSource` now handles CRS `urn:ogc:def:crs:EPSG::4326`
* Fixed `TimeIntervalCollection.removeInterval` bug that resulted in too many intervals being removed.
* `GroundPrimitive` throws a `DeveloperError` when passed an unsupported geometry type instead of crashing.
* Fix issue with billboard collections that have at least one billboard with an aligned axis and at least one billboard without an aligned axis. [#3318](https://github.com/AnalyticalGraphicsInc/cesium/issues/3318)
* Fix a race condition that would cause the terrain to continue loading and unloading or cause a crash when changing terrain providers. [#3690](https://github.com/AnalyticalGraphicsInc/cesium/issues/3690)
* All external urls are now https by default to make Cesium work better with non-server-based applications. [#3650](https://github.com/AnalyticalGraphicsInc/cesium/issues/3650)
* Fix issue where the `GroundPrimitive` volume was being clipped by the far plane. [#3706](https://github.com/AnalyticalGraphicsInc/cesium/issues/3706)
* Fixed issue where `Camera.computeViewRectangle` was incorrect when crossing the international date line [#3717](https://github.com/AnalyticalGraphicsInc/cesium/issues/3717)
* Added `Rectangle` result parameter to `Camera.computeViewRectangle`
* Fixed issue in KML where StyleMaps from external documents fail to load.
* Fixed issue where `Camera.computeViewRectangle` was incorrect when crossing the international date line. [#3717](https://github.com/AnalyticalGraphicsInc/cesium/issues/3717)
* Added `Rectangle` result parameter to `Camera.computeViewRectangle`.
* Fixed a reentrancy bug in `EntityCollection.collectionChanged`. [#3739](https://github.com/AnalyticalGraphicsInc/cesium/pull/3739)
* Fix bug when upsampling exaggerated terrain where the terrain heights were exaggerated at twice the value. [#3607](https://github.com/AnalyticalGraphicsInc/cesium/issues/3607)
* Fixed a crash that would occur if you added and removed an `Entity` with a path without ever actually rendering it. [#3738](https://github.com/AnalyticalGraphicsInc/cesium/pull/3738)
* Added a new sample to Sandcastle using the Pennsylvania terrain data as shown [here](http://cesiumjs.org/2016/03/15/New-Cesium-Terrain-Service-Covering-Pennsylvania/).
* Added infinite horizontal scrolling in 2D.
* Fixed issue causing parts of geometry and billboards/labels to be clipped. [#3748](https://github.com/AnalyticalGraphicsInc/cesium/issues/3748)
* Fixed bug where transparent image materials were drawn black.
* Fixed `Color.fromCssColorString` from reusing the input `result` alpha value in some cases.

### 1.19 - 2016-03-01

Expand Down

0 comments on commit 3d6f1d8

Please sign in to comment.