diff --git a/packages/geoview-core/src/api/event-processors/event-processor-children/time-slider-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/time-slider-event-processor.ts index 6efe62f1fb6..95151f8153d 100644 --- a/packages/geoview-core/src/api/event-processors/event-processor-children/time-slider-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/time-slider-event-processor.ts @@ -109,7 +109,8 @@ export class TimeSliderEventProcessor extends AbstractEventProcessor { const name = getLocalizedValue(api.maps[mapId].layer.geoviewLayers[layerPath.split('/')[0]].geoviewLayerName, mapId) || layerPath; const temporalDimensionInfo = api.maps[mapId].layer.geoviewLayer(layerPath).getTemporalDimension(); const { range } = temporalDimensionInfo.range; - const defaultValue = temporalDimensionInfo.default; + const defaultValueIsArray = Array.isArray(temporalDimensionInfo.default); + const defaultValue = defaultValueIsArray ? temporalDimensionInfo.default[0] : temporalDimensionInfo.default; const minAndMax: number[] = [new Date(range[0]).getTime(), new Date(range[range.length - 1]).getTime()]; const { field, singleHandle } = temporalDimensionInfo; @@ -122,7 +123,12 @@ export class TimeSliderEventProcessor extends AbstractEventProcessor { const fieldIndex = localizedOutFields ? localizedOutFields.indexOf(field) : -1; if (fieldIndex !== -1 && localizedAliasFields?.length === localizedOutFields?.length) fieldAlias = localizedAliasFields![fieldIndex]; - const values = singleHandle ? [new Date(temporalDimensionInfo.default).getTime()] : [...minAndMax]; + // eslint-disable-next-line no-nested-ternary + const values = singleHandle + ? [new Date(temporalDimensionInfo.default).getTime()] + : defaultValueIsArray + ? [new Date(temporalDimensionInfo.default[0]).getTime(), new Date(temporalDimensionInfo.default[1]).getTime()] + : [...minAndMax]; const sliderData: TimeSliderLayerSet = { [layerPath]: {