Commit 96ff9ddeddaa37273b2065906ca0373b66d2109f

Authored by Dmitriymush
1 parent 23594669

Fixes after review

... ... @@ -629,7 +629,7 @@ export default abstract class LeafletMap {
629 629 }
630 630 this.points.addLayer(point);
631 631 });
632   - if(i === 0) {
  632 + if(i === (pointsData.length - 1)) {
633 633 this.map.addLayer(this.points);
634 634 }
635 635 }
... ...
... ... @@ -32,7 +32,7 @@
32 32 [ngStyle]="{'background-color': settings.tooltipColor, 'opacity': settings.tooltipOpacity, 'color': settings.tooltipFontColor}">
33 33 <div *ngFor="let mainTooltip of mainTooltips"
34 34 [innerHTML]="mainTooltip"
35   - [ngStyle]="{'padding': '10px 0'}">
  35 + ngStyle="{'padding': '10px 0'}">
36 36 </div>
37 37 </div>
38 38 </div>
... ...
... ... @@ -73,6 +73,9 @@
73 73 }
74 74
75 75 .trip-animation-tooltip {
  76 + display: flex;
  77 + overflow: auto;
  78 + max-height: 90%;
76 79 position: absolute;
77 80 top: 30px;
78 81 right: 0;
... ... @@ -86,4 +89,4 @@
86 89 }
87 90 }
88 91 }
89   -}
\ No newline at end of file
  92 +}
... ...
... ... @@ -141,7 +141,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy
141 141
142 142 timeUpdated(time: number) {
143 143 this.currentTime = time;
144   - let currentPosition = this.interpolatedTimeData
  144 + const currentPosition = this.interpolatedTimeData
145 145 .map(dataSource => dataSource[time])
146 146 for(let j = 0; j < this.interpolatedTimeData.length; j++) {
147 147 if (isUndefined(currentPosition[j])) {
... ... @@ -175,7 +175,7 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy
175 175 this.mapWidget.map.updatePolygons(this.interpolatedTimeData);
176 176 }
177 177 if (this.settings.showPoints) {
178   - this.mapWidget.map.updatePoints(formattedInterpolatedTimeData, this.calcTooltip);
  178 + this.mapWidget.map.updatePoints(formattedInterpolatedTimeData.map(ds => _.union(ds)), this.calcTooltip);
179 179 }
180 180 this.mapWidget.map.updateMarkers(currentPosition, true, (trip) => {
181 181 this.activeTrip = trip;
... ... @@ -235,20 +235,19 @@ export class TripAnimationComponent implements OnInit, AfterViewInit, OnDestroy
235 235 this.mainTooltips.push(this.sanitizer.sanitize(SecurityContext.HTML, tooltipText));
236 236 }
237 237 this.cd.detectChanges();
238   - this.activeTrip = point;
239 238 }
240 239 return tooltipText;
241 240 }
242 241
243 242 calcLabel(formattedDataArr: FormattedData[]) {
244   - this.label = '';
  243 + let labelToSet = '';
245 244 for (let formattedData of formattedDataArr) {
246   - const data = formattedData;
247 245 const labelText: string = this.settings.useLabelFunction ?
248   - safeExecute(this.settings.labelFunction, [data, this.historicalData, data.dsIndex]) : this.settings.label;
249   - const label = (parseWithTranslation.parseTemplate(labelText, data, true));
250   - this.label = this.label.length ? this.label + ',' + label : label;
  246 + safeExecute(this.settings.labelFunction, [formattedData, this.historicalData, formattedData.dsIndex]) : this.settings.label;
  247 + const label = (parseWithTranslation.parseTemplate(labelText, formattedData, true));
  248 + labelToSet = labelToSet.length ? labelToSet + ',' + label : label;
251 249 }
  250 + this.label = labelToSet;
252 251 }
253 252
254 253 interpolateArray(originData: FormattedData[]) {
... ...