Refactors control center for traffic lights

This commit is contained in:
David Eder
2021-06-13 18:32:29 +02:00
parent 67b74e93c5
commit a31f330663
4 changed files with 65 additions and 32 deletions
@@ -1,4 +1,5 @@
<agm-map disableDefaultUI="true" id="map" #map [zoom]="zoom" [latitude]="center.lat" [longitude]="center.lng">
<agm-marker (markerClick)="openInfoWindow(m.value.carEntity.vin)" [openInfoWindow]="true"
*ngFor="let m of car_markers | keyvalue" [iconUrl]="getIconUrlCar(m.value.carEvent.near_crash_event)"
[latitude]="m.value.carEvent.gps_location.latitude" [longitude]="m.value.carEvent.gps_location.longitude" [animation]="(m.value.carEvent.near_crash_event)?'BOUNCE':''">
@@ -13,14 +14,16 @@
<p>NCE: {{m.value.carEvent.near_crash_event}}</p>
</agm-info-window>
</agm-marker>
<agm-marker *ngFor="let m of traffic_light_markers | keyvalue" [iconUrl]="m.value.iconUrl"
[latitude]="m.value.lat" [longitude]="m.value.lng">
<agm-marker *ngFor="let m of traffic_light_markers | keyvalue" [iconUrl]="trafficLightToImage(m.value.trafficLightEvent.color)"
[latitude]="m.value.trafficLightEntity.location[1]" [longitude]="m.value.trafficLightEntity.location[0]">
<agm-info-window>
<p>Id: {{m.value.id}}</p>
<p>Switching Time: {{m.value.switchingTime}}</p>
<p>Range: {{m.value.range}}</p>
<p>Color: {{m.value.color}}</p>
<p>Last Switch: {{m.value.last_switch}}</p>
<p>Id: {{m.value.trafficLightEntity.id}}</p>
<p>Switching Time: {{m.value.trafficLightEntity.switchingTime}}</p>
<p>Range: {{m.value.trafficLightEntity.range}}</p>
<p>Color: {{m.value.trafficLightEvent.color}}</p>
<p>Last Switch: {{m.value.trafficLightEvent.last_switch}}</p>
</agm-info-window>
</agm-marker>
</agm-map>