update example

This commit is contained in:
ethan 2024-02-25 11:24:07 +08:00
parent 30c319c1ed
commit 61615a9355
2 changed files with 15 additions and 20 deletions

View File

@ -66,11 +66,6 @@
<button id="drawCurve">曲线</button> <button id="drawCurve">曲线</button>
<button id="drawEllipse">椭圆</button> <button id="drawEllipse">椭圆</button>
<button id="drawLune">半月面</button> <button id="drawLune">半月面</button>
<button id="hide">隐藏</button>
<button id="show">显示</button>
<button id="remove">删除</button>
<button id="addEvent">绑定事件</button>
<button id="removeEvent">解绑事件</button>
</div> </div>
<!-- <script> <!-- <script>
window.CESIUM_BASE_URL = 'node_modules/cesium/Build/Cesium'; window.CESIUM_BASE_URL = 'node_modules/cesium/Build/Cesium';

View File

@ -83,27 +83,27 @@ window.onload = () => {
break; break;
case 'drawFineArrow': case 'drawFineArrow':
geometry = new CesiumPlot.FineArrow(Cesium, viewer, { geometry = new CesiumPlot.FineArrow(Cesium, viewer, {
material: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 0.5)'), // material: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 0.5)'),
outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'), // outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'),
outlineWidth: 3, // outlineWidth: 3,
}); });
break; break;
case 'drawAttackArrow': case 'drawAttackArrow':
geometry = new CesiumPlot.AttackArrow(Cesium, viewer, { geometry = new CesiumPlot.AttackArrow(Cesium, viewer, {
outlineMaterial: Cesium.Color.RED, // outlineMaterial: Cesium.Color.RED,
}); });
break; break;
case 'drawSwallowtailAttackArrow': case 'drawSwallowtailAttackArrow':
geometry = new CesiumPlot.SwallowtailAttackArrow(Cesium, viewer, { geometry = new CesiumPlot.SwallowtailAttackArrow(Cesium, viewer, {
outlineMaterial: Cesium.Color.BLUE, // outlineMaterial: Cesium.Color.BLUE,
}); });
break; break;
case 'drawSquadCombat': case 'drawSquadCombat':
geometry = new CesiumPlot.SquadCombat(Cesium, viewer, { geometry = new CesiumPlot.SquadCombat(Cesium, viewer, {
outlineMaterial: new Cesium.PolylineDashMaterialProperty({ // outlineMaterial: new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.RED, // color: Cesium.Color.RED,
dashLength: 16.0, // dashLength: 16.0,
}), // }),
}); });
break; break;
case 'drawSwallowtailSquadCombat': case 'drawSwallowtailSquadCombat':
@ -111,7 +111,7 @@ window.onload = () => {
break; break;
case 'drawStraightArrow': case 'drawStraightArrow':
geometry = new CesiumPlot.StraightArrow(Cesium, viewer, { geometry = new CesiumPlot.StraightArrow(Cesium, viewer, {
material: Cesium.Color.RED, // material: Cesium.Color.RED,
}); });
break; break;
case 'drawAssaultDirection': case 'drawAssaultDirection':
@ -119,12 +119,12 @@ window.onload = () => {
break; break;
case 'drawCurvedArrow': case 'drawCurvedArrow':
geometry = new CesiumPlot.CurvedArrow(Cesium, viewer, { geometry = new CesiumPlot.CurvedArrow(Cesium, viewer, {
material: Cesium.Color.BLUE, // material: Cesium.Color.BLUE,
}); });
break; break;
case 'drawDoubleArrow': case 'drawDoubleArrow':
geometry = new CesiumPlot.DoubleArrow(Cesium, viewer, { geometry = new CesiumPlot.DoubleArrow(Cesium, viewer, {
outlineMaterial: Cesium.Color.GREEN, // outlineMaterial: Cesium.Color.GREEN,
}); });
break; break;
case 'drawFreehandLine': case 'drawFreehandLine':
@ -141,9 +141,9 @@ window.onload = () => {
break; break;
case 'drawFreehandPolygon': case 'drawFreehandPolygon':
geometry = new CesiumPlot.FreehandPolygon(Cesium, viewer, { geometry = new CesiumPlot.FreehandPolygon(Cesium, viewer, {
material: Cesium.Color.GREEN, // material: Cesium.Color.GREEN,
outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'), // outlineMaterial: Cesium.Color.fromCssColorString('rgba(59, 178, 208, 1)'),
outlineWidth: 2, // outlineWidth: 2,
}); });
break; break;
case 'hide': case 'hide':