Skip to content

Commit

Permalink
Merge branch 'master' into olivier/webworker
Browse files Browse the repository at this point in the history
  • Loading branch information
oterral committed Oct 19, 2021
2 parents 3178bda + e1b5acd commit 9f10715
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

jobs:
build:
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mobility-toolbox-js",
"license": "MIT",
"description": "Toolbox for JavaScript applications in the domains of mobility and logistics.",
"version": "1.3.13-beta.7",
"version": "1.4.0",
"main": "index.js",
"module": "module.js",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/common/Tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class Tracker {
this.renderedTrajectories = [];

/**
* Active interpolation calcultion or not. If false, the train will not move until we receive the next message for the websocket.
* Active interpolation calculation or not. If false, the train will not move until we receive the next message for the websocket.
* @type {boolean}
*/
this.interpolate = !!opts.interpolate;
Expand Down
19 changes: 7 additions & 12 deletions src/common/mixins/TrackerLayerMixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const TrackerLayerMixin = (Base) =>
filter,
sort,
time,
live,
} = options;

const initTrackerOptions = {
Expand Down Expand Up @@ -217,7 +218,7 @@ const TrackerLayerMixin = (Base) =>
* When true, setting the time property has no effect.
*/
live: {
value: true,
value: live === false ? live : true,
writable: true,
},

Expand All @@ -228,20 +229,11 @@ const TrackerLayerMixin = (Base) =>
time: {
get: () => currTime,
set: (newTime) => {
currTime = newTime.getTime ? newTime : new Date(newTime);
currTime = newTime && newTime.getTime ? newTime : new Date(newTime);
this.renderTrajectories();
},
},

/**
* Keep track of the last update of the interval.
* Useful when the speed increase.
*/
lastUpdateTime: {
value: new Date(),
writable: true,
},

/**
* Keep track of which trajectories are currently drawn.
*/
Expand Down Expand Up @@ -391,7 +383,10 @@ const TrackerLayerMixin = (Base) =>
this.stopUpdateTime();
this.updateTimeDelay = this.getRefreshTimeInMs();
this.updateTimeInterval = setInterval(() => {
this.time = this.time.getTime() + (new Date() - this.time) * this.speed;
// When live=true, we update the time with new Date();
this.time = this.live
? new Date()
: this.time.getTime() + this.updateTimeDelay * this.speed;
}, this.updateTimeDelay);
}

Expand Down
2 changes: 0 additions & 2 deletions src/doc/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ const useStyles = makeStyles({
flexGrow: 1,
overflowY: 'auto',
paddingBottom: 115,
minHeight: 'calc(100vh - 528px)',
maxWidth: 'calc(85vw + 48px)',
margin: 'auto',
marginTop: 30,
},
Expand Down
2 changes: 1 addition & 1 deletion src/doc/components/Example.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const Example = () => {
}, [example, htmlFileName, jsFileName, readmeFileName]);

return (
<div style={{ maxWidth: '85vh', margin: 'auto', marginTop: 30 }}>
<div style={{ margin: 'auto', marginTop: 30 }}>
<Grid container direction="column" spacing={3}>
<Grid item xs={12}>
<Typography variant="h1" className="headline">
Expand Down
3 changes: 2 additions & 1 deletion src/ol/layers/MapboxStyleLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ class MapboxStyleLayer extends Layer {
* @param {Event} evt Layer's event that has called the function.
* @private
*/
applyLayoutVisibility() {
// eslint-disable-next-line no-unused-vars
applyLayoutVisibility(evt) {
const { visible } = this;
const { mbMap } = this.mapboxLayer;
const filterFunc = this.styleLayersFilter;
Expand Down
13 changes: 1 addition & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13987,25 +13987,14 @@ worker-farm@^1.7.0:
dependencies:
errno "~0.1.7"

<<<<<<< HEAD
worker-loader@^2.0.0:
worker-loader@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-2.0.0.tgz#45fda3ef76aca815771a89107399ee4119b430ac"
integrity sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==
dependencies:
loader-utils "^1.0.0"
schema-utils "^0.4.0"

wrap-ansi@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85"
integrity sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=
dependencies:
string-width "^1.0.1"
strip-ansi "^3.0.1"

=======
>>>>>>> olivier/tracker
wrap-ansi@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba"
Expand Down

0 comments on commit 9f10715

Please # to comment.