I am working on a simple Maps App and I am trying to make GoogleMap composable zoom-inanimation over 1000 ms duration.
So far I have this code:
Column( ... ) {
val destinationLatLng = LatLng(destination.lat, destination.lng)
val cameraPositionState = rememberCameraPositionState {
position = CameraPosition.fromLatLngZoom(destinationLatLng, 15f)
}
GoogleMap(
modifier = Modifier.fillMaxSize(),
cameraPositionState = cameraPositionState
//stuck on animating this
)
}
In the old good GoogleMap view I could animate the camera with this sample code.
googleMap.animateCamera(CameraUpdateFactory.newCameraPosition), 1000, null)
However, in Compose I am unable to re-engineer this to achieve the zoom-in animation.
I have looked at the docs for Compose for the Maps SDK and Maps Compose Library but I am still stuck.
Please let me know if there is a way to animate camera in Compose GoogleMap