mobility-toolbox-js 2.0.0-beta.3 → 2.0.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/README.md +4 -1
- package/common/styles/trackerDefaultStyle.js +8 -8
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +10 -3
package/README.md
CHANGED
|
@@ -8,13 +8,16 @@ The tools in this library have been inspired by many projects realized for publi
|
|
|
8
8
|
[](https://app.netlify.com/sites/mobility-toolbox-js/deploys)
|
|
9
9
|
|
|
10
10
|
## Main Features
|
|
11
|
+
|
|
11
12
|
* Display [real-time vehicle positions and prognosis data](http://tracker.geops.ch/) on a map.
|
|
12
13
|
* Search for [stops and stations](https://maps2.trafimage.ch) all over the world.
|
|
13
14
|
* Get [precise geographic courses](https://geops.github.io/geops-routing-demo/) for all modes of transport.
|
|
14
15
|
* Generate beautiful maps for public transport, mobility and logistics
|
|
15
16
|
|
|
16
17
|
## Documentation and examples
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
Visit https://master--mobility-toolbox-js.netlify.app/
|
|
18
20
|
|
|
19
21
|
## Version 1.x.x
|
|
22
|
+
|
|
20
23
|
The master branch is now open for the version 2 development. The version 1 is still available in [1.x.x](https://github.com/geops/mobility-toolbox-js/tree/1.x.x) branch.
|
|
@@ -158,24 +158,24 @@ const style = (trajectory, viewState, options) => {
|
|
|
158
158
|
} = options;
|
|
159
159
|
|
|
160
160
|
const { zoom, pixelRatio } = viewState;
|
|
161
|
-
let {
|
|
161
|
+
let { type, cancelled } = trajectory.properties;
|
|
162
162
|
const {
|
|
163
163
|
train_id: id,
|
|
164
|
+
line,
|
|
164
165
|
delay,
|
|
165
|
-
|
|
166
|
+
state,
|
|
166
167
|
operator_provides_realtime_journey: operatorProvidesRealtime,
|
|
167
168
|
} = trajectory.properties;
|
|
169
|
+
let { name, text_color: textColor, color } = line || {};
|
|
170
|
+
|
|
171
|
+
// In the future, the cancelled property will be removed we still managed it
|
|
172
|
+
// until the backend change is on prod.
|
|
173
|
+
cancelled = cancelled === true || state === 'JOURNEY_CANCELLED';
|
|
168
174
|
|
|
169
175
|
if (!type) {
|
|
170
176
|
type = 'Rail';
|
|
171
177
|
}
|
|
172
178
|
|
|
173
|
-
if (!line) {
|
|
174
|
-
line = {};
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
let { name, text_color: textColor, color } = line;
|
|
178
|
-
|
|
179
179
|
if (!name) {
|
|
180
180
|
name = 'I';
|
|
181
181
|
}
|