|
| 1 | +import { WmsLayer } from '@terrestris/ol-util'; |
1 | 2 | import { DatePicker, Popover, Select } from 'antd';
|
2 | 3 | import dayjs from 'dayjs';
|
3 | 4 | import _isEqual from 'lodash/isEqual';
|
4 | 5 | import _isFinite from 'lodash/isFinite';
|
5 | 6 | import moment, { Moment } from 'moment';
|
6 | 7 | import { getUid } from 'ol';
|
7 |
| -import OlLayer from 'ol/layer/Layer'; |
8 |
| -import OlImageWMS from 'ol/source/ImageWMS'; |
9 |
| -import OlTileWMS from 'ol/source/TileWMS'; |
10 | 8 | import React, { memo, useCallback, useEffect, useRef, useState } from 'react';
|
11 | 9 | const RangePicker = DatePicker.RangePicker;
|
12 | 10 | const Option = Select.Option;
|
@@ -41,7 +39,7 @@ export type PlaybackSpeedType = 'hours' | 'days' | 'weeks' | 'months' | 'years';
|
41 | 39 | export interface TimeLayerSliderPanelProps {
|
42 | 40 | className?: string;
|
43 | 41 | onChange?: (arg: moment.Moment) => void;
|
44 |
| - timeAwareLayers: OlLayer<OlImageWMS | OlTileWMS>[]; |
| 42 | + timeAwareLayers: WmsLayer[]; |
45 | 43 | value?: moment.Moment;
|
46 | 44 | dateFormat?: string;
|
47 | 45 | tooltips?: Tooltips;
|
@@ -95,7 +93,7 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = memo(
|
95 | 93 |
|
96 | 94 | const wrapTimeSlider = useCallback(() => {
|
97 | 95 | const wmsTimeLayers: TimeLayerAwareConfig[] = [];
|
98 |
| - timeAwareLayers.forEach((l: OlLayer<OlImageWMS | OlTileWMS>) => { |
| 96 | + timeAwareLayers.forEach(l => { |
99 | 97 | if (l.get('type') === 'WMSTime') {
|
100 | 98 | wmsTimeLayers.push({ layer: l });
|
101 | 99 | }
|
@@ -188,7 +186,7 @@ export const TimeLayerSliderPanel: React.FC<TimeLayerSliderPanelProps> = memo(
|
188 | 186 | const startDatesFromLayers: moment.Moment[] = [];
|
189 | 187 | const endDatesFromLayers: moment.Moment[] = [];
|
190 | 188 |
|
191 |
| - timeAwareLayers.forEach((l: OlLayer<OlImageWMS | OlTileWMS, any>) => { |
| 189 | + timeAwareLayers.forEach(l => { |
192 | 190 | const layerType = l.get('type');
|
193 | 191 | if (layerType === 'WMSTime') {
|
194 | 192 | const layerStartDate = l.get('startDate');
|
|
0 commit comments