Skip to content

Commit

Permalink
feat: support minutes in autoplay and seperate speed from unit
Browse files Browse the repository at this point in the history
  • Loading branch information
ahennr committed Jan 23, 2025
1 parent 6de4ff9 commit 6519b5c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Panel/TimeLayerSliderPanel/TimeLayerSliderPanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@
flex: 0 0 auto;
}

.speed-picker {
margin-right: 20px;
}

.ant-select-selection {
background-color: white;
width: 150px;
Expand Down
8 changes: 6 additions & 2 deletions src/Panel/TimeLayerSliderPanel/TimeLayerSliderPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ export type TimeLayerSliderPanelTooltips = {
dataRange: string;
days: string;
hours: string;
minutes: string;
months: string;
setToMostRecent: string;
weeks: string;
years: string;
};

export type PlaybackSpeedUnit = 'hours' | 'days' | 'weeks' | 'months' | 'years';
export type PlaybackSpeedUnit = 'minute' | 'hours' | 'days' | 'weeks' | 'months' | 'years';

export type TimeLayerSliderPanelProps = {
autoPlaySpeedOptions?: number[];
Expand All @@ -59,6 +60,7 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = ({
timeAwareLayers = [],
tooltips = {
setToMostRecent: 'Set to most recent date',
minutes: 'Minutes',
hours: 'Hours',
days: 'Days',
weeks: 'Weeks',
Expand Down Expand Up @@ -402,14 +404,16 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = ({
>
{speedOptions}
</Select>
<span>x</span>
<Select<PlaybackSpeedUnit>
className={extraCls + ' speed-picker'}
defaultValue={'hours'}
defaultValue={'minute'}
dropdownStyle={{ minWidth: '100px' }}
onChange={onPlaybackUnitChange}
popupMatchSelectWidth={false}
value={playbackSpeedUnit}
>
<Option value="minutes">{tooltips.minutes}</Option>
<Option value="hours">{tooltips.hours}</Option>
<Option value="days">{tooltips.days}</Option>
<Option value="weeks">{tooltips.weeks}</Option>
Expand Down

0 comments on commit 6519b5c

Please sign in to comment.