From a2ba612c515a53cb6e7f283858a518d60188651b Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sun, 16 Jan 2022 04:14:04 -0600 Subject: Removed problematic layer pre-initialization --- .../main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 2 +- .../java/mx/trackermap/TrackerMap/android/map/UnitMapFragment.kt | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'androidApp/src/main/java/mx/trackermap') 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 c4e5fc8..a8478fd 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 @@ -346,7 +346,7 @@ class MapFragment : GlobeMapFragment() { } } - fun updateTileInfo(layer: MapLayer) { + fun updateTile(layer: MapLayer) { val tileInfo = RemoteTileInfoNew(layer.url, layer.minZoom, layer.maxZoom) this.tileInfo = tileInfoSetCacheDir(layer.url, tileInfo) this.tileInfo?.let { 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 66ccc7a..6f6596f 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 @@ -15,7 +15,6 @@ import mx.trackermap.TrackerMap.android.devices.Action import mx.trackermap.TrackerMap.android.devices.UnitRenderData import mx.trackermap.TrackerMap.android.units.UnitFragment import mx.trackermap.TrackerMap.android.units.UnitsViewModel -import mx.trackermap.TrackerMap.client.models.MapLayer import mx.trackermap.TrackerMap.client.models.UnitInformation @DelicateCoroutinesApi @@ -57,9 +56,7 @@ class UnitMapFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment unitsMapFragment.markerCallback = unitsViewModel::selectUnitWith val layer = resources.getStringArray(R.array.maps_streets_tile) - unitsViewModel.setMapLayer(MapLayer( - layer[0], layer[1].toInt(), layer[2].toInt(), layer[3] - )) + binding.attributionText.text = HtmlCompat.fromHtml(layer[3], 0) } private fun setupObservers() { @@ -103,7 +100,7 @@ class UnitMapFragment(private val unitsViewModel: UnitsViewModel) : UnitFragment unitsViewModel.mapLayer.observe(viewLifecycleOwner) { layer -> Log.d("UnitMapFragment", "Loading layer!") - unitsMapFragment.updateTileInfo(layer) + unitsMapFragment.updateTile(layer) binding.attributionText.text = HtmlCompat.fromHtml(layer.attribution, 0) } -- cgit v1.2.3