aboutsummaryrefslogtreecommitdiff
path: root/androidApp
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-01-13 19:12:41 -0600
committerIván Ávalos <avalos@disroot.org>2022-01-13 19:12:41 -0600
commit7789f475200134a6f1c0c7a855b52ccc2abe2555 (patch)
tree4cef00aa6d5a5071a1010c3ecc2585642dcc4459 /androidApp
parentc23de8adfa5492960fd26f113a3a377c7db134fa (diff)
downloadetbsa-trackermap-mobile-7789f475200134a6f1c0c7a855b52ccc2abe2555.tar.gz
etbsa-trackermap-mobile-7789f475200134a6f1c0c7a855b52ccc2abe2555.tar.bz2
etbsa-trackermap-mobile-7789f475200134a6f1c0c7a855b52ccc2abe2555.zip
Disable map filter auto centering when unit is selected
Diffstat (limited to 'androidApp')
-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
)
}