【发布时间】:2017-01-10 22:24:09
【问题描述】:
我一定是做错了什么,因为我在阅读文档后不确定如何在 Cesium 中显示折线集合。我没有在文档here 中明确看到有关显示折线集合的任何方法或教程。沙盒中也没有任何教程,我可以找到更贴切的 this one,它只显示带有
的奇异折线viewer.entites.add(Polyline)
我已尝试在此沙箱中使用 PolylineCollection 的添加示例代码(以及迭代然后切换的建议),但没有显示任何内容,也没有显示错误:
// Create a polyline collection with two polylines
var polylines = new Cesium.PolylineCollection();
polylines.add({
positions : Cesium.Cartesian3.fromDegreesArray([
-75.10, 39.57,
-77.02, 38.53,
-80.50, 35.14,
-80.12, 25.46]),
width : 2
});
polylines.add({
positions : Cesium.Cartesian3.fromDegreesArray([
-73.10, 37.57,
-75.02, 36.53,
-78.50, 33.14,
-78.12, 23.46]),
width : 4
});
// Toggle the show property of every polyline in the collection
var len = polylines.length;
for (var i = 0; i < len; ++i) {
var p = polylines.get(i);
p.show = true;
}
我不确定文档会指向我呈现这些的其他方式。任何帮助表示赞赏。
【问题讨论】:
标签: javascript cesium