Skip to content

Conversation

haythemhd
Copy link

@haythemhd haythemhd commented Aug 10, 2025

**** Context:
On Android, cameraState.animateCamera(zoom = …) updates zoom correctly.
On iOS, zoom buttons appeared to do nothing.
**** Root cause:
Inconsistent conversion of zoom level to MapKit camera distance.
Initialization used a lookup-based zoomToDistance(zoom), while animateCamera used a different “base distance” formula; the mismatch produced negligible distance changes, so the zoom effect wasn’t visible.
**** Changes:
KrossCameraPositionState.ios.kt: use zoomToDistance(zoom) in animateCamera same mapping as initialization.
Remove the “base distance” logic and unused helper that caused an unresolved reference linter error.
Keep tilt/bearing behavior unchanged.
**** Impact:
Zoom buttons now work on iOS and match Android behavior.
Code is simpler and consistent; linter error resolved.

Adds center property to KrossCameraPositionState

…tate

**** Context:
On Android, cameraState.animateCamera(zoom = …) updates zoom correctly.
On iOS, zoom buttons appeared to do nothing.
**** Root cause:
Inconsistent conversion of zoom level to MapKit camera distance.
Initialization used a lookup-based zoomToDistance(zoom), while animateCamera used a different “base distance” formula; the mismatch produced negligible distance changes, so the zoom effect wasn’t visible.
**** Changes:
KrossCameraPositionState.ios.kt: use zoomToDistance(zoom) in animateCamera same mapping as initialization.
Remove the “base distance” logic and unused helper that caused an unresolved reference linter error.
Keep tilt/bearing behavior unchanged.
**** Impact:
Zoom buttons now work on iOS and match Android behavior.
Code is simpler and consistent; linter error resolved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant