Skip to content

Commit

Permalink
Merge branch 'master' into addCzmlEntityTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
hpinkos committed Jun 3, 2016
2 parents e28e288 + 9281e8b commit 6b7267c
Show file tree
Hide file tree
Showing 45 changed files with 3,460 additions and 2,910 deletions.
5 changes: 4 additions & 1 deletion Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ define([
} else if (/\.geojson$/i.test(source) || /\.json$/i.test(source) || /\.topojson$/i.test(source)) {
loadPromise = GeoJsonDataSource.load(source);
} else if (/\.kml$/i.test(source) || /\.kmz$/i.test(source)) {
loadPromise = KmlDataSource.load(source);
loadPromise = KmlDataSource.load(source, {
camera: scene.camera,
canvas: scene.canvas
});
} else {
showLoadError(source, 'Unknown format.');
}
Expand Down
124 changes: 124 additions & 0 deletions Apps/Sandcastle/gallery/Atmosphere Color.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="Adjust hue, saturation, and brightness of the sky/atmosphere.">
<meta name="cesium-sandcastle-labels" content="Showcases">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
@import url(../templates/bucket.css);
#toolbar {
background: rgba(42, 42, 42, 0.8);
padding: 4px;
border-radius: 4px;
}
#toolbar input {
vertical-align: middle;
padding-top: 2px;
padding-bottom: 2px;
}
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar">
<table>
<tbody><tr>
<td>hueShift</td>
<td>
<input type="range" min="-1" max="1" step="0.01" data-bind="value: hueShift, valueUpdate: 'input'">
<input type="text" size="5" data-bind="value: hueShift">
</td>
</tr>
<tr>
<td>saturationShift</td>
<td>
<input type="range" min="-1" max="1" step="0.01" data-bind="value: saturationShift, valueUpdate: 'input'">
<input type="text" size="5" data-bind="value: saturationShift">
</td>
</tr>
<tr>
<td>brightnessShift</td>
<td>
<input type="range" min="-1" max="1" step="0.01" data-bind="value: brightnessShift, valueUpdate: 'input'">
<input type="text" size="5" data-bind="value: brightnessShift">
</td>
</tr>
</tbody></table>
<div id="toggleLighting"></div>
<div id="toggleFog"></div>
</div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;
var skyAtmosphere = scene.skyAtmosphere;

// The viewModel tracks the state of our mini application.
var viewModel = {
hueShift: 0.0,
saturationShift: 0.0,
brightnessShift: 0.0
};
// Convert the viewModel members into knockout observables.
Cesium.knockout.track(viewModel);

// Bind the viewModel to the DOM elements of the UI that call for it.
var toolbar = document.getElementById('toolbar');
Cesium.knockout.applyBindings(viewModel, toolbar);

// Make the skyAtmosphere's HSB parameters subscribers of the viewModel.
function subscribeParameter(name) {
Cesium.knockout.getObservable(viewModel, name).subscribe(
function(newValue) {
skyAtmosphere[name] = newValue;
}
);
}

subscribeParameter('hueShift');
subscribeParameter('saturationShift');
subscribeParameter('brightnessShift');

Sandcastle.addToolbarButton('Toggle Lighting', function() {
scene.globe.enableLighting = !scene.globe.enableLighting;
}, 'toggleLighting');

Sandcastle.addToolbarButton('Toggle Fog', function() {
scene.fog.enabled = !scene.fog.enabled;
}, 'toggleFog');

var camera = viewer.camera;
camera.setView({
destination : Cesium.Cartesian3.fromDegrees(-75.5847, 40.0397, 1000.0),
orientation: {
heading : -Cesium.Math.PI_OVER_TWO,
pitch : 0.2,
roll : 0.0
}
});

//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
Binary file added Apps/Sandcastle/gallery/Atmosphere Color.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 27 additions & 29 deletions Apps/Sandcastle/gallery/CZML Billboard and Label.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,54 +26,52 @@

