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

Replace CesiumViewerWidget #838

Merged
merged 93 commits into from
Jun 14, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
c5a4e7d
Start of CesiumViewerWidget replacement.
mramato May 1, 2013
65fba2d
Merge branch 'master' into viewer
mramato May 7, 2013
4658a5d
Use buildModuleUrl instead of require.toUrl.
mramato May 7, 2013
4123f4a
Merge branch 'master' into viewer
mramato May 7, 2013
c70230f
Merge branch 'dataSources' into viewer
mramato May 7, 2013
c9f36e9
Expose data sources collection and drive the display.
mramato May 7, 2013
742f448
Ongoing Viewer widget work.
mramato May 8, 2013
fd46bf5
Merge branch 'homeButton' into viewer
mramato May 9, 2013
1456f0c
Make Viewer use HomeButton widget.
mramato May 9, 2013
79bd8bf
Merge branch 'homeButton' into viewer
mramato May 9, 2013
93aaa7b
Start implementing specs for Viewer
mramato May 9, 2013
8efe6e9
Specs, documentation and cleanup for Viewer widget.
mramato May 10, 2013
48acf30
Merge branch 'dataSources' into viewer
mramato May 16, 2013
e1b774b
Merge remote-tracking branch 'origin/master' into viewer
mramato May 17, 2013
b5ec161
Merge branch 'dataSources' into viewer
mramato May 17, 2013
47632fc
Add helper function for drag and drop with the new Viewer.
mramato May 20, 2013
713b37b
Merge remote-tracking branch 'origin/master' into viewer
mramato May 20, 2013
7f2a96a
Specs for drag and drop and other misc Viewer work.
mramato May 20, 2013
c15feb1
Ongoing Viewer work.
mramato May 20, 2013
e8edc2d
Merge branch 'dataSources' into viewer
mramato May 20, 2013
ec2530b
Merge branch 'master' into viewer
mramato May 20, 2013
01ae269
Merge branch 'dataSources' into viewer
mramato May 20, 2013
bb16ff9
Remove CesiumViewerWidget
mramato May 20, 2013
18b7b8a
Merge branch 'dataSources' into viewer
mramato May 21, 2013
502ef3a
More changes after review.
mramato May 21, 2013
9db8cf5
Merge branch 'master' into viewer
mramato May 30, 2013
06ba445
Merge branch 'widgetCleanup' into viewer
mramato May 30, 2013
c1b4fb4
Get everything up and running after merge. Still lots of cleanup.
mramato May 30, 2013
c37e7dc
Ongoing Viewer widget work
mramato May 30, 2013
84d9b91
Merge branch 'widgetCleanup' into viewer
mramato May 30, 2013
1ed22b5
Merge branch 'widgetCleanupES5' into viewerES5
mramato May 31, 2013
b753f4a
Update new Viewer to use ECMAScript 5 properties.
mramato May 31, 2013
c11487b
Merge branch 'widgetCleanupES5' into viewerES5
mramato May 31, 2013
7122d5d
Fix Sandcastle examples.
mramato May 31, 2013
4143055
Merge branch 'widgetCleanup' into viewerES5
mramato Jun 1, 2013
d68c980
Merge branch 'master' into viewer
mramato Jun 1, 2013
098dd26
Merge branch 'viewerES5' into viewer
mramato Jun 1, 2013
d8be10e
Fixes after merge.
mramato Jun 1, 2013
780e00f
Clean up Viewer.css so that it doesn't conflict with other widgets wh…
mramato Jun 1, 2013
ebe49c3
Doc and spec cleanup.
mramato Jun 1, 2013
ca1c48c
Merge branch 'widgetCleanup' into viewer
mramato Jun 1, 2013
f912f00
Merge branch 'widgetCleanup' into viewer
mramato Jun 3, 2013
12f6a0b
Refactor new Viewer drag and drop code.
mramato Jun 3, 2013
abcf02a
Merge branch 'widgetCleanup' into viewer
mramato Jun 3, 2013
cab0167
Ongoing Viewer work
mramato Jun 3, 2013
fdfea38
Merge branch 'master' into viewer
mramato Jun 3, 2013
2e87869
Use custom `defineProperties` for legacy compatibility.
mramato Jun 3, 2013
ce80844
Merge branch 'widgetCleanup' into viewer
mramato Jun 3, 2013
8a1d636
Merge branch 'master' into viewer
mramato Jun 3, 2013
31455b5
Fix clearing on drop, and fix faulty tests that hid the problem
shunter Jun 5, 2013
4e8a98a
Remove trailing comma which was breaking the build.
mramato Jun 6, 2013
8aa0ce2
Merge branch 'master' into viewer
mramato Jun 7, 2013
76b43ca
Remove trailing comma.
mramato Jun 7, 2013
f9e630f
Merge remote-tracking branch 'origin/master' into viewer
shunter Jun 7, 2013
9562c01
Merge branch 'updateRequireJS' into viewer
shunter Jun 7, 2013
b346854
Avoid creating two BingImageryProviders so we don't hit the Bing serv…
shunter Jun 7, 2013
00c6d40
Switch build process for CesiumViewer to no longer use Dojo.
shunter Jun 7, 2013
d006633
Merge branch 'master' into viewer
mramato Jun 10, 2013
2180610
Start of Viewer widget mixins.
mramato Jun 10, 2013
070bac3
Ongoing Viewer mixin work.
mramato Jun 10, 2013
e1606ec
Ignore mouse clicks on the object we are already tracking.
mramato Jun 10, 2013
4e86954
Spec cleanup.
mramato Jun 10, 2013
d0f6f3e
Merge branch 'master' into viewer
mramato Jun 10, 2013
d86ac9d
Merge branch 'viewer' into viewer-mixins
mramato Jun 10, 2013
6e834c8
Minor doc tweak.
mramato Jun 10, 2013
d7984d1
Merge branch 'master' into viewer
mramato Jun 10, 2013
a890378
Update CHANGES
mramato Jun 10, 2013
9d663b7
Merge branch 'viewer' into viewer-mixins
mramato Jun 10, 2013
55db3b3
Clean up documentation.
mramato Jun 10, 2013
86861ce
Merge pull request #853 from AnalyticalGraphicsInc/viewer-mixins
shunter Jun 11, 2013
674cbb0
Fix typos.
shunter Jun 11, 2013
564ce66
Merge branch 'master' into viewer
mramato Jun 11, 2013
f998e66
Fix regression.
mramato Jun 11, 2013
b139f2f
Fixed typo.
mramato Jun 11, 2013
acb439f
Switch Sandcastle examples to RequireJS instead of standalone.
shunter Jun 11, 2013
750a788
Merge branch 'master' into viewer
mramato Jun 12, 2013
267468b
Fix spec afte intgrate.
mramato Jun 12, 2013
9df9189
Add loading indicator to Cesium Viewer app
mramato Jun 12, 2013
e71ef21
Viewer resize
mramato Jun 12, 2013
39d4fe2
Remove use of media-queries and size everything in Javascript.
mramato Jun 12, 2013
eb3c160
Store the base layer drop down locally so we don't look it up every t…
mramato Jun 12, 2013
292d908
Add a getElement helper method to find DOM elements by ID in widgets.
shunter Jun 12, 2013
d181104
Add detection for Internet Explorer
shunter Jun 12, 2013
35e64ab
Minor doc cleanup.
mramato Jun 12, 2013
68c1223
Fix #860
mramato Jun 13, 2013
683ba3e
Shims so the code evaluates in IE
shunter Jun 13, 2013
79d520d
Remove unnecessary quotes
shunter Jun 13, 2013
6351d39
Don't rely on Array.forEach
shunter Jun 13, 2013
6f2d0a1
Add a new checkForChromeFrame function that doesn't require Dojo.
shunter Jun 13, 2013
437cf78
Remove Dojo checkForChromeFrame.
shunter Jun 13, 2013
3987742
Rename loading to loadingIndicator to be a bit more specific.
shunter Jun 13, 2013
2cd39a1
Add checkForChromeFrame to CHANGES.
shunter Jun 13, 2013
8a3557e
DynamicObjectView shoudln't disable tilt, leave that up to thapp.
mramato Jun 13, 2013
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
28 changes: 26 additions & 2 deletions Apps/CesiumViewer/CesiumViewer.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
@import url('../../ThirdParty/dojo-release-1.8.3-src/dijit/themes/claro/claro.css');
@import url('../../Source/Widgets/Dojo/CesiumViewerWidget.css');
@import url(../../Source/Widgets/Viewer/Viewer.css);
@import url(../../Source/Widgets/Viewer/lighter.css);
@import url(../../Source/Widgets/checkForChromeFrame.css);

