I'm coming from the WPF sdk where you defined the time extent on the map and layers and then each individual graphic had a TimeExtent property to set. This doesn't exist in the .net sdk, do I set attributes to the TimeExtent? If so how do I define what attribute I am using?
Thanks,
Vincent Vassallo
Solved! Go to Solution.
This approach in the .NET Runtime is by subclassing GraphicsLayer and defining what attributes controls the start/end times of the graphics.
In the subclass you will need to override the 'OnInitializeGraphicsLayerRequestedAsync' method, and return a 'GraphicsLayerInitializationInfo' object with the fields set for TimeStartField and TimeEndField.
You don't need to set a time extent on the graphics - The two attribute fields specified in the initialize method are automatically pulling it out from the graphics.
Ex:
public class MyTimeGraphicsLayer : GraphicsLayer { protected override Task<GraphicsLayerInitializationInfo> OnInitializeGraphicsLayerRequestedAsync() { return Task.FromResult( new GraphicsLayerInitializationInfo() { TimeStartField = "Start", TimeEndField = "End" } ); } }
This approach in the .NET Runtime is by subclassing GraphicsLayer and defining what attributes controls the start/end times of the graphics.
In the subclass you will need to override the 'OnInitializeGraphicsLayerRequestedAsync' method, and return a 'GraphicsLayerInitializationInfo' object with the fields set for TimeStartField and TimeEndField.
You don't need to set a time extent on the graphics - The two attribute fields specified in the initialize method are automatically pulling it out from the graphics.
Ex:
public class MyTimeGraphicsLayer : GraphicsLayer { protected override Task<GraphicsLayerInitializationInfo> OnInitializeGraphicsLayerRequestedAsync() { return Task.FromResult( new GraphicsLayerInitializationInfo() { TimeStartField = "Start", TimeEndField = "End" } ); } }
Thank you. I will give this a try.