-
Notifications
You must be signed in to change notification settings - Fork 60
Expand file tree
/
Copy pathActions.ts
More file actions
225 lines (172 loc) · 5.24 KB
/
Actions.ts
File metadata and controls
225 lines (172 loc) · 5.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
import { Action } from '@/stores/Dispatcher'
import { Coordinate, CustomModel, QueryPoint } from '@/stores/QueryStore'
import { ApiInfo, Bbox, Path, RoutingArgs, RoutingProfile, RoutingResult } from '@/api/graphhopper'
import { PathDetailsPoint } from '@/stores/PathDetailsStore'
export class InfoReceived implements Action {
readonly result: ApiInfo
constructor(result: ApiInfo) {
this.result = result
}
}
export class SetPoint implements Action {
readonly point: QueryPoint
readonly zoom: boolean
constructor(point: QueryPoint, zoom: boolean) {
this.point = point
this.zoom = zoom
}
}
export class SetVehicleProfile implements Action {
readonly profile: RoutingProfile
constructor(profile: RoutingProfile) {
this.profile = profile
}
}
export class AddPoint implements Action {
readonly atIndex: number
readonly coordinate: Coordinate
readonly isInitialized: boolean
constructor(atIndex: number, coordinate: Coordinate, isInitialized: boolean) {
this.atIndex = atIndex
this.coordinate = coordinate
this.isInitialized = isInitialized
}
}
export class SetQueryPoints implements Action {
readonly queryPoints: QueryPoint[]
constructor(queryPoints: QueryPoint[]) {
this.queryPoints = queryPoints
}
}
export class ClearPoints implements Action {}
export class RemovePoint implements Action {
readonly point: QueryPoint
constructor(point: QueryPoint) {
this.point = point
}
}
export class MovePoint implements Action {
readonly point: QueryPoint
readonly newIndex: number
constructor(point: QueryPoint, newIndex: number) {
this.point = point
this.newIndex = newIndex
}
}
export class InvalidatePoint implements Action {
readonly point: QueryPoint
constructor(point: QueryPoint) {
this.point = point
}
}
export class SetCustomModelEnabled implements Action {
readonly enabled: boolean
constructor(enabled: boolean) {
this.enabled = enabled
}
}
export class SetCustomModel implements Action {
readonly customModelStr: string
readonly issueRoutingRequest: boolean
constructor(customModelStr: string, issueRoutingRequest: boolean) {
this.customModelStr = customModelStr
this.issueRoutingRequest = issueRoutingRequest
}
}
export class RouteRequestSuccess implements Action {
readonly result: RoutingResult
readonly request: RoutingArgs
constructor(request: RoutingArgs, result: RoutingResult) {
this.result = result
this.request = request
}
}
export class ErrorAction implements Action {
readonly message: string
constructor(message: string) {
this.message = message
}
}
export class RouteRequestFailed extends ErrorAction {
readonly request: RoutingArgs
constructor(request: RoutingArgs, message: string) {
super(message)
this.request = request
}
}
export class ClearRoute implements Action {}
export class SetSelectedPath implements Action {
readonly path: Path
constructor(path: Path) {
this.path = path
}
}
export class DismissLastError implements Action {}
export class SelectMapLayer implements Action {
readonly layer: string
constructor(layer: string) {
this.layer = layer
}
}
export class ToggleRoutingGraph implements Action {
readonly routingGraphEnabled: boolean
constructor(routingGraphEnabled: boolean) {
this.routingGraphEnabled = routingGraphEnabled
}
}
export class ToggleUrbanDensityLayer implements Action {
readonly urbanDensityEnabled: boolean
constructor(urbanDensityEnabled: boolean) {
this.urbanDensityEnabled = urbanDensityEnabled
}
}
export class MapIsLoaded implements Action {}
export class ZoomMapToPoint implements Action {
readonly coordinate: Coordinate
readonly zoom: number
constructor(coordinate: Coordinate, zoom: number) {
this.coordinate = coordinate
this.zoom = zoom
}
}
export class SetInitialBBox implements Action {
readonly bbox: Bbox
constructor(bbox: Bbox) {
this.bbox = bbox
}
}
export class PathDetailsHover implements Action {
readonly pathDetailsPoint: PathDetailsPoint | null
constructor(pathDetailsPoint: PathDetailsPoint | null) {
this.pathDetailsPoint = pathDetailsPoint
}
}
export class PathDetailsRangeSelected implements Action {
readonly bbox: Bbox | null
constructor(bbox: Bbox | null) {
this.bbox = bbox
}
}
export class PathDetailsElevationSelected implements Action {
readonly segments: Coordinate[][]
constructor(segments: Coordinate[][]) {
this.segments = segments
}
}
export class RoutingGraphHover implements Action {
readonly point: Coordinate | null
readonly properties: object
constructor(point: Coordinate | null, properties: object) {
this.point = point
this.properties = properties
}
}
export class InstructionClicked implements Action {
readonly coordinate: Coordinate | null
readonly text: string
constructor(point: Coordinate | null, text: string) {
this.coordinate = point
this.text = text
}
}
export class ToggleDistanceUnits implements Action {}