gtfs-to-html 2.5.8 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/config-sample.json +13 -4
- package/lib/file-utils.js +17 -10
- package/lib/formatters.js +37 -12
- package/lib/utils.js +3 -5
- package/package.json +9 -9
- package/public/css/timetable_styles.css +8 -8
- package/public/js/system-map.js +106 -119
- package/public/js/timetable-map.js +62 -59
- package/views/default/overview.pug +4 -4
- package/views/default/overview_full.pug +3 -3
- package/views/default/timetablepage.pug +10 -9
- package/views/default/timetablepage_full.pug +3 -3
- package/www/docs/configuration.md +9 -0
- package/www/package.json +2 -2
- package/www/yarn.lock +447 -446
package/public/js/system-map.js
CHANGED
|
@@ -3,24 +3,33 @@
|
|
|
3
3
|
|
|
4
4
|
const maps = {};
|
|
5
5
|
|
|
6
|
+
function formatRouteColor(route) {
|
|
7
|
+
return route.route_color || '#000000';
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
function formatRoute(route) {
|
|
7
11
|
const html = route.route_url
|
|
8
|
-
? $('<a>').attr('href', route.route_url)
|
|
12
|
+
? $('<a>').attr('href', route.route_url).addClass('hover:no-underline')
|
|
9
13
|
: $('<div>');
|
|
10
14
|
|
|
11
|
-
html.addClass('route-item text-
|
|
15
|
+
html.addClass('route-item text-xs mb-2');
|
|
12
16
|
|
|
13
17
|
if (route.route_color) {
|
|
18
|
+
// Only add color swatch if route has a color
|
|
14
19
|
$('<div>')
|
|
15
|
-
.addClass('
|
|
16
|
-
.
|
|
20
|
+
.addClass('flex items-center gap-2')
|
|
21
|
+
.html([
|
|
22
|
+
$('<div>')
|
|
23
|
+
.addClass('route-color-swatch flex-shrink-0 text-white')
|
|
24
|
+
.css('backgroundColor', formatRouteColor(route))
|
|
25
|
+
.text(route.route_short_name || ''),
|
|
26
|
+
$('<div>')
|
|
27
|
+
.addClass('hover:underline')
|
|
28
|
+
.text(route.route_long_name || ''),
|
|
29
|
+
])
|
|
17
30
|
.appendTo(html);
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
$('<span>')
|
|
21
|
-
.text(`${route.route_short_name} ${route.route_long_name}`)
|
|
22
|
-
.appendTo(html);
|
|
23
|
-
|
|
24
33
|
return html.prop('outerHTML');
|
|
25
34
|
}
|
|
26
35
|
|
|
@@ -51,7 +60,7 @@ function formatStopPopup(feature) {
|
|
|
51
60
|
$('<strong>').text(feature.properties.stop_code).appendTo(html);
|
|
52
61
|
}
|
|
53
62
|
|
|
54
|
-
$('<div>').text('Routes Served:').appendTo(html);
|
|
63
|
+
$('<div>').addClass('text-sm').text('Routes Served:').appendTo(html);
|
|
55
64
|
|
|
56
65
|
$(html).append(routes.map((route) => formatRoute(route)));
|
|
57
66
|
|
|
@@ -74,7 +83,7 @@ function getBounds(geojson) {
|
|
|
74
83
|
}
|
|
75
84
|
|
|
76
85
|
function createSystemMap(id, geojson) {
|
|
77
|
-
const defaultRouteColor = '#
|
|
86
|
+
const defaultRouteColor = '#000000';
|
|
78
87
|
const lineLayout = {
|
|
79
88
|
'line-join': 'round',
|
|
80
89
|
'line-cap': 'round',
|
|
@@ -107,10 +116,10 @@ function createSystemMap(id, geojson) {
|
|
|
107
116
|
duration: 0,
|
|
108
117
|
});
|
|
109
118
|
|
|
110
|
-
// Turn
|
|
119
|
+
// Turn off Points of Interest labels
|
|
111
120
|
map.setLayoutProperty('poi-label', 'visibility', 'none');
|
|
112
121
|
|
|
113
|
-
// Find the index of the first symbol layer in the map style
|
|
122
|
+
// Find the index of the first symbol layer in the map style to put the route lines underneath
|
|
114
123
|
let firstSymbolId;
|
|
115
124
|
for (const layer of map.getStyle().layers) {
|
|
116
125
|
if (layer.type === 'symbol') {
|
|
@@ -149,7 +158,7 @@ function createSystemMap(id, geojson) {
|
|
|
149
158
|
layout: lineLayout,
|
|
150
159
|
filter: ['!has', 'stop_id'],
|
|
151
160
|
},
|
|
152
|
-
firstSymbolId
|
|
161
|
+
firstSymbolId,
|
|
153
162
|
);
|
|
154
163
|
|
|
155
164
|
// Add highlighted route drop shadow outlines next
|
|
@@ -182,7 +191,7 @@ function createSystemMap(id, geojson) {
|
|
|
182
191
|
layout: lineLayout,
|
|
183
192
|
filter: ['==', ['get', 'route_id'], 'none'],
|
|
184
193
|
},
|
|
185
|
-
firstSymbolId
|
|
194
|
+
firstSymbolId,
|
|
186
195
|
);
|
|
187
196
|
|
|
188
197
|
// Add white outlines to routes next
|
|
@@ -208,59 +217,59 @@ function createSystemMap(id, geojson) {
|
|
|
208
217
|
layout: lineLayout,
|
|
209
218
|
filter: ['has', 'route_id'],
|
|
210
219
|
},
|
|
211
|
-
firstSymbolId
|
|
220
|
+
firstSymbolId,
|
|
212
221
|
);
|
|
213
222
|
|
|
214
|
-
// Add
|
|
223
|
+
// Add route lines next
|
|
215
224
|
map.addLayer(
|
|
216
225
|
{
|
|
217
|
-
id:
|
|
226
|
+
id: 'routes',
|
|
218
227
|
type: 'line',
|
|
219
228
|
source: {
|
|
220
229
|
type: 'geojson',
|
|
221
230
|
data: geojson,
|
|
222
231
|
},
|
|
223
232
|
paint: {
|
|
224
|
-
'line-color': '
|
|
233
|
+
'line-color': ['coalesce', ['get', 'route_color'], defaultRouteColor],
|
|
225
234
|
'line-opacity': 1,
|
|
226
235
|
'line-width': {
|
|
227
|
-
base:
|
|
236
|
+
base: 4,
|
|
228
237
|
stops: [
|
|
229
|
-
[14,
|
|
230
|
-
[18,
|
|
238
|
+
[14, 6],
|
|
239
|
+
[18, 16],
|
|
231
240
|
],
|
|
232
241
|
},
|
|
233
242
|
},
|
|
234
243
|
layout: lineLayout,
|
|
235
|
-
filter: ['
|
|
244
|
+
filter: ['has', 'route_id'],
|
|
236
245
|
},
|
|
237
|
-
firstSymbolId
|
|
246
|
+
firstSymbolId,
|
|
238
247
|
);
|
|
239
248
|
|
|
240
|
-
// Add route
|
|
249
|
+
// Add highlighted route white outlines next
|
|
241
250
|
map.addLayer(
|
|
242
251
|
{
|
|
243
|
-
id:
|
|
252
|
+
id: `highlighted-route-outlines`,
|
|
244
253
|
type: 'line',
|
|
245
254
|
source: {
|
|
246
255
|
type: 'geojson',
|
|
247
256
|
data: geojson,
|
|
248
257
|
},
|
|
249
258
|
paint: {
|
|
250
|
-
'line-color':
|
|
259
|
+
'line-color': '#FFFFFF',
|
|
251
260
|
'line-opacity': 1,
|
|
252
261
|
'line-width': {
|
|
253
|
-
base:
|
|
262
|
+
base: 10,
|
|
254
263
|
stops: [
|
|
255
|
-
[14,
|
|
256
|
-
[18,
|
|
264
|
+
[14, 16],
|
|
265
|
+
[18, 40],
|
|
257
266
|
],
|
|
258
267
|
},
|
|
259
268
|
},
|
|
260
269
|
layout: lineLayout,
|
|
261
|
-
filter: ['
|
|
270
|
+
filter: ['==', ['get', 'route_id'], 'none'],
|
|
262
271
|
},
|
|
263
|
-
firstSymbolId
|
|
272
|
+
firstSymbolId,
|
|
264
273
|
);
|
|
265
274
|
|
|
266
275
|
// Add highlighted route lines next
|
|
@@ -286,96 +295,74 @@ function createSystemMap(id, geojson) {
|
|
|
286
295
|
layout: lineLayout,
|
|
287
296
|
filter: ['==', ['get', 'route_id'], 'none'],
|
|
288
297
|
},
|
|
289
|
-
firstSymbolId
|
|
298
|
+
firstSymbolId,
|
|
290
299
|
);
|
|
291
300
|
|
|
292
301
|
// Add stops when zoomed in
|
|
293
|
-
map.addLayer(
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
[22, 100],
|
|
308
|
-
],
|
|
309
|
-
},
|
|
310
|
-
'circle-stroke-color': '#3F4A5C',
|
|
311
|
-
'circle-stroke-width': 2,
|
|
312
|
-
'circle-opacity': [
|
|
313
|
-
'interpolate',
|
|
314
|
-
['linear'],
|
|
315
|
-
['zoom'],
|
|
316
|
-
13,
|
|
317
|
-
0,
|
|
318
|
-
13.5,
|
|
319
|
-
1,
|
|
320
|
-
],
|
|
321
|
-
'circle-stroke-opacity': [
|
|
322
|
-
'interpolate',
|
|
323
|
-
['linear'],
|
|
324
|
-
['zoom'],
|
|
325
|
-
13,
|
|
326
|
-
0,
|
|
327
|
-
13.5,
|
|
328
|
-
1,
|
|
302
|
+
map.addLayer({
|
|
303
|
+
id: 'stops',
|
|
304
|
+
type: 'circle',
|
|
305
|
+
source: {
|
|
306
|
+
type: 'geojson',
|
|
307
|
+
data: geojson,
|
|
308
|
+
},
|
|
309
|
+
paint: {
|
|
310
|
+
'circle-color': '#fff',
|
|
311
|
+
'circle-radius': {
|
|
312
|
+
base: 1.75,
|
|
313
|
+
stops: [
|
|
314
|
+
[12, 4],
|
|
315
|
+
[22, 100],
|
|
329
316
|
],
|
|
330
317
|
},
|
|
331
|
-
|
|
318
|
+
'circle-stroke-color': '#3F4A5C',
|
|
319
|
+
'circle-stroke-width': 2,
|
|
320
|
+
'circle-opacity': ['interpolate', ['linear'], ['zoom'], 13, 0, 13.5, 1],
|
|
321
|
+
'circle-stroke-opacity': [
|
|
322
|
+
'interpolate',
|
|
323
|
+
['linear'],
|
|
324
|
+
['zoom'],
|
|
325
|
+
13,
|
|
326
|
+
0,
|
|
327
|
+
13.5,
|
|
328
|
+
1,
|
|
329
|
+
],
|
|
332
330
|
},
|
|
333
|
-
|
|
334
|
-
);
|
|
331
|
+
filter: ['has', 'stop_id'],
|
|
332
|
+
});
|
|
335
333
|
|
|
336
334
|
// Layer for highlighted stops
|
|
337
|
-
map.addLayer(
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
[22, 125],
|
|
352
|
-
],
|
|
353
|
-
},
|
|
354
|
-
'circle-stroke-width': 2,
|
|
355
|
-
'circle-stroke-color': '#3f4a5c',
|
|
356
|
-
'circle-opacity': [
|
|
357
|
-
'interpolate',
|
|
358
|
-
['linear'],
|
|
359
|
-
['zoom'],
|
|
360
|
-
13,
|
|
361
|
-
0,
|
|
362
|
-
13.5,
|
|
363
|
-
1,
|
|
364
|
-
],
|
|
365
|
-
'circle-stroke-opacity': [
|
|
366
|
-
'interpolate',
|
|
367
|
-
['linear'],
|
|
368
|
-
['zoom'],
|
|
369
|
-
13,
|
|
370
|
-
0,
|
|
371
|
-
13.5,
|
|
372
|
-
1,
|
|
335
|
+
map.addLayer({
|
|
336
|
+
id: 'stops-highlighted',
|
|
337
|
+
type: 'circle',
|
|
338
|
+
source: {
|
|
339
|
+
type: 'geojson',
|
|
340
|
+
data: geojson,
|
|
341
|
+
},
|
|
342
|
+
paint: {
|
|
343
|
+
'circle-color': '#fff',
|
|
344
|
+
'circle-radius': {
|
|
345
|
+
base: 1.75,
|
|
346
|
+
stops: [
|
|
347
|
+
[12, 5],
|
|
348
|
+
[22, 125],
|
|
373
349
|
],
|
|
374
350
|
},
|
|
375
|
-
|
|
351
|
+
'circle-stroke-width': 2,
|
|
352
|
+
'circle-stroke-color': '#3f4a5c',
|
|
353
|
+
'circle-opacity': ['interpolate', ['linear'], ['zoom'], 13, 0, 13.5, 1],
|
|
354
|
+
'circle-stroke-opacity': [
|
|
355
|
+
'interpolate',
|
|
356
|
+
['linear'],
|
|
357
|
+
['zoom'],
|
|
358
|
+
13,
|
|
359
|
+
0,
|
|
360
|
+
13.5,
|
|
361
|
+
1,
|
|
362
|
+
],
|
|
376
363
|
},
|
|
377
|
-
|
|
378
|
-
);
|
|
364
|
+
filter: ['==', 'stop_id', ''],
|
|
365
|
+
});
|
|
379
366
|
|
|
380
367
|
// Add labels
|
|
381
368
|
map.addLayer({
|
|
@@ -406,14 +393,14 @@ function createSystemMap(id, geojson) {
|
|
|
406
393
|
map.getCanvas().style.cursor = 'pointer';
|
|
407
394
|
highlightRoutes(
|
|
408
395
|
_.compact(
|
|
409
|
-
_.uniq(features.map((feature) => feature.properties.route_id))
|
|
410
|
-
)
|
|
396
|
+
_.uniq(features.map((feature) => feature.properties.route_id)),
|
|
397
|
+
),
|
|
411
398
|
);
|
|
412
399
|
|
|
413
400
|
if (features.some((feature) => feature.layer.id === 'stops')) {
|
|
414
401
|
highlightStop(
|
|
415
402
|
features.find((feature) => feature.layer.id === 'stops').properties
|
|
416
|
-
.stop_id
|
|
403
|
+
.stop_id,
|
|
417
404
|
);
|
|
418
405
|
}
|
|
419
406
|
} else {
|
|
@@ -451,10 +438,10 @@ function createSystemMap(id, geojson) {
|
|
|
451
438
|
const routes = _.orderBy(
|
|
452
439
|
_.uniqBy(
|
|
453
440
|
routeFeatures,
|
|
454
|
-
(feature) => feature.properties.route_short_name
|
|
441
|
+
(feature) => feature.properties.route_short_name,
|
|
455
442
|
),
|
|
456
443
|
(feature) =>
|
|
457
|
-
Number.parseInt(feature.properties.route_short_name, 10)
|
|
444
|
+
Number.parseInt(feature.properties.route_short_name, 10),
|
|
458
445
|
);
|
|
459
446
|
|
|
460
447
|
new mapboxgl.Popup()
|
|
@@ -505,11 +492,11 @@ function createSystemMap(id, geojson) {
|
|
|
505
492
|
map.setPaintProperty(
|
|
506
493
|
'route-line-shadows',
|
|
507
494
|
'line-opacity',
|
|
508
|
-
routeLineOpacity
|
|
495
|
+
routeLineOpacity,
|
|
509
496
|
);
|
|
510
497
|
|
|
511
498
|
const highlightedFeatures = geojson.features.filter((feature) =>
|
|
512
|
-
routeIds.includes(feature.properties.route_id)
|
|
499
|
+
routeIds.includes(feature.properties.route_id),
|
|
513
500
|
);
|
|
514
501
|
|
|
515
502
|
if (highlightedFeatures.length > 0 && zoom) {
|
|
@@ -546,7 +533,7 @@ function createSystemMap(id, geojson) {
|
|
|
546
533
|
map.setPaintProperty(
|
|
547
534
|
'route-line-shadows',
|
|
548
535
|
'line-opacity',
|
|
549
|
-
routeLineOpacity
|
|
536
|
+
routeLineOpacity,
|
|
550
537
|
);
|
|
551
538
|
|
|
552
539
|
if (zoom) {
|
|
@@ -566,7 +553,7 @@ function createSystemMap(id, geojson) {
|
|
|
566
553
|
|
|
567
554
|
$('.overview-list').hover(
|
|
568
555
|
() => {},
|
|
569
|
-
() => unHighlightRoutes(true)
|
|
556
|
+
() => unHighlightRoutes(true),
|
|
570
557
|
);
|
|
571
558
|
});
|
|
572
559
|
});
|
|
@@ -3,24 +3,33 @@
|
|
|
3
3
|
|
|
4
4
|
const maps = {};
|
|
5
5
|
|
|
6
|
+
function formatRouteColor(route) {
|
|
7
|
+
return route.route_color || '#000000';
|
|
8
|
+
}
|
|
9
|
+
|
|
6
10
|
function formatRoute(route) {
|
|
7
11
|
const html = route.route_url
|
|
8
|
-
? $('<a>').attr('href', route.route_url)
|
|
12
|
+
? $('<a>').attr('href', route.route_url).addClass('hover:no-underline')
|
|
9
13
|
: $('<div>');
|
|
10
14
|
|
|
11
|
-
html.addClass('route-item text-
|
|
15
|
+
html.addClass('route-item text-xs mb-2');
|
|
12
16
|
|
|
13
17
|
if (route.route_color) {
|
|
18
|
+
// Only add color swatch if route has a color
|
|
14
19
|
$('<div>')
|
|
15
|
-
.addClass('
|
|
16
|
-
.
|
|
20
|
+
.addClass('flex items-center gap-2')
|
|
21
|
+
.html([
|
|
22
|
+
$('<div>')
|
|
23
|
+
.addClass('route-color-swatch flex-shrink-0 text-white')
|
|
24
|
+
.css('backgroundColor', formatRouteColor(route))
|
|
25
|
+
.text(route.route_short_name || ''),
|
|
26
|
+
$('<div>')
|
|
27
|
+
.addClass('hover:underline')
|
|
28
|
+
.text(route.route_long_name || ''),
|
|
29
|
+
])
|
|
17
30
|
.appendTo(html);
|
|
18
31
|
}
|
|
19
32
|
|
|
20
|
-
$('<span>')
|
|
21
|
-
.text(`${route.route_short_name} ${route.route_long_name}`)
|
|
22
|
-
.appendTo(html);
|
|
23
|
-
|
|
24
33
|
return html.prop('outerHTML');
|
|
25
34
|
}
|
|
26
35
|
|
|
@@ -39,7 +48,7 @@ function formatStopPopup(feature, routes) {
|
|
|
39
48
|
$('<strong>').text(feature.properties.stop_code).appendTo(html);
|
|
40
49
|
}
|
|
41
50
|
|
|
42
|
-
$('<div>').text('Routes Served:').appendTo(html);
|
|
51
|
+
$('<div>').addClass('text-sm').text('Routes Served:').appendTo(html);
|
|
43
52
|
|
|
44
53
|
$(html).append(routeIds.map((routeId) => formatRoute(routes[routeId])));
|
|
45
54
|
|
|
@@ -62,7 +71,7 @@ function getBounds(geojson) {
|
|
|
62
71
|
}
|
|
63
72
|
|
|
64
73
|
function createMap(id, geojson, routes) {
|
|
65
|
-
const defaultRouteColor = '#
|
|
74
|
+
const defaultRouteColor = '#000000';
|
|
66
75
|
const lineLayout = {
|
|
67
76
|
'line-join': 'round',
|
|
68
77
|
'line-cap': 'round',
|
|
@@ -107,10 +116,10 @@ function createMap(id, geojson, routes) {
|
|
|
107
116
|
duration: 0,
|
|
108
117
|
});
|
|
109
118
|
|
|
110
|
-
// Turn
|
|
119
|
+
// Turn off Points of Interest labels
|
|
111
120
|
map.setLayoutProperty('poi-label', 'visibility', 'none');
|
|
112
121
|
|
|
113
|
-
// Find the index of the first symbol layer in the map style
|
|
122
|
+
// Find the index of the first symbol layer in the map style to put the route lines underneath
|
|
114
123
|
let firstSymbolId;
|
|
115
124
|
for (const layer of map.getStyle().layers) {
|
|
116
125
|
if (layer.type === 'symbol') {
|
|
@@ -149,7 +158,7 @@ function createMap(id, geojson, routes) {
|
|
|
149
158
|
layout: lineLayout,
|
|
150
159
|
filter: ['!has', 'stop_id'],
|
|
151
160
|
},
|
|
152
|
-
firstSymbolId
|
|
161
|
+
firstSymbolId,
|
|
153
162
|
);
|
|
154
163
|
|
|
155
164
|
// Add route line outline
|
|
@@ -175,7 +184,7 @@ function createMap(id, geojson, routes) {
|
|
|
175
184
|
layout: lineLayout,
|
|
176
185
|
filter: ['!has', 'stop_id'],
|
|
177
186
|
},
|
|
178
|
-
firstSymbolId
|
|
187
|
+
firstSymbolId,
|
|
179
188
|
);
|
|
180
189
|
|
|
181
190
|
// Add route line
|
|
@@ -201,60 +210,54 @@ function createMap(id, geojson, routes) {
|
|
|
201
210
|
layout: lineLayout,
|
|
202
211
|
filter: ['!has', 'stop_id'],
|
|
203
212
|
},
|
|
204
|
-
firstSymbolId
|
|
213
|
+
firstSymbolId,
|
|
205
214
|
);
|
|
206
215
|
|
|
207
216
|
// Add stops
|
|
208
|
-
map.addLayer(
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
],
|
|
224
|
-
},
|
|
225
|
-
'circle-stroke-color': '#3f4a5c',
|
|
226
|
-
'circle-stroke-width': 2,
|
|
217
|
+
map.addLayer({
|
|
218
|
+
id: 'stops',
|
|
219
|
+
type: 'circle',
|
|
220
|
+
source: {
|
|
221
|
+
type: 'geojson',
|
|
222
|
+
data: geojson,
|
|
223
|
+
},
|
|
224
|
+
paint: {
|
|
225
|
+
'circle-color': '#fff',
|
|
226
|
+
'circle-radius': {
|
|
227
|
+
base: 1.75,
|
|
228
|
+
stops: [
|
|
229
|
+
[12, 4],
|
|
230
|
+
[22, 100],
|
|
231
|
+
],
|
|
227
232
|
},
|
|
228
|
-
|
|
233
|
+
'circle-stroke-color': '#3f4a5c',
|
|
234
|
+
'circle-stroke-width': 2,
|
|
229
235
|
},
|
|
230
|
-
|
|
231
|
-
);
|
|
236
|
+
filter: ['has', 'stop_id'],
|
|
237
|
+
});
|
|
232
238
|
|
|
233
239
|
// Layer for highlighted stops
|
|
234
|
-
map.addLayer(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
],
|
|
250
|
-
},
|
|
251
|
-
'circle-stroke-width': 2,
|
|
252
|
-
'circle-stroke-color': '#3f4a5c',
|
|
240
|
+
map.addLayer({
|
|
241
|
+
id: 'stops-highlighted',
|
|
242
|
+
type: 'circle',
|
|
243
|
+
source: {
|
|
244
|
+
type: 'geojson',
|
|
245
|
+
data: geojson,
|
|
246
|
+
},
|
|
247
|
+
paint: {
|
|
248
|
+
'circle-color': '#fff',
|
|
249
|
+
'circle-radius': {
|
|
250
|
+
base: 1.75,
|
|
251
|
+
stops: [
|
|
252
|
+
[12, 5],
|
|
253
|
+
[22, 125],
|
|
254
|
+
],
|
|
253
255
|
},
|
|
254
|
-
|
|
256
|
+
'circle-stroke-width': 2,
|
|
257
|
+
'circle-stroke-color': '#3f4a5c',
|
|
255
258
|
},
|
|
256
|
-
|
|
257
|
-
);
|
|
259
|
+
filter: ['==', 'stop_id', ''],
|
|
260
|
+
});
|
|
258
261
|
|
|
259
262
|
map.on('mousemove', (event) => {
|
|
260
263
|
const features = map.queryRenderedFeatures(event.point, {
|
|
@@ -10,12 +10,12 @@ include formatting_functions.pug
|
|
|
10
10
|
h1.text-2xl.pt-4.pb-2= `${formatAgencyName(timetablePageGroup.agency)} Routes`
|
|
11
11
|
each timetablePage in timetablePageGroup.timetablePages
|
|
12
12
|
if config.allowEmptyTimetables || timetablePage.consolidatedTimetables.length > 0
|
|
13
|
-
a.block.p-2.border-b.border-slate-200(class="hover:bg-slate-
|
|
13
|
+
a.block.p-2.border-b.border-slate-200(class="hover:bg-slate-100 hover:no-underline" href=`${timetablePage.relativePath}` data-route-ids=`${timetablePage.route_ids ? timetablePage.route_ids.join(',') : ''}`)
|
|
14
14
|
.text-lg.text-gray-800.leading-none= timetablePage.timetable_page_label
|
|
15
15
|
each route in _.uniqBy(_.flatMap(timetablePage.consolidatedTimetables, timetable => timetable.routes), 'route_id')
|
|
16
|
-
.flex.my-1
|
|
17
|
-
.route-color-swatch.flex-none
|
|
18
|
-
.
|
|
16
|
+
.flex.my-1.items-center.gap-1
|
|
17
|
+
.route-color-swatch.flex-none(style=`background-color: ${formatRouteColor(route)}; color: ${formatRouteTextColor(route)};`)= route.route_short_name || ''
|
|
18
|
+
.text-gray-600.leading-none= formatRouteName(route)
|
|
19
19
|
.inline-flex.items-center.justify-center.px-2.py-1.text-xs.font-bold.leading-none.text-slate-800.bg-slate-200.rounded-full= timetablePage.dayList
|
|
20
20
|
if config.showMap
|
|
21
21
|
.map.ml-4.h-full.w-full(id="system_map")
|
|
@@ -4,11 +4,11 @@ block content
|
|
|
4
4
|
|
|
5
5
|
block extraHeader
|
|
6
6
|
if config.showMap
|
|
7
|
-
script(src="https://unpkg.com/jquery@3.
|
|
7
|
+
script(src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js" crossorigin="anonymous")
|
|
8
8
|
script(src="https://unpkg.com/lodash@4.17.21/lodash.min.js" crossorigin="anonymous")
|
|
9
|
-
script(src="https://api.mapbox.com/mapbox-gl-js/
|
|
9
|
+
script(src="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.js")
|
|
10
10
|
script.
|
|
11
11
|
mapboxgl.accessToken = '#{config.mapboxAccessToken}';
|
|
12
12
|
script(src=`${config.assetPath}js/system-map.js`)
|
|
13
13
|
|
|
14
|
-
link(href="https://api.mapbox.com/mapbox-gl-js/
|
|
14
|
+
link(href="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.css" rel="stylesheet")
|
|
@@ -4,9 +4,9 @@ include formatting_functions.pug
|
|
|
4
4
|
.timetable-page(class=`menu-type-${config.menuType}`)
|
|
5
5
|
.container.mx-4(class="md:mx-auto")
|
|
6
6
|
if config.showRouteTitle
|
|
7
|
-
h1.timetable-page-label.text-2xl.pt-4.flex.items-center
|
|
7
|
+
h1.timetable-page-label.text-2xl.pt-4.flex.items-center.gap-2
|
|
8
8
|
each route in _.uniqBy(_.flatMap(timetablePage.consolidatedTimetables, timetable => timetable.routes), 'route_id')
|
|
9
|
-
.route-color-swatch-large.
|
|
9
|
+
.route-color-swatch-large.flex-none(style=`background-color: ${formatRouteColor(route)}; color: ${formatRouteTextColor(route)};`)= route.route_short_name || ''
|
|
10
10
|
div= timetablePage.timetable_page_label
|
|
11
11
|
if config.effectiveDate
|
|
12
12
|
.effective-date.text-gray-600.mb-2= `Effective ${config.effectiveDate}`
|
|
@@ -16,11 +16,12 @@ include formatting_functions.pug
|
|
|
16
16
|
each timetable in timetablePage.consolidatedTimetables
|
|
17
17
|
.timetable.mb-10(id=`timetable_id_${formatHtmlId(timetable.timetable_id)}` data-day-list=timetable.dayList data-direction-name=timetable.direction_name data-timetable-id=timetable.timetable_id data-direction-id=timetable.direction_id data-route-id=timetable.route_ids.join('_'))
|
|
18
18
|
if config.showRouteTitle
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
.mb-2
|
|
20
|
+
h2.text-xl= `${timetable.timetable_label} | ${timetable.dayListLong}`
|
|
21
|
+
each note in getNotesForTimetableLabel(timetable.notes)
|
|
22
|
+
include timetable_note_symbol.pug
|
|
23
|
+
if timetable.service_notes !== null
|
|
24
|
+
.service-notes= timetable.service_notes
|
|
24
25
|
|
|
25
26
|
if config.showMap
|
|
26
27
|
.map(id=`map_timetable_id_${formatHtmlId(timetable.timetable_id)}`)
|
|
@@ -55,8 +56,8 @@ include formatting_functions.pug
|
|
|
55
56
|
each note in _.uniqBy(timetable.notes, 'note_id')
|
|
56
57
|
.note(id=`note-${timetable.timetable_id}-${note.note_id}`)= `${note.symbol} = ${note.note}`
|
|
57
58
|
|
|
58
|
-
if timetable.calendarDates.includedDates.length
|
|
59
|
+
if config.showCalendarExceptions && timetable.calendarDates.includedDates.length
|
|
59
60
|
.included-dates= `${config.serviceProvidedOnText}: ${timetable.calendarDates.includedDates.join(', ')}`
|
|
60
61
|
|
|
61
|
-
if timetable.calendarDates.excludedDates.length
|
|
62
|
+
if config.showCalendarExceptions && timetable.calendarDates.excludedDates.length
|
|
62
63
|
.excluded-dates= `${config.serviceNotProvidedOnText}: ${timetable.calendarDates.excludedDates.join(', ')}`
|
|
@@ -3,16 +3,16 @@ block content
|
|
|
3
3
|
include timetablepage.pug
|
|
4
4
|
|
|
5
5
|
block extraHeader
|
|
6
|
-
script(src="https://unpkg.com/jquery@3.
|
|
6
|
+
script(src="https://unpkg.com/jquery@3.7.1/dist/jquery.min.js" crossorigin="anonymous")
|
|
7
7
|
|
|
8
8
|
if config.menuType === 'radio'
|
|
9
9
|
script(src=`${config.assetPath}js/timetable-menu.js`)
|
|
10
10
|
|
|
11
11
|
if config.showMap
|
|
12
|
-
script(src="https://api.mapbox.com/mapbox-gl-js/
|
|
12
|
+
script(src="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.js")
|
|
13
13
|
script.
|
|
14
14
|
mapboxgl.accessToken = '#{config.mapboxAccessToken}';
|
|
15
15
|
script(src=`${config.assetPath}js/timetable-map.js`)
|
|
16
16
|
|
|
17
|
-
link(href="https://api.mapbox.com/mapbox-gl-js/
|
|
17
|
+
link(href="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.css" rel="stylesheet")
|
|
18
18
|
|