Skip to content

Commit

Permalink
Fix lite mode map instance restoration crash
Browse files Browse the repository at this point in the history
This fixes a crash in the sample app
  • Loading branch information
fynngodau authored and mar-v-in committed Sep 15, 2023
1 parent 4a2b5cb commit 53eb20c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class LiteGoogleMapImpl(context: Context, var options: GoogleMapOptions) : Abstr

if (savedInstanceState?.containsKey(BUNDLE_CAMERA_POSITION) == true) {
cameraPosition = savedInstanceState.getParcelable(BUNDLE_CAMERA_POSITION)!!
cameraBounds = savedInstanceState.getParcelable(BUNDLE_CAMERA_BOUNDS)
cameraBounds = (savedInstanceState.getParcelable(BUNDLE_CAMERA_BOUNDS) as LatLngBounds?)?.toMapbox()
}

postUpdateSnapshot()
Expand Down Expand Up @@ -616,7 +616,7 @@ class LiteGoogleMapImpl(context: Context, var options: GoogleMapOptions) : Abstr

override fun onSaveInstanceState(outState: Bundle) {
outState.putParcelable(BUNDLE_CAMERA_POSITION, cameraPosition)
outState.putParcelable(BUNDLE_CAMERA_BOUNDS, cameraBounds)
outState.putParcelable(BUNDLE_CAMERA_BOUNDS, cameraBounds?.toGms())
}

override fun setContentDescription(desc: String?) {
Expand Down

0 comments on commit 53eb20c

Please sign in to comment.