gtfs-to-html 2.5.7 → 2.5.9

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.
@@ -3,6 +3,17 @@
3
3
 
4
4
  const maps = {};
5
5
 
6
+ function formatRouteName(route) {
7
+ let routeName = '';
8
+ if (route.route_short_name !== undefined) {
9
+ routeName += route.route_short_name;
10
+ } else if (route.route_long_name !== undefined) {
11
+ routeName += route.route_long_name;
12
+ }
13
+
14
+ return routeName;
15
+ }
16
+
6
17
  function formatRoute(route) {
7
18
  const html = route.route_url
8
19
  ? $('<a>').attr('href', route.route_url)
@@ -17,9 +28,7 @@ function formatRoute(route) {
17
28
  .appendTo(html);
18
29
  }
19
30
 
20
- $('<span>')
21
- .text(`${route.route_short_name} ${route.route_long_name}`)
22
- .appendTo(html);
31
+ $('<span>').text(formatRouteName(route)).appendTo(html);
23
32
 
24
33
  return html.prop('outerHTML');
25
34
  }
@@ -107,10 +116,10 @@ function createMap(id, geojson, routes) {
107
116
  duration: 0,
108
117
  });
109
118
 
110
- // Turn of Points of Interest labels
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
- id: 'stops',
211
- type: 'circle',
212
- source: {
213
- type: 'geojson',
214
- data: geojson,
215
- },
216
- paint: {
217
- 'circle-color': '#fff',
218
- 'circle-radius': {
219
- base: 1.75,
220
- stops: [
221
- [12, 4],
222
- [22, 100],
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
- filter: ['has', 'stop_id'],
233
+ 'circle-stroke-color': '#3f4a5c',
234
+ 'circle-stroke-width': 2,
229
235
  },
230
- firstSymbolId
231
- );
236
+ filter: ['has', 'stop_id'],
237
+ });
232
238
 
233
239
  // Layer for highlighted stops
234
- map.addLayer(
235
- {
236
- id: 'stops-highlighted',
237
- type: 'circle',
238
- source: {
239
- type: 'geojson',
240
- data: geojson,
241
- },
242
- paint: {
243
- 'circle-color': '#fff',
244
- 'circle-radius': {
245
- base: 1.75,
246
- stops: [
247
- [12, 5],
248
- [22, 125],
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
- filter: ['==', 'stop_id', ''],
256
+ 'circle-stroke-width': 2,
257
+ 'circle-stroke-color': '#3f4a5c',
255
258
  },
256
- firstSymbolId
257
- );
259
+ filter: ['==', 'stop_id', ''],
260
+ });
258
261
 
259
262
  map.on('mousemove', (event) => {
260
263
  const features = map.queryRenderedFeatures(event.point, {
@@ -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.6.0/dist/jquery.min.js" crossorigin="anonymous")
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/v2.5.1/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/v2.5.1/mapbox-gl.css" rel="stylesheet")
14
+ link(href="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.css" rel="stylesheet")
@@ -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.0/dist/jquery.min.js" crossorigin="anonymous")
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/v2.5.1/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/v2.5.1/mapbox-gl.css" rel="stylesheet")
17
+ link(href="https://api.mapbox.com/mapbox-gl-js/v3.1.0/mapbox-gl.css" rel="stylesheet")
18
18
 
package/www/package.json CHANGED
@@ -9,9 +9,9 @@
9
9
  "deploy": "docusaurus deploy"
10
10
  },
11
11
  "dependencies": {
12
- "@docusaurus/core": "^3.0.0",
13
- "@docusaurus/preset-classic": "^3.0.0",
14
- "clsx": "^2.0.0",
12
+ "@docusaurus/core": "^3.1.0",
13
+ "@docusaurus/preset-classic": "^3.1.0",
14
+ "clsx": "^2.1.0",
15
15
  "react": "^18.2.0",
16
16
  "react-dom": "^18.2.0"
17
17
  },