diff --git a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts index b74323a00a..43c954aeed 100644 --- a/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts +++ b/ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet-map.ts @@ -629,7 +629,7 @@ export default abstract class LeafletMap { } this.points.addLayer(point); }); - if(i === 0) { + if(i === (pointsData.length - 1)) { this.map.addLayer(this.points); } } diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html index be82969986..8d0998f063 100644 --- a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html +++ b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.html @@ -32,7 +32,7 @@ [ngStyle]="{'background-color': settings.tooltipColor, 'opacity': settings.tooltipOpacity, 'color': settings.tooltipFontColor}">
+ ngStyle="{'padding': '10px 0'}">
diff --git a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss index cdb28f8a27..b1a49da9fb 100644 --- a/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss +++ b/ui-ngx/src/app/modules/home/components/widget/trip-animation/trip-animation.component.scss @@ -73,6 +73,9 @@ } .trip-animation-tooltip { + display: flex; + overflow: auto; + max-height: 90%; position: absolute; top: 30px; right: 0; @@ -86,4 +89,4 @@ } } } -} \ No newline at end of file +} 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 a392481259..4477d855a2 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 @@ -141,7 +141,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy timeUpdated(time: number) { this.currentTime = time; - let currentPosition = this.interpolatedTimeData + const currentPosition = this.interpolatedTimeData .map(dataSource => dataSource[time]) for(let j = 0; j < this.interpolatedTimeData.length; j++) { if (isUndefined(currentPosition[j])) { @@ -175,7 +175,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy this.mapWidget.map.updatePolygons(this.interpolatedTimeData); } if (this.settings.showPoints) { - this.mapWidget.map.updatePoints(formattedInterpolatedTimeData, this.calcTooltip); + this.mapWidget.map.updatePoints(formattedInterpolatedTimeData.map(ds => _.union(ds)), this.calcTooltip); } this.mapWidget.map.updateMarkers(currentPosition, true, (trip) => { this.activeTrip = trip; @@ -235,20 +235,19 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy this.mainTooltips.push(this.sanitizer.sanitize(SecurityContext.HTML, tooltipText)); } this.cd.detectChanges(); - this.activeTrip = point; } return tooltipText; } calcLabel(formattedDataArr: FormattedData[]) { - this.label = ''; + let labelToSet = ''; for (let formattedData of formattedDataArr) { - const data = formattedData; const labelText: string = this.settings.useLabelFunction ? - safeExecute(this.settings.labelFunction, [data, this.historicalData, data.dsIndex]) : this.settings.label; - const label = (parseWithTranslation.parseTemplate(labelText, data, true)); - this.label = this.label.length ? this.label + ',' + label : label; + safeExecute(this.settings.labelFunction, [formattedData, this.historicalData, formattedData.dsIndex]) : this.settings.label; + const label = (parseWithTranslation.parseTemplate(labelText, formattedData, true)); + labelToSet = labelToSet.length ? labelToSet + ',' + label : label; } + this.label = labelToSet; } interpolateArray(originData: FormattedData[]) {