aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src/main')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/details/reports/UnitReportsViewModel.kt4
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MarkerTransformations.kt8
2 files changed, 8 insertions, 4 deletions
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 851516e..8db7cda 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
@@ -127,7 +127,9 @@ class UnitReportsViewModel(
Log.d("UnitReportsVM", "Current date:${dateFormat.format(currentDate)}")
Log.d("UnitReportsVM", "Previous date:${dateFormat.format(previousDate)}")
- _report.postValue(Report.LoadingReport)
+ if (!xlsx) {
+ _report.postValue(Report.LoadingReport)
+ }
viewModelScope.launch {
when (_reportType.value!!) {
ReportType.POSITIONS -> fetchPositions(previousDate, currentDate, xlsx)
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MarkerTransformations.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MarkerTransformations.kt
index e77471b..933cd8a 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MarkerTransformations.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MarkerTransformations.kt
@@ -1,5 +1,6 @@
package mx.trackermap.TrackerMap.android.map
+import android.util.Log
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.client.models.Position
import mx.trackermap.TrackerMap.client.models.Stop
@@ -35,15 +36,16 @@ object MarkerTransformations {
}
fun stopToMarker(stop: Stop): MapFragment.Marker? {
- if (stop.lat == null || stop.lon == null) {
+ Log.d("MarkerTransformations", "stopToMarker($stop)")
+ if (stop.latitude == null || stop.longitude == null) {
return null
}
return MapFragment.Marker(
stop.deviceId!!,
stop.deviceName!!,
- stop.lat!!,
- stop.lon!!
+ stop.latitude!!,
+ stop.longitude!!
)
}