From 24e04fea20423a06835f7f4e903f1acc596616ce Mon Sep 17 00:00:00 2001 From: Artem Halushko Date: Tue, 12 May 2020 17:56:34 +0300 Subject: [PATCH] trip animation tooltip fix --- .../widget/trip-animation/trip-animation.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts index 7dfec08c9f..94f974ab5b 100644 --- a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts +++ b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.ts @@ -106,10 +106,14 @@ export class TripAnimationComponent implements OnInit, AfterViewInit { } timeUpdated(time: number) { - const currentPosition = this.interpolatedData.map(dataSource => dataSource[time]); + this.minTime = moment(this.intervals[this.intervals.length - 1]).format('YYYY-MM-DD HH:mm:ss'); + this.maxTime = moment(this.intervals[0]).format('YYYY-MM-DD HH:mm:ss'); + const currentPosition = this.interpolatedData.map(dataSource => dataSource[time]).map(ds => { + ds.minTime = this.minTime; + ds.maxTime = this.maxTime; + return ds; + }); this.activeTrip = currentPosition[0]; - this.minTime = moment(this.intervals[this.intervals.length - 1]).format('YYYY-MM-DD HH:mm:ss') - this.maxTime = moment(this.intervals[0]).format('YYYY-MM-DD HH:mm:ss') this.calcLabel(); this.calcTooltip(); if (this.mapWidget) {