diff options
Diffstat (limited to 'androidApp/src/main')
-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) } |