I must be doing something simply wrong because I am not sure after reading the documents how to show a polyline collection in Cesium. I am not explicitly seeing any method or tutorial in the documentation here about displaying the polyline collection. Nor are there any tutorials in the sand box that I can find that seem more on point that this one, which only displays singular polylines with
viewer.entites.add(Polyline)
I have tried using the example code for PolylineCollection's add (and suggestion for iteration then toggling) in this sandbox, but nothing is displayed, and no errors are shown:
// 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;
}
I'm not sure what other means the documentation would point me towards to render these. Any help is appreciated.