Skip to content

Commit

Permalink
Fix reopening of layer timeslider
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasstein committed Feb 12, 2024
1 parent 2c8815e commit 8e4e8e2
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class TimeSliderTocActionDefinitionFactory {
that.timeExtentWatcher = timeSliderWidget.watch("timeExtent", (value) => {
layer.timeExtent = value;
});
this.supressLayerDefaults(layer, timeSliderProperties, timeSliderWidget);
this.supressLayerDefaults(layer, timeSliderProperties, timeSliderWidget, controller);
const widget = new (EsriDijit as any)(timeSliderWidget);
const serviceProperties = {
"widgetRole": "layerTimeSliderWidget"
Expand All @@ -97,10 +97,12 @@ export default class TimeSliderTocActionDefinitionFactory {
}, that.delay);
},

supressLayerDefaults(layer: ExtendedLayer, props: InjectedReference<Record<string, any>>, widget: any) {
supressLayerDefaults(layer: ExtendedLayer, props: InjectedReference<Record<string, any>>,
widget: any, controller: TimeSliderWidgetController) {
const timeSliderProperties = controller.getTimeSliderProperties(props);
if (props) {
layer.timeInfo.fullTimeExtent = props.fullTimeExtent;
layer.stops = props.stops;
layer.timeInfo.fullTimeExtent = timeSliderProperties.fullTimeExtent;
layer.stops = timeSliderProperties.stops;
} else if (widget.fullTimeExtent) {
layer.timeInfo.fullTimeExtent = widget.fullTimeExtent;
layer.stops = widget.stops;
Expand Down

0 comments on commit 8e4e8e2

Please sign in to comment.