gtfs-to-html 2.10.14 → 2.10.15
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/dist/app/index.js +12 -7
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +14 -7
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/views/default/formatting_functions.pug +16 -1
- package/views/default/overview.pug +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtfs-to-html",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
6
6
|
"keywords": [
|
|
@@ -57,12 +57,12 @@
|
|
|
57
57
|
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
58
58
|
"js-beautify": "^1.15.4",
|
|
59
59
|
"lodash-es": "^4.17.21",
|
|
60
|
-
"marked": "^16.
|
|
60
|
+
"marked": "^16.1.1",
|
|
61
61
|
"moment": "^2.30.1",
|
|
62
62
|
"pbf": "^4.0.1",
|
|
63
63
|
"pretty-error": "^4.0.0",
|
|
64
64
|
"pug": "^3.0.3",
|
|
65
|
-
"puppeteer": "^24.
|
|
65
|
+
"puppeteer": "^24.15.0",
|
|
66
66
|
"sanitize-filename": "^1.6.3",
|
|
67
67
|
"sanitize-html": "^2.17.0",
|
|
68
68
|
"sqlstring": "^2.3.3",
|
|
@@ -36,6 +36,21 @@
|
|
|
36
36
|
}), timetableGroup => timetableGroup.agency.agency_name.toLowerCase());
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
function optimizeGeojsonProperties(geojson) {
|
|
40
|
+
const propertiesToRemove = ['location_type', 'tts_stop_name', 'wheelchair_boarding', 'zone_id', 'stop_timezone', 'level_id', 'route_sort_order', 'continuous_pickup', 'continuous_drop_off', 'network_id']
|
|
41
|
+
return {
|
|
42
|
+
...geojson,
|
|
43
|
+
features: geojson.features.map(feature => ({
|
|
44
|
+
...feature,
|
|
45
|
+
properties: Object.fromEntries(
|
|
46
|
+
Object.entries(feature.properties || {}).filter(
|
|
47
|
+
([key]) => !propertiesToRemove.includes(key)
|
|
48
|
+
)
|
|
49
|
+
)
|
|
50
|
+
}))
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
39
54
|
function prepareMapData(timetablePage, config) {
|
|
40
55
|
const routeData = {}
|
|
41
56
|
const stopData = {}
|
|
@@ -79,7 +94,7 @@
|
|
|
79
94
|
minifiedGeojson.features.push(feature)
|
|
80
95
|
}
|
|
81
96
|
|
|
82
|
-
geojsons[formatHtmlId(timetable.timetable_id)] = minifiedGeojson
|
|
97
|
+
geojsons[formatHtmlId(timetable.timetable_id)] = optimizeGeojsonProperties(minifiedGeojson)
|
|
83
98
|
}
|
|
84
99
|
|
|
85
100
|
const gtfsRealtimeUrls = {}
|
|
@@ -21,6 +21,6 @@ include formatting_functions.pug
|
|
|
21
21
|
|
|
22
22
|
//- Use !{variable} format to inject values from pug to client side js
|
|
23
23
|
script.
|
|
24
|
-
const geojson = !{JSON.stringify(geojson) || '\'\''};
|
|
24
|
+
const geojson = !{JSON.stringify(optimizeGeojsonProperties(geojson)) || '\'\''};
|
|
25
25
|
const mapStyleUrl = '#{config.mapStyleUrl}';
|
|
26
26
|
createSystemMap();
|