From 7e500c5237bc979408d8831f9628993929527e92 Mon Sep 17 00:00:00 2001 From: kalutkaz Date: Tue, 26 Apr 2022 12:48:47 +0300 Subject: [PATCH 1/2] fix trip animation map --- .../trip-animation/trip-animation.component.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 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 7db38e2416..2c30bf4e05 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 @@ -136,14 +136,12 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy item => this.clearIncorrectFirsLastDatapoint(item)).filter(arr => arr.length); this.interpolatedTimeData.length = 0; this.formattedInterpolatedTimeData.length = 0; - if (this.historicalData.length) { - const prevMinTime = this.minTime; - const prevMaxTime = this.maxTime; - this.calculateIntervals(); - const currentTime = this.calculateCurrentTime(prevMinTime, prevMaxTime); - if (currentTime !== this.currentTime) { - this.timeUpdated(currentTime); - } + const prevMinTime = this.minTime; + const prevMaxTime = this.maxTime; + this.calculateIntervals(); + const currentTime = this.calculateCurrentTime(prevMinTime, prevMaxTime); + if (currentTime !== this.currentTime) { + this.timeUpdated(currentTime); } this.mapWidget.map.map?.invalidateSize(); this.mapWidget.map.setLoading(false); From b64e3149be5dc9f2bfd35dc0c593f2de61284ae2 Mon Sep 17 00:00:00 2001 From: kalutkaz Date: Tue, 26 Apr 2022 12:49:47 +0300 Subject: [PATCH 2/2] Refactoring --- .../components/widget/trip-animation/trip-animation.component.ts | 1 - 1 file changed, 1 deletion(-) 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 2c30bf4e05..db1e53790d 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 @@ -48,7 +48,6 @@ import { import { FormattedData, JsonSettingsSchema, WidgetConfig } from '@shared/models/widget.models'; import moment from 'moment'; import { - deepClone, formattedDataArrayFromDatasourceData, formattedDataFormDatasourceData, isDefined, isUndefined, mergeFormattedData,