提交 77af72fc 编写于 作者: weixin_48223654's avatar weixin_48223654

生产代码片段

上级 ca207a2f
console.log("欢迎来到 InsCode");
\ No newline at end of file
// 创建场景
var viewer = new Cesium.Viewer('cesiumContainer');
// 创建起点和终点
var startPoint = Cesium.Cartesian3.fromDegrees(-75.59777, 40.03883);
var endPoint = Cesium.Cartesian3.fromDegrees(-80.03729, 34.52754);
// 创建虚线材质
var dashMaterial = new Cesium.PolylineDashMaterialProperty({
color: Cesium.Color.YELLOW
});
// 创建箭头材质
var arrowMaterial = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.YELLOW);
// 创建虚线箭头
var polyline = viewer.entities.add({
name: '虚线箭头',
polyline: {
positions: [startPoint, endPoint],
width: 5,
material: dashMaterial,
dashLength: 20.0,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 100000.0),
clampToGround: true,
show: true
}
});
// 创建箭头
var arrow = viewer.entities.add({
name: '箭头',
polyline: {
positions: [endPoint, Cesium.Cartesian3.add(endPoint, new Cesium.Cartesian3(10000, 0, 0), new Cesium.Cartesian3())],
width: 10,
material: arrowMaterial,
distanceDisplayCondition: new Cesium.DistanceDisplayCondition(0.0, 100000.0),
clampToGround: true,
show: true
}
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册