1
- import { useReducerAsync } from ' use-reducer-async' ;
2
- import logReducer from ' ./log.ts' ;
3
- import { calculateStats , getFgbData } from ' ../map/utils.ts' ;
4
- import tArea from ' @turf/area' ;
5
- import tBboxPolygon from ' @turf/bbox-polygon' ;
1
+ import { useReducerAsync } from " use-reducer-async" ;
2
+ import logReducer from " ./log.ts" ;
3
+ import { calculateStats , getFgbData } from " ../map/utils.ts" ;
4
+ import tArea from " @turf/area" ;
5
+ import tBboxPolygon from " @turf/bbox-polygon" ;
6
6
7
7
export enum MapStatus {
8
- IDLE = ' IDLE' ,
9
- LOADING = ' LOADING' ,
10
- READY = ' READY' ,
8
+ IDLE = " IDLE" ,
9
+ LOADING = " LOADING" ,
10
+ READY = " READY" ,
11
11
}
12
12
13
13
export interface AppState {
@@ -18,12 +18,12 @@ export interface AppState {
18
18
}
19
19
20
20
export enum AppActionTypes {
21
- SET_MAP_REF = ' SET_MAP_REF' ,
22
- SET_CURRENT_TIMESTAMP = ' SET_CURRENT_TIMESTAMP' ,
23
- UPDATE_VIEW = ' UPDATE_VIEW' ,
24
- UPDATE_VIEW_START = ' UPDATE_VIEW_START' ,
25
- UPDATE_VIEW_SUCCESS = ' UPDATE_VIEW_SUCCESS' ,
26
- UPDATE_VIEW_ERROR = ' UPDATE_VIEW_ERROR' ,
21
+ SET_MAP_REF = " SET_MAP_REF" ,
22
+ SET_CURRENT_TIMESTAMP = " SET_CURRENT_TIMESTAMP" ,
23
+ UPDATE_VIEW = " UPDATE_VIEW" ,
24
+ UPDATE_VIEW_START = " UPDATE_VIEW_START" ,
25
+ UPDATE_VIEW_SUCCESS = " UPDATE_VIEW_SUCCESS" ,
26
+ UPDATE_VIEW_ERROR = " UPDATE_VIEW_ERROR" ,
27
27
}
28
28
29
29
export type AppAction =
@@ -57,7 +57,7 @@ export const appInitialState = {
57
57
map : undefined ,
58
58
mapStatus : MapStatus . IDLE ,
59
59
geojson : {
60
- type : ' FeatureCollection' ,
60
+ type : " FeatureCollection" ,
61
61
features : [ ] ,
62
62
} ,
63
63
} ;
@@ -66,7 +66,7 @@ export type AppReducer<State, Action> = (state: State, action: Action) => State;
66
66
67
67
function applyTimestampFilter ( geojson : any , timestamp : string ) {
68
68
return {
69
- type : ' FeatureCollection' ,
69
+ type : " FeatureCollection" ,
70
70
features : geojson . features . filter (
71
71
( f : any ) => f . properties . timestamp === timestamp
72
72
) ,
@@ -152,7 +152,7 @@ const asyncActionHandlers: any = {
152
152
153
153
const { geojson, timestamps } = await getFgbData ( map ) ;
154
154
155
- map . getSource ( ' data' ) . setData ( geojson ) ;
155
+ map . getSource ( " data" ) . setData ( geojson ) ;
156
156
157
157
dispatch ( {
158
158
type : AppActionTypes . UPDATE_VIEW_SUCCESS ,
@@ -161,7 +161,7 @@ const asyncActionHandlers: any = {
161
161
} catch ( error ) {
162
162
console . log ( error ) ;
163
163
alert (
164
- ' Unexpected error while loading the map, please see console log.'
164
+ " Unexpected error while loading the map, please see console log."
165
165
) ;
166
166
}
167
167
} ,
0 commit comments