mobility-toolbox-js 1.7.10-beta.3 → 2.0.0-beta.1

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
@@ -7,6 +7,8 @@ The tools in this library have been inspired by many projects realized for publi
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
 
10
+ ## Version 1.x.x
11
+ The master branch is now open for the version 2 development. The version 1 is now available in 1.x.x branch.
10
12
 
11
13
  ## Main Features
12
14
  * Display [real-time vehicle positions and prognosis data](http://tracker.geops.ch/) on a map.
@@ -272,9 +272,7 @@ const TrackerLayerMixin = (Base) =>
272
272
  * Id of the selected vehicle.
273
273
  */
274
274
  pixelRatio: {
275
- value:
276
- pixelRatio ||
277
- (typeof window !== 'undefined' ? window.devicePixelRatio : 1),
275
+ value: pixelRatio || window.devicePixelRatio || 1,
278
276
  writable: true,
279
277
  },
280
278
 
@@ -2,21 +2,17 @@
2
2
  * A very simple tracker style.
3
3
  * Display blue point for each train.
4
4
  */
5
- let canvas;
6
- const style = () => {
7
- if (!canvas) {
8
- document.createElement('canvas');
9
- canvas.width = 15;
10
- canvas.height = 15;
11
- const ctx = canvas.getContext('2d');
12
- ctx.arc(8, 8, 5, 0, 2 * Math.PI, false);
13
- ctx.fillStyle = '#8ED6FF';
14
- ctx.fill();
15
- ctx.lineWidth = 3;
16
- ctx.strokeStyle = 'black';
17
- ctx.stroke();
18
- ctx.lineWidth = 3;
19
- }
20
- return canvas;
21
- };
5
+ const canvas = document.createElement('canvas');
6
+ canvas.width = 15;
7
+ canvas.height = 15;
8
+ const ctx = canvas.getContext('2d');
9
+ ctx.arc(8, 8, 5, 0, 2 * Math.PI, false);
10
+ ctx.fillStyle = '#8ED6FF';
11
+ ctx.fill();
12
+ ctx.lineWidth = 3;
13
+ ctx.strokeStyle = 'black';
14
+ ctx.stroke();
15
+ ctx.lineWidth = 3;
16
+
17
+ const style = () => canvas;
22
18
  export default style;