diff options
author | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-16 21:34:22 -0600 |
---|---|---|
committer | Isidro Henoch <imhenoch@protonmail.com> | 2022-01-16 21:34:22 -0600 |
commit | 0e2bce2fda9711aaeaa536d254911b7651cbea6a (patch) | |
tree | 22e4a4d5ccbf9f1afbf917cf7aa90e53f1b578da /androidApp/src/main/java | |
parent | 454d387736c4ed77340473b020449c0dbae9331f (diff) | |
download | etbsa-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')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 4 |
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) } |