body {
height: 100%;
width: 100%;
margin: 0;
overflow: hidden;
padding: 0;
background: #000;
}

.fullWindow {
position: absolute;
Expand All @@ -12,3 +22,17 @@
padding: 0;
font-family: sans-serif;
}

.loadingIndicator {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin-top: -33px;
margin-left: -33px;
width: 66px;
height: 66px;
background-position: center;
background-repeat: no-repeat;
background-image: url(Images/ajax-loader.gif);
}
125 changes: 98 additions & 27 deletions Apps/CesiumViewer/CesiumViewer.js
Original file line number Diff line number Diff line change
@@ -1,41 +1,112 @@
/*global define*/
define([
'dojo/_base/window',
'dojo/dom-class',
'dojo/io-query',
'dojo/parser',
'dojo/ready',
'Widgets/Dojo/checkForChromeFrame',
'Widgets/Dojo/CesiumViewerWidget'
'DynamicScene/CzmlDataSource',
'Scene/PerformanceDisplay',
'Widgets/checkForChromeFrame',
'Widgets/Viewer/Viewer',
'Widgets/Viewer/viewerDragDropMixin',
'Widgets/Viewer/viewerDynamicObjectMixin',
'domReady!'
], function(
win,
domClass,
ioQuery,
parser,
ready,
CzmlDataSource,
PerformanceDisplay,
checkForChromeFrame,
CesiumViewerWidget) {
Viewer,
viewerDragDropMixin,
viewerDynamicObjectMixin) {
"use strict";
/*global console*/

ready(function() {
parser.parse();
/*
* 'debug' : true/false, // Full WebGL error reporting at substantial performance cost.
* 'lookAt' : CZML id, // The CZML ID of the object to track at startup.
* 'source' : 'file.czml', // The relative URL of the CZML file to load at startup.
* 'stats' : true, // Enable the FPS performance display.
* 'theme' : 'lighter', // Use the dark-text-on-light-background theme.
*/
var endUserOptions = {};
var queryString = window.location.search.substring(1);
if (queryString !== '') {
var params = queryString.split('&');
for ( var i = 0, len = params.length; i < len; ++i) {
var param = params[i];
var keyValuePair = param.split('=');
if (keyValuePair.length > 1) {
endUserOptions[keyValuePair[0]] = decodeURIComponent(keyValuePair[1].replace(/\+/g, ' '));
}
}
}

checkForChromeFrame();
var loadingIndicator = document.getElementById('loadingIndicator');

var endUserOptions = {};
if (window.location.search) {
endUserOptions = ioQuery.queryToObject(window.location.search.substring(1));
checkForChromeFrame('cesiumContainer').then(function(prompting) {
if (!prompting) {
startup();
} else {
loadingIndicator.style.display = 'none';
}
});

var widget = new CesiumViewerWidget({
endUserOptions : endUserOptions,
enableDragDrop : true
function startup() {
var viewer = new Viewer('cesiumContainer');
viewer.extend(viewerDragDropMixin);
viewer.extend(viewerDynamicObjectMixin);

viewer.onDropError.addEventListener(function(dropHandler, name, error) {
console.log(error);
window.alert(error);
});
widget.placeAt('cesiumContainer');
widget.startup();
widget.fullscreen.viewModel.fullscreenElement = document.body;

domClass.remove(win.body(), 'loading');
});
var scene = viewer.scene;
var context = scene.getContext();
if (endUserOptions.debug) {
context.setValidateShaderProgram(true);
context.setValidateFramebuffer(true);
context.setLogShaderCompilation(true);
context.setThrowOnWebGLError(true);
}

if (typeof endUserOptions.source !== 'undefined') {
var source = new CzmlDataSource();
source.loadUrl(endUserOptions.source).then(function() {
viewer.dataSources.add(source);

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

if (typeof endUserOptions.lookAt !== 'undefined') {
var dynamicObject = source.getDynamicObjectCollection().getObject(endUserOptions.lookAt);
if (typeof dynamicObject !== 'undefined') {
viewer.trackedObject = dynamicObject;
} else {
window.alert('No object with id ' + endUserOptions.lookAt + ' exists in the provided source.');
}
}
}, function(e) {
window.alert(e);
}).always(function() {
loadingIndicator.style.display = 'none';
});
} else {
loadingIndicator.style.display = 'none';
}

if (endUserOptions.stats) {
scene.getPrimitives().add(new PerformanceDisplay());
}

var theme = endUserOptions.theme;
if (typeof theme !== 'undefined') {
if (endUserOptions.theme === 'lighter') {
document.body.classList.add('cesium-lighter');
viewer.animation.applyThemeChanges();
} else {
window.alert('Unknown theme: ' + theme);
}
}
}
});
64 changes: 0 additions & 64 deletions Apps/CesiumViewer/CesiumViewer.profile.js

This file was deleted.

47 changes: 6 additions & 41 deletions Apps/CesiumViewer/CesiumViewerStartup.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
/*global require*/
require({
baseUrl : '../..',
packages : [{
name : 'dojo',
location : 'ThirdParty/dojo-release-1.8.3-src/dojo'
}, {
name : 'dijit',
location : 'ThirdParty/dojo-release-1.8.3-src/dijit'
}, {
name : 'Assets',
location : 'Source/Assets'
}, {
name : 'Core',
location : 'Source/Core'
}, {
name : 'DynamicScene',
location : 'Source/DynamicScene'
}, {
name : 'Renderer',
location : 'Source/Renderer'
}, {
name : 'Scene',
location : 'Source/Scene'
}, {
name : 'Shaders',
location : 'Source/Shaders'
}, {
name : 'ThirdParty',
location : 'Source/ThirdParty'
}, {
name : 'Widgets',
location : 'Source/Widgets'
}, {
name : 'Workers',
location : 'Source/Workers'
}, {
name : 'CesiumViewer',
location : 'Apps/CesiumViewer'
}]
}, [
'CesiumViewer/CesiumViewer'
], function() {
baseUrl : '../../Source',
paths : {
CesiumViewer : '../Apps/CesiumViewer',
domReady : '../ThirdParty/requirejs-2.1.6/domReady'
}
}, ['CesiumViewer/CesiumViewer'], function() {
});
7 changes: 3 additions & 4 deletions Apps/CesiumViewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
<title>Cesium Viewer</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="CesiumViewer.css" media="screen">

<script data-dojo-config="async:1,tlmSiblingOfDojo:0" src="../../ThirdParty/dojo-release-1.8.3-src/dojo/dojo.js"></script>
<script src="CesiumViewerStartup.js"></script>
<script data-main="CesiumViewerStartup" src="../../ThirdParty/requirejs-2.1.6/require.js"></script>
</head>
<body class="claro" style="background: #000;">
<body style="background: #000;">
<div id="cesiumContainer" class="fullWindow"></div>
<div id="loadingIndicator" class="loadingIndicator"></div>
</body>
</html>
6 changes: 0 additions & 6 deletions Apps/CesiumViewer/package.json

This file was deleted.

3 changes: 0 additions & 3 deletions Apps/Sandcastle/CesiumSandcastle.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ require({
}]
}, [
'Sandcastle/LinkButton',
'Widgets/Dojo/CesiumViewerWidget',
'dojo/mouse',
'dojo/on',
'dojo/parser',
Expand Down Expand Up @@ -50,7 +49,6 @@ require({
'dojo/domReady!'
], function(
LinkButton,
CesiumViewerWidget,
mouse,
on,
parser,
Expand All @@ -69,7 +67,6 @@ require({

parser.parse();

window.CesiumViewerWidget = CesiumViewerWidget; // for autocomplete.
fx.fadeOut({
node : 'loading',
onEnd : function() {
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/ThirdParty/Cesium-hint.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
var funcProps = "prototype apply call bind".split(" ");
var javascriptKeywords = ("break case catch continue debugger default delete do else false finally for function " +
"if in instanceof new null return switch throw true try typeof var void while with").split(" ");
var knownGlobals = "Cesium CesiumViewerWidget dojo dijit dojox".split(" ");
var knownGlobals = "Cesium dojo dijit dojox".split(" ");

CodeMirror.cesiumHint = function(editor) {
return scriptHint(editor, javascriptKeywords,
Expand Down
Loading