diff options
2 files changed, 4 insertions, 1 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt index 1f1bb15..e1a24ec 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsFragment.kt @@ -128,6 +128,7 @@ class UnitReportsFragment : Fragment() { when (report) { is ReportController.Report.PositionsReport -> { display(report.positions) + display(unitReportsViewModel.geofences.value!!) showMap(true) } is ReportController.Report.EventsReport -> { @@ -136,6 +137,7 @@ class UnitReportsFragment : Fragment() { } is ReportController.Report.StopsReport -> { display(report.stops) + display(unitReportsViewModel.geofences.value!!) showMap(true) } is ReportController.Report.XlsxReport -> { @@ -301,6 +303,7 @@ class UnitReportsFragment : Fragment() { } private fun display(geofences: Array<Geofence>) { + Log.d("UnitReportsFragment", "Geofences: $geofences") if (reportsMapFragment.hasStarted) { Log.d("UnitReportsFragment", "Displaying geofences: $geofences") reportsMapFragment.displayGeofences(geofences) diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt index a957435..7d1e028 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt @@ -25,7 +25,7 @@ class UnitReportsViewModel( private val _reportPeriod: MutableLiveData<ReportDates.ReportPeriod> = savedStateHandle.getLiveData("reportPeriod", null) private val _report: MutableLiveData<ReportController.Report> = MutableLiveData() - private val _geofences: MutableLiveData<Array<Geofence>> = MutableLiveData() + private val _geofences: MutableLiveData<Array<Geofence>> = MutableLiveData(emptyArray()) val deviceId: LiveData<Int> get() = _deviceId val reportType: LiveData<ReportController.ReportType> get() = _reportType |