What happened?
cameraState.animateTo(newPosition) returns normally, but cameraState.position never changes, map does not move. No exception, no crash, no log output. Reproduces identically on Android and iOS.
cameraState.jumpTo(boundingBox, ...) shows the same symptom (initial bounds fit never applies).
Direct assignment (cameraState.position = newPosition) works reliably as a workaround. Having duration = Duration.ZERO works also.
Affected Platforms
Platform Version
Android 14 (physical device), iOS 17+ (simulator/device)
Library Version
0.15.0
Sample Code
@Composable
fun MyMap() {
val cameraState = rememberCameraState(firstPosition = CameraPosition(
target = Position(longitude = 2.3522, latitude = 48.8566),
zoom = 10.0,
))
val scope = rememberCoroutineScope()
Column {
MaplibreMap(
modifier = Modifier.fillMaxWidth().height(400.dp),
cameraState = cameraState,
)
Button(onClick = {
scope.launch {
cameraState.animateTo(
CameraPosition(
target = Position(longitude = -0.1276, latitude = 51.5072),
zoom = 10.0,
)
)
// cameraState.position still equals the Paris position here.
}
}) {
Text("Fly to London")
}
}
}
What happened?
cameraState.animateTo(newPosition)returns normally, butcameraState.positionnever changes, map does not move. No exception, no crash, no log output. Reproduces identically on Android and iOS.cameraState.jumpTo(boundingBox, ...)shows the same symptom (initial bounds fit never applies).Direct assignment (
cameraState.position = newPosition) works reliably as a workaround. Havingduration = Duration.ZEROworks also.Affected Platforms
Platform Version
Android 14 (physical device), iOS 17+ (simulator/device)
Library Version
0.15.0
Sample Code