//The layer must be track aware and spatial
if (streamLayer.TrackType != TrackType.Spatial)
return;
//Must be on QueuedTask!
//Define unique value classes same as we do for current observations
//or use "CreateRenderer(...)" to assign them automatically
CIMUniqueValueClass uvcB727Prev = new CIMUniqueValueClass()
{
Values = new CIMUniqueValue[] { new CIMUniqueValue() {
FieldValues = new string[] { "B727" } } },
Visible = true,
Label = "Boeing 727",
Symbol = SymbolFactory.Instance.ConstructPointSymbol(
CIMColor.CreateRGBColor(255, 0, 0), 4, SimpleMarkerStyle.Hexagon)
.MakeSymbolReference()
};
CIMUniqueValueClass uvcD9Prev = new CIMUniqueValueClass()
{
Values = new CIMUniqueValue[] { new CIMUniqueValue() {
FieldValues = new string[] { "DC9" } } },
Visible = true,
Label = "DC 9",
Symbol = SymbolFactory.Instance.ConstructPointSymbol(
CIMColor.CreateRGBColor(0, 255, 0), 4, SimpleMarkerStyle.Hexagon)
.MakeSymbolReference()
};
CIMUniqueValueGroup uvGrpPrev = new CIMUniqueValueGroup()
{
Classes = new CIMUniqueValueClass[] { uvcB727Prev, uvcD9Prev }
};
var UVrndrPrev = new CIMUniqueValueRenderer()
{
Fields = new string[] { "ACTYPE" },
Groups = new CIMUniqueValueGroup[] { uvGrpPrev },
UseDefaultSymbol = true,
DefaultLabel = "Others",
DefaultSymbol = SymbolFactory.Instance.ConstructPointSymbol(
CIMColor.CreateRGBColor(185, 185, 185), 4, SimpleMarkerStyle.Hexagon)
.MakeSymbolReference()
};
streamLayer.SetRenderer(UVrndr, FeatureRendererTarget.PreviousObservations);