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 | 9786da25f385c51b50f398d1c2c1fe7973645c5d (patch) | |
tree | 125554c319d03984b0dab803c5c74f758a3a45b2 /androidApp/src/main/java/mx/trackermap/TrackerMap | |
parent | cefdbf2e352f52f2b07b138ed9ab722e2089578a (diff) | |
download | etbsa-trackermap-mobile-9786da25f385c51b50f398d1c2c1fe7973645c5d.tar.gz etbsa-trackermap-mobile-9786da25f385c51b50f398d1c2c1fe7973645c5d.tar.bz2 etbsa-trackermap-mobile-9786da25f385c51b50f398d1c2c1fe7973645c5d.zip |
Fixed NullPointerException and device not getting centered after selected from list view
Diffstat (limited to 'androidApp/src/main/java/mx/trackermap/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) } } |