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

Add polylines on 3D Tiles Sandcastle Example #7522

Merged
merged 9 commits into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
126 changes: 126 additions & 0 deletions Apps/Sandcastle/gallery/Polylines on 3D Tiles.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!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="Display polylines on BIM and Photogrammetry 3D Tiles">
<meta name="cesium-sandcastle-labels" content="3D Tiles">
<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">
if(typeof require === 'function') {
require.config({
baseUrl : '../../../Source',
waitSeconds : 120
});
}
</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
// Power Plant design model provided by Bentley Systems
var viewer = new Cesium.Viewer('cesiumContainer');
var scene = viewer.scene;

var powerplant = scene.primitives.add(
new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(8564),
show: false
})
);
var pipes = viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([
-76.36053390920833, 34.949935893493596,
-76.36055481641581, 34.94993589886988,
-76.36055477047704, 34.94992280693651
]),
width : 6,
material : new Cesium.PolylineDashMaterialProperty({
color : Cesium.Color.YELLOW,
dashLength: 20.0
}),
show: false,
clampToGround : true,
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
}
});

var building = viewer.scene.primitives.add(
new Cesium.Cesium3DTileset({
url: Cesium.IonResource.fromAssetId(6074)
})
);
var route = viewer.entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArray([
-75.59604807301078, 40.03948512841901,
-75.59644577413066, 40.039316280505446,
-75.59584544997564, 40.03846271524258,
-75.59661425371488, 40.03814087821916,
-75.59664726332451, 40.03818297772907
]),
width : 6,
material : new Cesium.PolylineDashMaterialProperty({
color : Cesium.Color.YELLOW
}),
show: false,
clampToGround : true,
classificationType: Cesium.ClassificationType.CESIUM_3D_TILE
}
});

Sandcastle.addToolbarMenu([{
text : 'BIM',
onselect : function() {
building.show = false;
route.polyline.show = false;
powerplant.show = true;
pipes.polyline.show = true;
scene.camera.setView({
destination: new Cesium.Cartesian3(1234151.4883992162, -5086036.79436967, 3633328.4278331124),
orientation: {
heading: 5.593695742186853,
pitch: -1.0786797635545216,
roll: 6.27892466154778
}
});
}
}, {
text : 'Photogrammetry',
onselect : function() {
building.show = true;
route.polyline.show = true;
powerplant.show = false;
pipes.polyline.show = false;
scene.camera.setView({
destination: new Cesium.Cartesian3(1216596.5376729995, -4736445.416889214, 4081406.990364228),
orientation: {
heading: 5.153176564030707,
pitch: -0.9701972964526693,
roll: 6.277883257569513
}
});
}
}]);//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.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Change Log
* Added `classificationType` property to `PolylineGraphics` and `GroundPolylinePrimitive` which specifies whether a polyline clamped to ground should be clamped to terrain, 3D Tiles, or both. [#7437](https://github.com/AnalyticalGraphicsInc/cesium/pull/7437)
* Added the ability to specify the width of the intersection volume for `Scene.sampleHeight`, `Scene.clampToHeight`, `Scene.sampleHeightMostDetailed`, and `Scene.clampToHeightMostDetailed`. [#7287](https://github.com/AnalyticalGraphicsInc/cesium/pull/7287)
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Time%20Dynamic%20Wheels.html) on using `nodeTransformations` to rotate a model's wheels based on its velocity. [#7361](https://github.com/AnalyticalGraphicsInc/cesium/pull/7361)
* Added a [new Sandcastle example](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/?src=Polylines%20on%203D%20Tiles.html) for drawing polylines on 3D Tiles [#7522](https://github.com/AnalyticalGraphicsInc/cesium/pull/7522)
* Added `EllipsoidRhumbLine` class as a rhumb line counterpart to `EllipsoidGeodesic`. [#7484](https://github.com/AnalyticalGraphicsInc/cesium/pull/7484)
* Added rhumb line support to `PolygonGeometry`, `PolygonOutlineGeometry`, `PolylineGeometry`, `GroundPolylineGeometry`, and `SimplePolylineGeometry`. [#7492](https://github.com/AnalyticalGraphicsInc/cesium/pull/7492)
* When using Cesium in Node.js, we now use the combined and minified version for improved performance unless `NODE_ENV` is specifically set to `development`.
Expand Down