AnsweredAssumed Answered

Setting Pro's Time Slider via the SDK

Question asked by gov.usda.fas.ipad.greenc on Aug 1, 2019
Latest reply on Aug 5, 2019 by gov.usda.fas.ipad.greenc

I'd like to be able to set the Pro's Time Slider up w/ some initial settings should the user not have already done so. This would be useful when a time-capable layer is added and would save the user some steps (e.g., given a data source, set an applicable "Current Time" (works), step, snapping, etc.). Other than that current time, however, everything else I set seems to be ignored using the code below. I brought up the CIM Viewer, and, funny enough, my settings seem to show up in the map's CIM xml, but aren't reflected in the slider. Changing things on the slider and refreshing the CIM Viewer does update the XML, but, when I attempt to do so the other way, the changes aren't reflected in the slider. 

 

I'm at a loss and likely going about this wrong. I appreciated any ideas anyone might have.  Thanks.

 

// first line works fine w/ a range created and set to applicable start/end

MapView.Active.Time = timeRange;

CIMMap cimMap = _map.GetDefinition();
CIMSliderSettings slider = cimMap.TimeSliderSettings ?? new CIMSliderSettings();
slider.InteractionMode = SliderInteractionMode.Slider;
slider.StepOption = SliderStepType.Interval;
slider.StepIntervalValue = 1;
slider.StepIntervalUnit = "days";
slider.StepUsesWindow = false;
slider.UseTimeSnapping = true;
slider.TimeSnapMode = TimeSnapMode.Single;
slider.SingleTimeSnapUnit = "days";
slider.IsMinimized = false;
cimMap.TimeSliderSettings = slider;
MapView.Active.Map.SetDefinition(cimMap);

Outcomes