diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-01-16 14:23:04 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-01-16 14:23:04 -0600 |
commit | 484c64d1682f65ad0741228963bdefda87b935ab (patch) | |
tree | 125554c319d03984b0dab803c5c74f758a3a45b2 /androidApp/src/main/java/mx/trackermap | |
parent | 41aad20b7ebe24f318476c7f3fdb6be744dd5b9d (diff) | |
download | etbsa-trackermap-mobile-484c64d1682f65ad0741228963bdefda87b935ab.tar.gz etbsa-trackermap-mobile-484c64d1682f65ad0741228963bdefda87b935ab.tar.bz2 etbsa-trackermap-mobile-484c64d1682f65ad0741228963bdefda87b935ab.zip |
Fixed NullPointerException and device not getting centered after selected from list view
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap')
-rw-r--r-- | androidApp/src/main/java/mx/trackermap/TrackerMap/android/map/MapFragment.kt | 12 |
1 files changed, 6 insertions, 6 deletions
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 cfb59a0..b8ce350 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 @@ -81,9 +81,9 @@ class MapFragment : GlobeMapFragment() { loader = QuadImageLoader(params, tileInfo, baseControl) loader?.setImageFormat(RenderController.ImageFormat.MaplyImageUShort565) - val latitude = 23.191 - val longitude = -100.36 - focusOn(latitude, longitude, height = 0.4, animated = false) + val latitude = 23.191 * Math.PI / 180 + val longitude = -100.36 * Math.PI / 180 + mapControl.setPositionGeo(latitude, longitude, 0.4) } override fun mapDidStopMoving( @@ -235,9 +235,9 @@ class MapFragment : GlobeMapFragment() { } mbr.expandByFraction(0.1) - mapControl.addPostSurfaceRunnable { - val zoom = mapControl.zoomLimitMax.coerceAtLeast( - mapControl.findHeightToViewBounds(mbr, mbr.middle())) + mapControl?.addPostSurfaceRunnable { + val zoom = mapControl.findHeightToViewBounds(mbr, mbr.middle()) + .coerceAtLeast(mapControl.zoomLimitMin) mapControl.setPositionGeo(mbr.middle(), zoom) } } |