mobility-toolbox-js 1.7.8 → 1.7.10-beta.2
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/common/mixins/TrackerLayerMixin.js +3 -2
- package/common/utils/simpleTrackerStyle.js +17 -13
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -272,7 +272,9 @@ const TrackerLayerMixin = (Base) =>
|
|
|
272
272
|
* Id of the selected vehicle.
|
|
273
273
|
*/
|
|
274
274
|
pixelRatio: {
|
|
275
|
-
value:
|
|
275
|
+
value:
|
|
276
|
+
pixelRatio ||
|
|
277
|
+
(typeof window !== 'undefined' ? window.devicePixelRatio : 1),
|
|
276
278
|
writable: true,
|
|
277
279
|
},
|
|
278
280
|
|
|
@@ -535,7 +537,6 @@ const TrackerLayerMixin = (Base) =>
|
|
|
535
537
|
trajectories.sort(this.sort);
|
|
536
538
|
}
|
|
537
539
|
// console.timeEnd('sort');
|
|
538
|
-
window.trajectories = trajectories;
|
|
539
540
|
|
|
540
541
|
// console.time('render');
|
|
541
542
|
this.renderState = this.tracker.renderTrajectories(
|
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
* A very simple tracker style.
|
|
3
3
|
* Display blue point for each train.
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
canvas
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
ctx.
|
|
12
|
-
ctx.
|
|
13
|
-
ctx.
|
|
14
|
-
ctx.
|
|
15
|
-
ctx.lineWidth = 3;
|
|
16
|
-
|
|
17
|
-
|
|
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
|
+
};
|
|
18
22
|
export default style;
|