Animate camera while zooming to a user.

This commit is contained in:
Onuray Sahin 2022-07-20 15:57:56 +03:00
parent 372ff9ff97
commit 0f3e4046e1

View File

@ -28,10 +28,12 @@ fun MapboxMap?.zoomToLocation(locationData: LocationData, preserveCurrentZoomLev
} else { } else {
INITIAL_MAP_ZOOM_IN_PREVIEW INITIAL_MAP_ZOOM_IN_PREVIEW
} }
this?.cameraPosition = CameraPosition.Builder() this?.easeCamera {
.target(LatLng(locationData.latitude, locationData.longitude)) CameraPosition.Builder()
.zoom(zoomLevel) .target(LatLng(locationData.latitude, locationData.longitude))
.build() .zoom(zoomLevel)
.build()
}
} }
fun MapboxMap?.zoomToBounds(latLngBounds: LatLngBounds) { fun MapboxMap?.zoomToBounds(latLngBounds: LatLngBounds) {