Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Merge pull request #18 from fredj/c2c_patches_cesium_1.26
Browse files Browse the repository at this point in the history
cesium 1.26
  • Loading branch information
fredj authored Oct 25, 2016
2 parents 1ff99de + e459f7a commit f4c5349
Show file tree
Hide file tree
Showing 164 changed files with 7,372 additions and 1,662 deletions.
13 changes: 5 additions & 8 deletions Apps/Sandcastle/gallery/CZML Path.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,7 @@
"outlineColor" : {
"rgba" : [0, 255, 255, 255]
},
"outlineWidth" : 5,
"polylineGlow" : {
"color" : {
"rgba" : [255, 255, 0, 255]
},
"glowPower" : 3
}
"outlineWidth" : 5
}
},
"width" : 8,
Expand All @@ -67,7 +61,10 @@
},
"billboard" : {
"image" : "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAfCAYAAACVgY94AAAACXBIWXMAAC4jAAAuIwF4pT92AAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7Bo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GzzdmXU1xuUAAAAASUVORK5CYII=",
"scale" : 1.5
"scale" : 1.5,
"eyeOffset": {
"cartesian": [ 0.0, 0.0, -10.0 ]
}
},
"position" : {
"epoch" : "2012-08-04T10:00:00Z",
Expand Down
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Cardboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
viewer.scene.globe.enableLighting = true;

viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
url : 'https://assets.agi.com/stk-terrain/world',
requestVertexNormals : true
});

Expand Down
172 changes: 172 additions & 0 deletions Apps/Sandcastle/gallery/Clustering.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
<!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="Cluster labels, billboards and points.">
<meta name="cesium-sandcastle-labels" content="Tutorials,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>Pixel Range</td>
<td>
<input type="range" min="1" max="200" step="1" data-bind="value: pixelRange, valueUpdate: 'input'">
<input type="text" size="2" data-bind="value: pixelRange">
</td>
</tr>
<tr>
<td>Minimum Cluster Size</td>
<td>
<input type="range" min="2" max="20" step="1" data-bind="value: minimumClusterSize, valueUpdate: 'input'">
<input type="text" size="2" data-bind="value: minimumClusterSize">
</td>
</tr>
<tr><td><input type="checkbox" data-bind="checked: enabled"/>Enabled</td></tr>
<tr><td><input type="checkbox" data-bind="checked: customStyle"/>Custom Styling</td></tr>
</tbody>
</table>
</div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');

var options = {
camera : viewer.scene.camera,
canvas : viewer.scene.canvas
};
var dataSourcePromise = viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/kml/facilities/facilities.kml', options));
dataSourcePromise.then(function(dataSource) {
var pixelRange = 15;
var minimumClusterSize = 3;
var enabled = true;

dataSource.clustering.enabled = enabled;
dataSource.clustering.pixelRange = pixelRange;
dataSource.clustering.minimumClusterSize = minimumClusterSize;

var removeListener;

var pinBuilder = new Cesium.PinBuilder();
var pin50 = pinBuilder.fromText('50+', Cesium.Color.RED, 48).toDataURL();
var pin40 = pinBuilder.fromText('40+', Cesium.Color.ORANGE, 48).toDataURL();
var pin30 = pinBuilder.fromText('30+', Cesium.Color.YELLOW, 48).toDataURL();
var pin20 = pinBuilder.fromText('20+', Cesium.Color.GREEN, 48).toDataURL();
var pin10 = pinBuilder.fromText('10+', Cesium.Color.BLUE, 48).toDataURL();

var singleDigitPins = new Array(8);
for (var i = 0; i < singleDigitPins.length; ++i) {
singleDigitPins[i] = pinBuilder.fromText('' + (i + 2), Cesium.Color.VIOLET, 48).toDataURL();
}

function customStyle() {
if (Cesium.defined(removeListener)) {
removeListener();
removeListener = undefined;
} else {
removeListener = dataSource.clustering.clusterEvent.addEventListener(function(clusteredEntities, cluster) {
cluster.label.show = false;
cluster.billboard.show = true;
cluster.billboard.verticalOrigin = Cesium.VerticalOrigin.BOTTOM;

if (clusteredEntities.length >= 50) {
cluster.billboard.image = pin50;
} else if (clusteredEntities.length >= 40) {
cluster.billboard.image = pin40;
} else if (clusteredEntities.length >= 30) {
cluster.billboard.image = pin30;
} else if (clusteredEntities.length >= 20) {
cluster.billboard.image = pin20;
} else if (clusteredEntities.length >= 10) {
cluster.billboard.image = pin10;
} else {
cluster.billboard.image = singleDigitPins[clusteredEntities.length - 2];
}
});
}

// force a re-cluster with the new styling
var pixelRange = dataSource.clustering.pixelRange;
dataSource.clustering.pixelRange = 0;
dataSource.clustering.pixelRange = pixelRange;
}

// start with custom style
customStyle();

var viewModel = {
pixelRange: pixelRange,
minimumClusterSize: minimumClusterSize,
enabled : enabled,
customStyle : true
};
Cesium.knockout.track(viewModel);

var toolbar = document.getElementById('toolbar');
Cesium.knockout.applyBindings(viewModel, toolbar);

function subscribeParameter(name) {
Cesium.knockout.getObservable(viewModel, name).subscribe(
function(newValue) {
dataSource.clustering[name] = newValue;
}
);
}

subscribeParameter('pixelRange');
subscribeParameter('minimumClusterSize');
subscribeParameter('enabled');
Cesium.knockout.getObservable(viewModel, 'customStyle').subscribe(customStyle);

var handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas);
handler.setInputAction(function(movement) {
var pickedLabel = viewer.scene.pick(movement.position);
if (Cesium.defined(pickedLabel)) {
var ids = pickedLabel.id;
if (Cesium.isArray(ids)) {
for (var i = 0; i < ids.length; ++i) {
ids[i].label.fillColor = Cesium.Color.RED;
}
}
}
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
});
//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/Clustering.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Apps/Sandcastle/gallery/Custom DataSource.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
this._seriesNames = [];
this._seriesToDisplay = undefined;
this._heightScale = 10000000;
this._entityCluster = new Cesium.EntityCluster();
}

