How can i disable time in the map view in the same way that it is disabled when the "Disable Time" button is clicked by a user on the time slider?
I understand how to set a time range by setting a "Start" and "End" value, i.e.
MapView mapView = MapView.Active;
if (mapView == null)
return;
DateTime startDateTime = new DateTime(2016, 1, 1);
DateTime endDateTime = new DateTime(2016, 2, 26);
mapView.Time.Start = startDateTime;
mapView.Time.End = endDateTime;
And i also understand that if i set the "Start" and the "End" range to Null that this will mean the time range begins infinite in the past and future. However, what i would like to achieve is disabling the time slider altogether.
Solved! Go to Solution.
@Abhishek, thank you for your reply. My apologies, i should have been a little clearer in my question. I am actually wanting to know how to achieve this in "code behind" using c#.
Interestingly enough it appears as though my original suggestion of setting "Start" and "End" to Null achieved my goal of also disabling the time slider, although it wasn't initially apparent from the API documentation.
As reference for those looking to solve a similar problem, please see code below:
MapView mapView = MapView.Active;
if (mapView == null)
return;
mapView.Time.Start = null;
mapView.Time.End = null;
Dear Naveen,
Enter the layer properties by right-clicking the layer name in the Table of Contents pane.Navigate to the Time tab and uncheck the box.
@Abhishek, thank you for your reply. My apologies, i should have been a little clearer in my question. I am actually wanting to know how to achieve this in "code behind" using c#.
Interestingly enough it appears as though my original suggestion of setting "Start" and "End" to Null achieved my goal of also disabling the time slider, although it wasn't initially apparent from the API documentation.
As reference for those looking to solve a similar problem, please see code below:
MapView mapView = MapView.Active;
if (mapView == null)
return;
mapView.Time.Start = null;
mapView.Time.End = null;