Hi everyone. I need to make a gradient for PolylineGraphics. If its height is up to 1000, the color of the polyline segment is blue, if it is up to 3000 - yellow, if it is over 3000 - red. How to do it?
let entity = new Entity({
id: item.UID,
name: item.name,
icon_type: item.icon_type,
position: Cartesian3.fromDegrees(
item!.L * Math.DEGREES_PER_RADIAN,
item!.B * Math.DEGREES_PER_RADIAN,
item!.H
),
orientation: new CallbackProperty(() => {
return orientation;
}, false),
});
entity.polyline = new PolylineGraphics({
positions: new CallbackProperty(() => {
let points = WallAirData!.get(item!.UID)
let arrayHeights = [
points[points.length - 3],
points[points.length - 2],
points[points.length - 1],
points[points.length - 3],
points[points.length - 2],
0
]
return Cartesian3.fromDegreesArrayHeights(arrayHeights)
}, false),
show: storeProjectionStatusAll
})