fix error with color for polyline after change of date-span

This commit is contained in:
tim-herbst 2021-01-03 14:20:39 +01:00
parent 89d4738da5
commit 210061442f
2 changed files with 11 additions and 5 deletions

View File

@ -79,13 +79,19 @@ export class TableComponent implements OnInit {
await this.service.fetchDashboardStationTo(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => { await this.service.fetchDashboardStationTo(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => {
this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red']; this.colors = ['black', 'gray', 'green', 'orange', 'purple', 'red'];
this.isLoadingToSource = false; this.isLoadingToSource = false;
this.stationToSource = source; this.stationToSource = this.setBikePointColorFromSource(source);
this.iterableToSource = this.setBikePointColorToSource(source); this.iterableToSource = source;
this.iterableToSource.forEach(bikePoint => {
bikePoint.polyLineColor = 'green';
});
}); });
this.service.fetchDashboardStationFrom(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => { this.service.fetchDashboardStationFrom(this.bikePoint.id, actualStartDate, actualEndDate).then((source) => {
this.isLoadingFromSource = false; this.isLoadingFromSource = false;
this.stationFromSource = source; this.stationFromSource = this.setBikePointColorFromSource(source);
this.iterableFromSource = this.setBikePointColorFromSource(source); this.iterableFromSource = source;
this.iterableFromSource.forEach(bikePoint => {
bikePoint.polyLineColor = 'red';
});
}); });
} }

View File

@ -161,7 +161,7 @@ export class MapService {
} }
drawLegend(): void { drawLegend(): void {
this.legend.onAdd = map => { this.legend.onAdd = () => {
const div = L.DomUtil.create('div', 'legend'); const div = L.DomUtil.create('div', 'legend');
div.innerHTML += `<h4>trips from/to bike station</h4>`; div.innerHTML += `<h4>trips from/to bike station</h4>`;
div.innerHTML += `<i style="background: red"></i><span>rents with ${this.dashBoardBikePoint.commonName} as destination</span><br>`; div.innerHTML += `<i style="background: red"></i><span>rents with ${this.dashBoardBikePoint.commonName} as destination</span><br>`;