Do graphics layers support the time extent property on the mapview. If so, how do i define the individual graphics time extent, or start/end.

4957
2
Jump to solution
11-18-2014 11:55 AM
vincentvassallo
New Contributor III

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

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Frequent Contributor

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" }
    );
  }
}

View solution in original post

2 Replies
dotMorten_esri
Esri Frequent Contributor

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" }
    );
  }
}

View solution in original post

vincentvassallo
New Contributor III

Thank you. I will give this a try.

0 Kudos