aboutsummaryrefslogtreecommitdiff
path: root/androidApp/src/main/java/mx
diff options
context:
space:
mode:
authorIsidro Henoch <imhenoch@protonmail.com>2022-01-16 21:34:22 -0600
committerIsidro Henoch <imhenoch@protonmail.com>2022-01-16 21:34:22 -0600
commit0e2bce2fda9711aaeaa536d254911b7651cbea6a (patch)
tree22e4a4d5ccbf9f1afbf917cf7aa90e53f1b578da /androidApp/src/main/java/mx
parent454d387736c4ed77340473b020449c0dbae9331f (diff)
downloadetbsa-trackermap-mobile-0e2bce2fda9711aaeaa536d254911b7651cbea6a.tar.gz
etbsa-trackermap-mobile-0e2bce2fda9711aaeaa536d254911b7651cbea6a.tar.bz2
etbsa-trackermap-mobile-0e2bce2fda9711aaeaa536d254911b7651cbea6a.zip
Fixes the zoom levels issue when changing map tiles
Diffstat (limited to 'androidApp/src/main/java/mx')
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt4
1 files changed, 4 insertions, 0 deletions
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 90ee36a..e96945e 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
@@ -101,6 +101,10 @@ class UnitMapFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment
unitsViewModel.mapLayer.observe(viewLifecycleOwner) { layer ->
Log.d("UnitMapFragment", "Loading layer!")
unitsMapFragment.updateTile(layer)
+ val selectedUnit = unitsViewModel.selectedUnit.value
+ selectedUnit?.let {
+ unitsMapFragment.focusOn(it.position!!.latitude!!, it.position!!.longitude!!)
+ }
binding.attributionText.text = HtmlCompat.fromHtml(layer.attribution, 0)
}