Skip to content

Commit

Permalink
Merge branch 'master' into issue893
Browse files Browse the repository at this point in the history
Conflicts:
	Apps/CesiumViewer/CesiumViewer.js
	Source/DynamicScene/DataSourceDisplay.js
	Source/Widgets/Viewer/viewerDragDropMixin.js
  • Loading branch information
mramato committed Aug 13, 2013
2 parents 5f0902b + ba2f0fe commit c413752
Show file tree
Hide file tree
Showing 10 changed files with 306 additions and 272 deletions.
9 changes: 1 addition & 8 deletions Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,6 @@ define([
source.loadUrl(endUserOptions.source).then(function() {
viewer.dataSources.add(source);

var dataClock = source.getClock();
if (defined(dataClock)) {
dataClock.clone(viewer.clock);
viewer.timeline.updateFromClock();
viewer.timeline.zoomTo(dataClock.startTime, dataClock.stopTime);
}

if (defined(endUserOptions.lookAt)) {
var dynamicObject = source.getDynamicObjectCollection().getObject(endUserOptions.lookAt);
if (defined(dynamicObject)) {
Expand Down Expand Up @@ -140,4 +133,4 @@ define([
}
}
}
});
});
195 changes: 195 additions & 0 deletions Apps/Sandcastle/gallery/CZML.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> <!-- Use Chrome Frame in IE -->
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta name="description" content="A simple CZML example showing four satellites in orbit around the Earth, and some ground objects.">
<title>Cesium Demo</title>
<script type="text/javascript" src="../Sandcastle-header.js"></script>
<script type="text/javascript" src="../../../ThirdParty/requirejs-2.1.6/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" data-sandcastle-title="Cesium">
<style>
@import url(../templates/bucket.css);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
require(['Cesium'], function(Cesium) {
"use strict";

var gallery = '../../CesiumViewer/Gallery/';

function czmlSatellites() {
Sandcastle.declare(czmlSatellites); // For highlighting in Sandcastle.

viewer.dataSources.removeAll();

var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.loadUrl(gallery + 'simple.czml').then(function() {
viewer.dataSources.add(czmlDataSource);
viewer.homeButton.viewModel.command();
});
}

function czmlSensors() {
Sandcastle.declare(czmlSensors); // For highlighting in Sandcastle.

viewer.dataSources.removeAll();

var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.loadUrl(gallery + 'LotsOfSensors.czml').then(function() {
viewer.dataSources.add(czmlDataSource);
viewer.homeButton.viewModel.command();
});
}

function czmlVehicle() {
Sandcastle.declare(czmlVehicle); // For highlighting in Sandcastle.

viewer.dataSources.removeAll();

var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.loadUrl(gallery + 'Vehicle.czml').then(function() {
viewer.dataSources.add(czmlDataSource);
viewer.homeButton.viewModel.command();
});
}

var builtInCzml = [{
"id" : "Vehicle",
"availability" : "2012-08-04T16:00:00Z/2012-08-04T17:04:54.9962195740191Z",
"billboard" : {
"eyeOffset" : {
"cartesian" : [0.0, 0.0, 0.0]
},
"horizontalOrigin" : "CENTER",
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",
"pixelOffset" : {
"cartesian2" : [0.0, 0.0]
},
"scale" : 0.8333333333333334,
"show" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"boolean" : true
}],
"verticalOrigin" : "BOTTOM"
},
"label" : {
"fillColor" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"rgba" : [255, 255, 0, 255]
}],
"font" : "bold 10pt Segoe UI Semibold",
"horizontalOrigin" : "LEFT",
"outlineColor" : {
"rgba" : [0, 0, 0, 255]
},
"pixelOffset" : {
"cartesian2" : [10.0, 0.0]
},
"scale" : 1.0,
"show" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"boolean" : true
}],
"style" : "FILL",
"text" : "Vehicle",
"verticalOrigin" : "CENTER"
},
"path" : {
"color" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"rgba" : [255, 255, 0, 255]
}],
"outlineWidth" : 0.0,
"width" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"number" : 5.0
}],
"show" : [{
"interval" : "2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",
"boolean" : true
}]
},
"position" : {
"interpolationAlgorithm" : "LAGRANGE",
"interpolationDegree" : 1,
"epoch" : "2012-08-04T16:00:00Z",
// Trimmed to just 2 points
"cartesian" : [0.0, -2379754.6637012, -4665332.88013588, 3628133.68924173,
3894.996219574019, -2291336.52323822, -4682359.21232197, 3662718.52171165]
}
}];

function useBuiltInCzml() {
Sandcastle.declare(useBuiltInCzml); // For highlighting in Sandcastle.

viewer.dataSources.removeAll();

var czmlDataSource = new Cesium.CzmlDataSource();
czmlDataSource.load(builtInCzml, 'Built-in CZML');
viewer.dataSources.add(czmlDataSource);

// Zoom in a little closer...
var extent = new Cesium.Extent(-2.056, 0.587, -2.010, 0.633);
viewer.scene.getCamera().controller.viewExtent(extent);
}

function createButtons() {
var toolbar = document.getElementById('toolbar');

var button = document.createElement('button');
button.className = 'button';
button.onclick = function() {
czmlSatellites();
Sandcastle.highlight(czmlSatellites);
};
button.textContent = 'Satellites';
toolbar.appendChild(button);

button = document.createElement('button');
button.className = 'button';
button.onclick = function() {
czmlSensors();
Sandcastle.highlight(czmlSensors);
};
button.textContent = 'Sensors';
toolbar.appendChild(button);

button = document.createElement('button');
button.className = 'button';
button.onclick = function() {
czmlVehicle();
Sandcastle.highlight(czmlVehicle);
};
button.textContent = 'Vehicle';
toolbar.appendChild(button);

button = document.createElement('button');
button.className = 'button';
button.onclick = function() {
useBuiltInCzml();
Sandcastle.highlight(useBuiltInCzml);
};
button.textContent = 'Built-in CZML';
toolbar.appendChild(button);
}

var viewer = new Cesium.Viewer('cesiumContainer');
czmlSatellites();
createButtons();

Sandcastle.finishedLoading();
});
</script>
</body>
</html>
File renamed without changes
Loading

0 comments on commit c413752

Please sign in to comment.