Object.defineProperties(WebGLGlobeDataSource.prototype, {
Expand Down Expand Up @@ -196,6 +197,22 @@
set : function(value) {
this._entityCollection = value;
}
},
/**
* Gets or sets the clustering options for this data source. This object can be shared between multiple data sources.
* @memberof WebGLGlobeDataSource.prototype
* @type {EntityCluster}
*/
clustering : {
get : function() {
return this._entityCluster;
},
set : function(value) {
if (!Cesium.defined(value)) {
throw new Cesium.DeveloperError('value must be defined.');
}
this._entityCluster = value;
}
}
});

Expand Down
103 changes: 103 additions & 0 deletions Apps/Sandcastle/gallery/Distance Display Conditions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<!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="Distance display conditions">
<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);
</style>
<div id="cesiumContainer" class="fullSize"></div>
<div id="loadingOverlay"><h1>Loading...</h1></div>
<div id="toolbar"></div>
<script id="cesium_sandcastle_script">
function startup(Cesium) {
'use strict';
//Sandcastle_Begin
var viewer = new Cesium.Viewer('cesiumContainer');

function addBillboardAndRectangle() {
Sandcastle.declare(addBillboardAndRectangle);

viewer.entities.add({
position : Cesium.Cartesian3.fromDegrees(-77, 40.5),
billboard : {
image : '../images/facility.gif',
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(5.5e6)
},
rectangle : {
coordinates : Cesium.Rectangle.fromDegrees(-80.5, 39.7, -75.1, 42.0),
height : 0.0,
material : Cesium.Color.RED.withAlpha(0.5),
outline : true,
outlineColor : Cesium.Color.RED,
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(0.0, 5.5e6)
}
});
}

function addPointAndModel() {
Sandcastle.declare(addPointAndModel);

var position = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883, 0.0);
var heading = Cesium.Math.toRadians(135);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, 0.0, 0.0);

viewer.entities.add({
position : position,
orientation : orientation,
point : {
pixelSize : 10,
color : Cesium.Color.YELLOW,
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(250.5)
},
model : {
uri : '../../SampleData/models/CesiumGround/Cesium_Ground.glb',
distanceDisplayCondition : new Cesium.DistanceDisplayCondition(0.0, 250.5)
}
});
}

Sandcastle.addToolbarMenu([{
text : 'Billboard and Primitive',
onselect : function() {
addBillboardAndRectangle();
Sandcastle.highlight(addBillboardAndRectangle);
}
}, {
text : 'Point and Model',
onselect : function() {
addPointAndModel();
Sandcastle.highlight(addPointAndModel);
}
}]);

Sandcastle.reset = function () {
viewer.camera.flyHome(0);
viewer.entities.removeAll();
};

//Sandcastle_End
Sandcastle.finishedLoading();
}
if (typeof Cesium !== "undefined") {
startup(Cesium);
} else if (typeof require === "function") {
require(["Cesium"], startup);
}
</script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/Shadows.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
});

viewer.terrainProvider = new Cesium.CesiumTerrainProvider({
url : '//assets.agi.com/stk-terrain/world',
url : 'https://assets.agi.com/stk-terrain/world',
requestWaterMask : true,
requestVertexNormals : true
});
Expand Down
Loading

0 comments on commit f4c5349

Please sign in to comment.