mobility-toolbox-js 1.7.11 → 1.7.14

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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Toolbox for JavaScript applications in the domains of mobility and logistics.
4
4
  The tools in this library have been inspired by many projects realized for public transport agencies, mobility providers and logistics companies.
5
5
 
6
- [![npm](https://img.shields.io/npm/v/mobility-toolbox-js@latest.svg?style=flat-square)](https://www.npmjs.com/package/mobility-toolbox-js)
6
+ [![npm](https://img.shields.io/npm/v/mobility-toolbox-js.svg?style=flat-square)](https://www.npmjs.com/package/mobility-toolbox-js)
7
7
  [![Build](https://github.com/geops/mobility-toolbox-js/workflows/Build/badge.svg)](https://github.com/geops/mobility-toolbox-js/actions?query=workflow%3ABuild)
8
8
  [![Netlify Status](https://api.netlify.com/api/v1/badges/b368ab18-9dbf-416c-91f6-a82076b02c10/deploy-status)](https://app.netlify.com/sites/mobility-toolbox-js/deploys)
9
9
 
@@ -158,14 +158,18 @@ const style = (trajectory, viewState, options) => {
158
158
  } = options;
159
159
 
160
160
  const { zoom, pixelRatio } = viewState;
161
- let { line, type } = trajectory.properties;
161
+ let { line, type, cancelled } = trajectory.properties;
162
162
  const {
163
163
  train_id: id,
164
164
  delay,
165
- cancelled = false,
165
+ state,
166
166
  operator_provides_realtime_journey: operatorProvidesRealtime,
167
167
  } = trajectory.properties;
168
168
 
169
+ // In the future, the cancelled property will be removed we still managed it
170
+ // until the backend change is on prod.
171
+ cancelled = cancelled === true || state === 'JOURNEY_CANCELLED';
172
+
169
173
  if (!type) {
170
174
  type = 'Rail';
171
175
  }