diff --git a/packages/landing/src/components/daterange.tsx b/packages/landing/src/components/daterange.tsx index 572d3376b..1ee98c1f8 100644 --- a/packages/landing/src/components/daterange.tsx +++ b/packages/landing/src/components/daterange.tsx @@ -11,8 +11,6 @@ export interface DateRangeState { export class DateRange extends Component { state: DateRangeState = { after: MinDate, before: MaxDate }; - private _scheduled: number | NodeJS.Timeout | undefined; - private _raf = 0; get yearAfter(): string { return Config.map.filter.date.after == null ? MinDate.slice(0, 4) : Config.map.filter.date.after.slice(0, 4); @@ -22,19 +20,6 @@ export class DateRange extends Component { return Config.map.filter.date.before == null ? MaxDate.slice(0, 4) : Config.map.filter.date.before.slice(0, 4); } - private scheduleUpdateConfig(): void { - if (this._scheduled != null || this._raf !== 0) return; - this._scheduled = setTimeout(() => { - this._scheduled = undefined; - this._raf = requestAnimationFrame(this.updateConfig); - }, 200); - } - - updateConfig = (): void => { - this._raf = 0; - Config.map.setFilterDateRange(this.state.after, this.state.before); - }; - handleChange = (event: React.ChangeEvent, id: 'before' | 'after'): void => { switch (id) { case 'after': @@ -44,7 +29,7 @@ export class DateRange extends Component { this.setState({ before: `${event.target.value}-12-31T23:59:59.999Z` }); break; } - this.scheduleUpdateConfig(); + Config.map.setFilterDateRange(this.state.after, this.state.before); }; render(): ReactNode { diff --git a/packages/landing/src/components/map.tsx b/packages/landing/src/components/map.tsx index 307b32a57..37324240f 100644 --- a/packages/landing/src/components/map.tsx +++ b/packages/landing/src/components/map.tsx @@ -93,7 +93,7 @@ export class Basemaps extends Component { - if (!Config.map.visibleLayers) Config.map.visibleLayers = newLayers; + if (Config.map.visibleLayers == null) Config.map.visibleLayers = newLayers; if (newLayers !== Config.map.visibleLayers) { Config.map.visibleLayers = newLayers; const newStyleId =