From 58993740a5c7bea745969e2de3641499ab79d9c8 Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Mon, 17 Jan 2022 23:17:29 -0600 Subject: Fixed attribution text not changing with internal layer toggle and zoom out when switching layer to match limit --- .../src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 3 +++ .../java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt | 1 + 2 files changed, 4 insertions(+) (limited to 'androidApp/src') 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 2c47677..87fb44a 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 @@ -388,6 +388,9 @@ open class MapFragment : GlobeMapFragment() { this.tileInfo?.let { t -> loader?.changeTileInfo(t) setZoomLimits(tileInfo.minZoom, tileInfo.maxZoom) + + val pos = mapControl.positionGeo.toPoint2d().toDegrees() + focusOn(pos.y, pos.x, mapControl.positionGeo.z, animated = true) } } } diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt index cecb567..4ff4c16 100644 --- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt +++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapWrapperFragment.kt @@ -99,6 +99,7 @@ class MapWrapperFragment: Fragment() { if (mapFragment.hasStarted) { Utils.showLayersPopUp(context, it) { type -> mapFragment.updateLayer(type) + binding.attributionText.text = MapLayer.layers[type]?.attribution } } else { binding.mapLayerToggle.performClick() -- cgit v1.2.3