-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathTrafficSignHelper.ts
335 lines (331 loc) · 11.2 KB
/
TrafficSignHelper.ts
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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
import barrier from "./svg/barrier.svg";
import barrier2S from "./svg/barrier2S.svg";
import beaconArrowL from "./svg/beaconArrowL.svg";
import beaconArrowR from "./svg/beaconArrowR.svg";
import beaconHatchedWide from "./svg/beaconHatchedWide.svg";
import beaconHatchedWideL from "./svg/beaconHatchedWideL.svg";
import beaconHatchedWideR from "./svg/beaconHatchedWideR.svg";
import beaconL from "./svg/beaconL.svg";
import beaconL2S from "./svg/beaconL2S.svg";
import beaconR from "./svg/beaconR.svg";
import beaconR2S from "./svg/beaconR2S.svg";
import caution from "./svg/caution.svg";
import children from "./svg/children.svg";
import crossroads from "./svg/crossroads.svg";
import curveL from "./svg/curveL.svg";
import curveR from "./svg/curveR.svg";
import cyclistsCrossing from "./svg/cyclistsCrossing.svg";
import cyclistsCrossingL from "./svg/cyclistsCrossingL.svg";
import cyclistsCrossingR from "./svg/cyclistsCrossingR.svg";
import deadEnd from "./svg/deadEnd.svg";
import directionBoardL from "./svg/directionBoardL.svg";
import directionBoardR from "./svg/directionBoardR.svg";
import directionBoardWideL from "./svg/directionBoardWideL.svg";
import directionBoardWideR from "./svg/directionBoardWideR.svg";
import diversionL from "./svg/diversionL.svg";
import diversionR from "./svg/diversionR.svg";
import endOfLimitations from "./svg/endOfLimitations.svg";
import exitHighway from "./svg/exitHighway.svg";
import exitInnerCityRoad from "./svg/exitInnerCityRoad.svg";
import exitLimitedAccessRoad from "./svg/exitLimitedAccessRoad.svg";
import fileUnknown from "./svg/fileUnknown.svg";
import giveWay from "./svg/giveWay.svg";
import highway from "./svg/highway.svg";
import highwayEnd from "./svg/highwayEnd.svg";
import icy from "./svg/icy.svg";
import limitedAccessRoad from "./svg/limitedAccessRoad.svg";
import limitedAccessRoadEnd from "./svg/limitedAccessRoadEnd.svg";
import livingStreet from "./svg/livingStreet.svg";
import livingStreetEnd from "./svg/livingStreetEnd.svg";
import minimumSpeed30 from "./svg/minimumSpeed30.svg";
import minimumSpeedEnd30 from "./svg/minimumSpeedEnd30.svg";
import narrowRoad from "./svg/narrowRoad.svg";
import narrowRoadL from "./svg/narrowRoadL.svg";
import narrowRoadR from "./svg/narrowRoadR.svg";
import noEntry from "./svg/noEntry.svg";
import noOvertaking from "./svg/noOvertaking.svg";
import noOvertakingEnd from "./svg/noOvertakingEnd.svg";
import noOvertakingTrucks from "./svg/noOvertakingTrucks.svg";
import noOvertakingTrucksEnd from "./svg/noOvertakingTrucksEnd.svg";
import noTraffic from "./svg/noTraffic.svg";
import oneWayLeft from "./svg/oneWayLeft.svg";
import oneWayRight from "./svg/oneWayRight.svg";
import oneWayStraight from "./svg/oneWayStraight.svg";
import parkingGarage from "./svg/parkingGarage.svg";
import parkingLot from "./svg/parkingLot.svg";
import passL from "./svg/passL.svg";
import passR from "./svg/passR.svg";
import pedestrianCrossing from "./svg/pedestrianCrossing.svg";
import pedestrians from "./svg/pedestrians.svg";
import priorityRoad from "./svg/priorityRoad.svg";
import priorityRoadEnd from "./svg/priorityRoadEnd.svg";
import rightOfWay from "./svg/rightOfWay.svg";
import roadWorks from "./svg/roadWorks.svg";
import roundabout from "./svg/roundabout.svg";
import sCurveL from "./svg/sCurveL.svg";
import sCurveR from "./svg/sCurveR.svg";
import slipperyRoad from "./svg/slipperyRoad.svg";
import speedLimit10 from "./svg/speedLimit10.svg";
import speedLimit100 from "./svg/speedLimit100.svg";
import speedLimit110 from "./svg/speedLimit110.svg";
import speedLimit120 from "./svg/speedLimit120.svg";
import speedLimit130 from "./svg/speedLimit130.svg";
import speedLimit20 from "./svg/speedLimit20.svg";
import speedLimit30 from "./svg/speedLimit30.svg";
import speedLimit40 from "./svg/speedLimit40.svg";
import speedLimit5 from "./svg/speedLimit5.svg";
import speedLimit50 from "./svg/speedLimit50.svg";
import speedLimit60 from "./svg/speedLimit60.svg";
import speedLimit70 from "./svg/speedLimit70.svg";
import speedLimit80 from "./svg/speedLimit80.svg";
import speedLimit90 from "./svg/speedLimit90.svg";
import speedLimitEnd10 from "./svg/speedLimitEnd10.svg";
import speedLimitEnd100 from "./svg/speedLimitEnd100.svg";
import speedLimitEnd110 from "./svg/speedLimitEnd110.svg";
import speedLimitEnd120 from "./svg/speedLimitEnd120.svg";
import speedLimitEnd130 from "./svg/speedLimitEnd130.svg";
import speedLimitEnd20 from "./svg/speedLimitEnd20.svg";
import speedLimitEnd30 from "./svg/speedLimitEnd30.svg";
import speedLimitEnd40 from "./svg/speedLimitEnd40.svg";
import speedLimitEnd5 from "./svg/speedLimitEnd5.svg";
import speedLimitEnd50 from "./svg/speedLimitEnd50.svg";
import speedLimitEnd60 from "./svg/speedLimitEnd60.svg";
import speedLimitEnd70 from "./svg/speedLimitEnd70.svg";
import speedLimitEnd80 from "./svg/speedLimitEnd80.svg";
import speedLimitEnd90 from "./svg/speedLimitEnd90.svg";
import speedLimitZone30 from "./svg/speedLimitZone30.svg";
import speedLimitZoneEnd30 from "./svg/speedLimitZoneEnd30.svg";
import steepAscent10 from "./svg/steepAscent10.svg";
import steepAscent11 from "./svg/steepAscent11.svg";
import steepAscent12 from "./svg/steepAscent12.svg";
import steepAscent13 from "./svg/steepAscent13.svg";
import steepAscent14 from "./svg/steepAscent14.svg";
import steepAscent15 from "./svg/steepAscent15.svg";
import steepAscent16 from "./svg/steepAscent16.svg";
import steepAscent17 from "./svg/steepAscent17.svg";
import steepAscent18 from "./svg/steepAscent18.svg";
import steepAscent19 from "./svg/steepAscent19.svg";
import steepAscent20 from "./svg/steepAscent20.svg";
import steepAscent21 from "./svg/steepAscent21.svg";
import steepAscent22 from "./svg/steepAscent22.svg";
import steepAscent23 from "./svg/steepAscent23.svg";
import steepAscent24 from "./svg/steepAscent24.svg";
import steepAscent25 from "./svg/steepAscent25.svg";
import steepAscent4 from "./svg/steepAscent4.svg";
import steepAscent5 from "./svg/steepAscent5.svg";
import steepAscent6 from "./svg/steepAscent6.svg";
import steepAscent7 from "./svg/steepAscent7.svg";
import steepAscent8 from "./svg/steepAscent8.svg";
import steepAscent9 from "./svg/steepAscent9.svg";
import steepDescent10 from "./svg/steepDescent10.svg";
import steepDescent11 from "./svg/steepDescent11.svg";
import steepDescent12 from "./svg/steepDescent12.svg";
import steepDescent13 from "./svg/steepDescent13.svg";
import steepDescent14 from "./svg/steepDescent14.svg";
import steepDescent15 from "./svg/steepDescent15.svg";
import steepDescent16 from "./svg/steepDescent16.svg";
import steepDescent17 from "./svg/steepDescent17.svg";
import steepDescent18 from "./svg/steepDescent18.svg";
import steepDescent19 from "./svg/steepDescent19.svg";
import steepDescent20 from "./svg/steepDescent20.svg";
import steepDescent21 from "./svg/steepDescent21.svg";
import steepDescent22 from "./svg/steepDescent22.svg";
import steepDescent23 from "./svg/steepDescent23.svg";
import steepDescent24 from "./svg/steepDescent24.svg";
import steepDescent25 from "./svg/steepDescent25.svg";
import steepDescent4 from "./svg/steepDescent4.svg";
import steepDescent5 from "./svg/steepDescent5.svg";
import steepDescent6 from "./svg/steepDescent6.svg";
import steepDescent7 from "./svg/steepDescent7.svg";
import steepDescent8 from "./svg/steepDescent8.svg";
import steepDescent9 from "./svg/steepDescent9.svg";
import stop from "./svg/stop.svg";
import straightOrLeft from "./svg/straightOrLeft.svg";
import straightOrRight from "./svg/straightOrRight.svg";
import trafficLight from "./svg/trafficLight.svg";
import trafficQueues from "./svg/trafficQueues.svg";
import tunnel from "./svg/tunnel.svg";
import turnAheadL from "./svg/turnAheadL.svg";
import turnAheadR from "./svg/turnAheadR.svg";
import turnL from "./svg/turnL.svg";
import turnR from "./svg/turnR.svg";
import unevenRoad from "./svg/unevenRoad.svg";
import urbanArea from "./svg/urbanArea.svg";
import urbanAreaEnd from "./svg/urbanAreaEnd.svg";
import warningPedestrianCrossing from "./svg/warningPedestrianCrossing.svg";
import weightLimit from "./svg/weightLimit.svg";
import widthLimit from "./svg/widthLimit.svg";
// type for an object/dictionary to map road sign image urls to the road sign image name
type RoadSignsObject = {
[key: string]: string;
};
// object containing all road sign imports
const roadSigns: RoadSignsObject = {
barrier,
barrier2S,
beaconArrowL,
beaconArrowR,
beaconHatchedWide,
beaconHatchedWideL,
beaconHatchedWideR,
beaconL,
beaconL2S,
beaconR,
beaconR2S,
caution,
children,
crossroads,
curveL,
curveR,
cyclistsCrossing,
cyclistsCrossingL,
cyclistsCrossingR,
deadEnd,
directionBoardL,
directionBoardR,
directionBoardWideL,
directionBoardWideR,
diversionL,
diversionR,
endOfLimitations,
exitHighway,
exitInnerCityRoad,
exitLimitedAccessRoad,
fileUnknown,
giveWay,
highway,
highwayEnd,
icy,
limitedAccessRoad,
limitedAccessRoadEnd,
livingStreet,
livingStreetEnd,
minimumSpeed30,
minimumSpeedEnd30,
narrowRoad,
narrowRoadL,
narrowRoadR,
noEntry,
noOvertaking,
noOvertakingEnd,
noOvertakingTrucks,
noOvertakingTrucksEnd,
noTraffic,
oneWayLeft,
oneWayRight,
oneWayStraight,
parkingGarage,
parkingLot,
passL,
passR,
pedestrianCrossing,
pedestrians,
priorityRoad,
priorityRoadEnd,
rightOfWay,
roadWorks,
roundabout,
sCurveL,
sCurveR,
slipperyRoad,
speedLimit10,
speedLimit100,
speedLimit110,
speedLimit120,
speedLimit130,
speedLimit20,
speedLimit30,
speedLimit40,
speedLimit5,
speedLimit50,
speedLimit60,
speedLimit70,
speedLimit80,
speedLimit90,
speedLimitEnd10,
speedLimitEnd100,
speedLimitEnd110,
speedLimitEnd120,
speedLimitEnd130,
speedLimitEnd20,
speedLimitEnd30,
speedLimitEnd40,
speedLimitEnd5,
speedLimitEnd50,
speedLimitEnd60,
speedLimitEnd70,
speedLimitEnd80,
speedLimitEnd90,
speedLimitZone30,
speedLimitZoneEnd30,
steepAscent10,
steepAscent11,
steepAscent12,
steepAscent13,
steepAscent14,
steepAscent15,
steepAscent16,
steepAscent17,
steepAscent18,
steepAscent19,
steepAscent20,
steepAscent21,
steepAscent22,
steepAscent23,
steepAscent24,
steepAscent25,
steepAscent4,
steepAscent5,
steepAscent6,
steepAscent7,
steepAscent8,
steepAscent9,
steepDescent10,
steepDescent11,
steepDescent12,
steepDescent13,
steepDescent14,
steepDescent15,
steepDescent16,
steepDescent17,
steepDescent18,
steepDescent19,
steepDescent20,
steepDescent21,
steepDescent22,
steepDescent23,
steepDescent24,
steepDescent25,
steepDescent4,
steepDescent5,
steepDescent6,
steepDescent7,
steepDescent8,
steepDescent9,
stop,
straightOrLeft,
straightOrRight,
trafficLight,
trafficQueues,
tunnel,
turnAheadL,
turnAheadR,
turnL,
turnR,
unevenRoad,
urbanArea,
urbanAreaEnd,
warningPedestrianCrossing,
weightLimit,
widthLimit
};
/**
* For a given sign type and value from the json road file, the function will return the imported instance of the sign. If not, an unknownFile will be imported.
* @param {string} type The type of sign.
* @returns {string} The imported image string.
*/
const getRoadSignName = (type: string) => {
// no svg exists, return generic unknown file
return roadSigns[`${type}`] ?? fileUnknown;
};
export { getRoadSignName };