<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var czml = [
{
'use strict';
//Sandcastle_Begin
var czml = [{
"id" : "document",
"name" : "Basic CZML billboard and label",
"version" : "1.0"
}, {
}, {
"id" : "some-unique-id",
"name" : "AGI",
"description" : "<p><a href='http://www.agi.com' target='_blank'>Analytical Graphics, Inc.</a> (AGI) founded Cesium.</p>",
"billboard" : {
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACvSURBVDhPrZDRDcMgDAU9GqN0lIzijw6SUbJJygUeNQgSqepJTyHG91LVVpwDdfxM3T9TSl1EXZvDwii471fivK73cBFFQNTT/d2KoGpfGOpSIkhUpgUMxq9DFEsWv4IXhlyCnhBFnZcFEEuYqbiUlNwWgMTdrZ3JbQFoEVG53rd8ztG9aPJMnBUQf/VFraBJeWnLS0RfjbKyLJA8FkT5seDYS1Qwyv8t0B/5C2ZmH2/eTGNNBgMmAAAAAElFTkSuQmCC",
"scale" : 1.5
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACvSURBVDhPrZDRDcMgDAU9GqN0lIzijw6SUbJJygUeNQgSqepJTyHG91LVVpwDdfxM3T9TSl1EXZvDwii471fivK73cBFFQNTT/d2KoGpfGOpSIkhUpgUMxq9DFEsWv4IXhlyCnhBFnZcFEEuYqbiUlNwWgMTdrZ3JbQFoEVG53rd8ztG9aPJMnBUQf/VFraBJeWnLS0RfjbKyLJA8FkT5seDYS1Qwyv8t0B/5C2ZmH2/eTGNNBgMmAAAAAElFTkSuQmCC",
"scale" : 1.5
},
"label" : {
"fillColor" : {
"rgba" : [0, 255, 255, 255]
},
"font" : "11pt Lucida Console",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba":[0, 0, 0, 255]
},
"outlineWidth" : 2,
"pixelOffset" : {
"cartesian2" : [12, 0]
},
"style" : "FILL_AND_OUTLINE",
"text" : "AGI"
"fillColor" : {
"rgba" : [0, 255, 255, 255]
},
"font" : "11pt Lucida Console",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba":[0, 0, 0, 255]
},
"outlineWidth" : 2,
"pixelOffset" : {
"cartesian2" : [12, 0]
},
"style" : "FILL_AND_OUTLINE",
"text" : "AGI"
},
"position" : {
"cartesian" : [
1216469.9357990976, -4736121.71856379, 4081386.8856866374
]
"cartesian":[
1216361.4096947117, -4736253.175342511, 4081267.4865667094
]
}
}
];
}];

var viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.CzmlDataSource.load(czml));
//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
require(["Cesium"], startup);
}
</script>
</body>
Expand Down
130 changes: 61 additions & 69 deletions Apps/Sandcastle/gallery/CZML Circles and Ellipses.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="CZML Circles and Ellipses">
<meta name="cesium-sandcastle-labels" content="CZML">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="CZML Circles and Ellipses">
<meta name="cesium-sandcastle-labels" content="CZML">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.20/require.js"></script>
<script type="text/javascript">
require.config({
baseUrl : '../../../Source',
waitSeconds : 60
});
</script>
</head>
<body class="sandcastle-loading" data-sandcastle-bucket="bucket-requirejs.html">
<style>
Expand All @@ -26,94 +26,86 @@

<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var czml = [
{
'use strict';
//Sandcastle_Begin
var czml = [{
"id" : "document",
"name" : "CZML Geometries: Circles and Ellipses",
"version" : "1.0"
},
{
}, {
"id" : "shape1",
"name" : "Green circle at height",
"position" : {
"cartographicDegrees" : [-111.0, 40.0, 150000.0]
"cartographicDegrees" : [-111.0, 40.0, 150000.0]
},
"ellipse" : {
"semiMinorAxis" : 300000.0,
"semiMajorAxis" : 300000.0,
"height" : 200000.0,
"material" : {
"solidColor" : {
"color" : {
"rgba" : [0, 255, 0, 255]
}
"semiMinorAxis" : 300000.0,
"semiMajorAxis" : 300000.0,
"height" : 200000.0,
"material" : {
"solidColor" : {
"color" : {
"rgba" : [0, 255, 0, 255]
}
}
}
}
}
},
{
}, {
"id" : "shape2",
"name" : "Red ellipse on surface",
"name" : "Red ellipse with white outline on surface",
"position" : {
"cartographicDegrees" : [-103.0, 40.0, 0]
},
"ellipse" : {
"semiMinorAxis" : 250000.0,
"semiMajorAxis" : 400000.0,
"height" : 0,
"material" : {
"solidColor" : {
"color" : {
"rgba" : [255, 0, 0, 127]
}
"semiMinorAxis" : 250000.0,
"semiMajorAxis" : 400000.0,
"height" : 0,
"material" : {
"solidColor" : {
"color" : {
"rgba" : [255, 0, 0, 127]
}
}
},
"outline" : true,
"outlineColor" : {
"rgba" : [255, 255, 255, 255]
}
},
"outline" : true,
"outlineColor" : {
"rgba" : [255, 0, 0, 255]
}
}
}, {
}, {
"id" : "shape3",
"name" : "Blue translucent, rotated, and extruded ellipse with outline",
"position" : {
"cartographicDegrees" : [-95.0, 40.0, 100000.0]
"cartographicDegrees" : [-95.0, 40.0, 100000.0]
},
"ellipse" : {
"semiMinorAxis" : 150000.0,
"semiMajorAxis" : 300000.0,
"extrudedHeight" : {
"number" : 200000.0
},
"rotation" : {
"number" : 0.78539
},
"material" : {
"solidColor" : {
"color" : {
"rgba" : [0, 0, 255, 127]
}
}
},
"outline" : true
"semiMinorAxis" : 150000.0,
"semiMajorAxis" : 300000.0,
"extrudedHeight" : 200000.0,
"rotation" : 0.78539,
"material" : {
"solidColor" : {
"color" : {
"rgba" : [0, 0, 255, 127]
}
}
},
"outline" : true
}
}
];
}];

var viewer = new Cesium.Viewer('cesiumContainer');
var dataSource = Cesium.CzmlDataSource.load(czml);
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);

//Sandcastle_End
Sandcastle.finishedLoading();
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
require(["Cesium"], startup);
}
</script>
</body>
Expand Down
Loading

0 comments on commit 6b7267c

Please sign in to comment.