()
| 35 | fleetService = inject(FleetService); |
| 36 | |
| 37 | constructor() { |
| 38 | afterNextRender(() => { |
| 39 | import('leaflet').then((leaflet) => { |
| 40 | this.L = leaflet; |
| 41 | this.initMap(); |
| 42 | this.updateMarkers(); |
| 43 | }); |
| 44 | }); |
| 45 | |
| 46 | effect(() => { |
| 47 | const currentVehicles = this.fleetService.units(); |
| 48 | const activeUnitId = this.fleetService.activeUnitId(); |
| 49 | const isDark = this.fleetService.isDarkMode(); |
| 50 | |
| 51 | if (!this.map || !this.L) return; |
| 52 | |
| 53 | this.updateTileLayer(isDark); |
| 54 | this.updateMarkers(activeUnitId); |
| 55 | }); |
| 56 | } |
| 57 | |
| 58 | private updateTileLayer(isDark: boolean) { |
| 59 | if (!this.map || !this.L) return; |
nothing calls this directly
no test coverage detected