diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-13 19:12:41 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-13 19:12:41 -0600 |
commit | 7789f475200134a6f1c0c7a855b52ccc2abe2555 (patch) | |
tree | 4cef00aa6d5a5071a1010c3ecc2585642dcc4459 /androidApp | |
parent | c23de8adfa5492960fd26f113a3a377c7db134fa (diff) | |
download | etbsa-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.kt | 4 | ||||
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 3 |
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 ) } |