Hi,
I am using cesium 2.0, I tried to update polyline material with new property with PolylineArrowMaterialProperty. It's not updating color of the line.
var line1 = entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([0, 0, 36000000, 38.8, 0.8, 40022479]),
width : 10,
followSurface : false,
material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.BLUE)
}
});
var line2 = entities.add({
polyline : {
positions : Cesium.Cartesian3.fromDegreesArrayHeights([0, 0, 36000000, 36.5, -1.16, 42047591]),
width : 10,
followSurface : false,
material : new Cesium.PolylineArrowMaterialProperty(Cesium.Color.BLUE)
}
});
viewer.zoomTo(line2, new Cesium.HeadingPitchRange(0, Cesium.Math.toRadians(-120)));
Sandcastle.addToolbarButton('Change color to red', function() {
line1.polyline.material = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED);
line2.polyline.material = new Cesium.PolylineArrowMaterialProperty(Cesium.Color.RED);
});
I think there is a issue with PolylineArrowMaterialProperty API. I think PolylineArrowMaterialProperty act a singleton.
Please let me know how to change line color.