Skip to content

Commit

Permalink
map: also clear history, after vehicle timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelCoding committed May 9, 2024
1 parent 46ec256 commit 0d855cb
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions src/app/pages/map/map-windshield/map-windshield.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,26 +190,26 @@ export class MapWindshieldComponent implements OnInit, OnDestroy {
const delay = data.delayed ?? 0;

switch (line?.type) {
case Type.TRAM:
icon = new Icon({
size: [40, 40],
img: getImage(TRAM_ICONS, Math.round(delay / 60), -7, 7),
});
offset = -4;
break;
case Type.BUS:
icon = new Icon({
size: [40, 40],
img: getImage(BUS_ICONS, Math.round(delay / 60), -7, 7),
});
offset = -4;
break;
default:
icon = new Icon({
size: [40, 40],
img: IMG,
});
offset = -10;
case Type.TRAM:
icon = new Icon({
size: [40, 40],
img: getImage(TRAM_ICONS, Math.round(delay / 60), -7, 7),
});
offset = -4;
break;
case Type.BUS:
icon = new Icon({
size: [40, 40],
img: getImage(BUS_ICONS, Math.round(delay / 60), -7, 7),
});
offset = -4;
break;
default:
icon = new Icon({
size: [40, 40],
img: IMG,
});
offset = -10;
}

if (vehicle) {
Expand Down Expand Up @@ -276,6 +276,7 @@ export class MapWindshieldComponent implements OnInit, OnDestroy {
}

this.vehicles.removeFeature(feature)
t this.vehicleHistory.removeFeature(this.vehicleHistory.getFeatureById(feature.getId1()!!)!);
});
})
}
Expand Down

0 comments on commit 0d855cb

Please sign in to comment.