aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src
diff options
context:
space:
mode:
Diffstat (limited to 'androidApp/src')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt4
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt3
2 files changed, 4 insertions, 3 deletions
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
index e3f4ead..a45b864 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt
@@ -127,7 +127,7 @@ class MapFragment : GlobeMapFragment() {
}
}
- fun display(markers: Array<Marker>, isReport: Boolean) {
+ fun display(markers: Array<Marker>, isReport: Boolean, center: Boolean = true) {
Log.d("MapFragment", "Displaying markers")
clear()
@@ -219,7 +219,7 @@ class MapFragment : GlobeMapFragment() {
}
// Center map to bounds
- if (markers.isNotEmpty()) {
+ if (center && markers.isNotEmpty()) {
val mbr = Mbr()
points.forEach {
mbr.addPoint(it)
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
index cc9a551..f79f8bd 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt
@@ -63,7 +63,8 @@ class UnitMapFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment
unitsMapFragment.display(
units.mapNotNull(MarkerTransformations::unitToMarker).toTypedArray(),
- isReport = false
+ isReport = false,
+ center = unitsViewModel.selectedUnit.value == null
)
}