119 lines
3.8 KiB
HTML
119 lines
3.8 KiB
HTML
<!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="Draw polylines with various widths and materials.">
|
|
<meta name="cesium-sandcastle-labels" content="Geometries">
|
|
<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
|
|
var viewer = new Cesium.Viewer('cesiumContainer');
|
|
|
|
var redLine = viewer.entities.add({
|
|
name : 'Red line on terrain',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,
|
|
-125, 35]),
|
|
width : 5,
|
|
material : Cesium.Color.RED,
|
|
clampToGround : true
|
|
}
|
|
});
|
|
|
|
var greenRhumbLine = viewer.entities.add({
|
|
name : 'Green rhumb line',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArray([-75, 35,
|
|
-125, 35]),
|
|
width : 5,
|
|
arcType : Cesium.ArcType.RHUMB,
|
|
material : Cesium.Color.GREEN
|
|
}
|
|
});
|
|
|
|
var glowingLine = viewer.entities.add({
|
|
name : 'Glowing blue line on the surface',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArray([-75, 37,
|
|
-125, 37]),
|
|
width : 10,
|
|
material : new Cesium.PolylineGlowMaterialProperty({
|
|
glowPower : 0.2,
|
|
taperPower : 0.5,
|
|
color : Cesium.Color.CORNFLOWERBLUE
|
|
})
|
|
}
|
|
});
|
|
|
|
var orangeOutlined = viewer.entities.add({
|
|
name : 'Orange line with black outline at height and following the surface',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 39, 250000,
|
|
-125, 39, 250000]),
|
|
width : 5,
|
|
material : new Cesium.PolylineOutlineMaterialProperty({
|
|
color : Cesium.Color.ORANGE,
|
|
outlineWidth : 2,
|
|
outlineColor : Cesium.Color.BLACK
|
|
})
|
|
}
|
|
});
|
|
|
|
var purpleArrow = viewer.entities.add({
|
|
name : 'Purple straight arrow at height',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 43, 500000,
|
|
-125, 43, 500000]),
|
|
width : 10,
|
|
arcType : Cesium.ArcType.NONE,
|
|
material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.PURPLE)
|
|
}
|
|
});
|
|
|
|
var dashedLine = viewer.entities.add({
|
|
name : 'Blue dashed line',
|
|
polyline : {
|
|
positions : Cesium.Cartesian3.fromDegreesArrayHeights([-75, 45, 500000,
|
|
-125, 45, 500000]),
|
|
width : 4,
|
|
material : new Cesium.PolylineDashMaterialProperty({
|
|
color: Cesium.Color.CYAN
|
|
})
|
|
}
|
|
});
|
|
|
|
viewer.zoomTo(viewer.entities);
|
|
//Sandcastle_End
|
|
Sandcastle.finishedLoading();
|
|
}
|
|
if (typeof Cesium !== 'undefined') {
|
|
startup(Cesium);
|
|
} else if (typeof require === 'function') {
|
|
require(['Cesium'], startup);
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|