From fc4bbb4e4c0e1435b6d4599c79816575dcc8d01d Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Sun, 16 Jan 2022 04:28:35 -0600 Subject: Fixed NullPointerException (probably) --- .../java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'androidApp/src/main/java/mx/trackermap/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 a8478fd..f577613 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 @@ -347,11 +347,13 @@ class MapFragment : GlobeMapFragment() { } fun updateTile(layer: MapLayer) { - val tileInfo = RemoteTileInfoNew(layer.url, layer.minZoom, layer.maxZoom) - this.tileInfo = tileInfoSetCacheDir(layer.url, tileInfo) - this.tileInfo?.let { - loader?.changeTileInfo(it) - setZoomLimits(tileInfo.minZoom, tileInfo.maxZoom) + mapControl?.addPostSurfaceRunnable { + val tileInfo = RemoteTileInfoNew(layer.url, layer.minZoom, layer.maxZoom) + this.tileInfo = tileInfoSetCacheDir(layer.url, tileInfo) + this.tileInfo?.let { + loader?.changeTileInfo(it) + setZoomLimits(tileInfo.minZoom, tileInfo.maxZoom) + } } } -- cgit v1.2.3