Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animate camera to LatLngBounds #258

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

michalgwo
Copy link
Contributor

@michalgwo michalgwo commented Jan 21, 2025

  • Android target - works fine
  • iOS target - unfortunately I don't have a Mac right now, so I can't implement it. It looks like camera:fittingCoordinateBounds:edgePadding: or setVisibleCoordinateBounds is the way to go
  • JS target - works fine, but FitBoundsOptions doesn't have a duration parameter, so currently it has no effect on JS. It was my first time working with JS target, so I'm unsure if I've done everything right.
  • Desktop target - the other animateCameraPosition() is not implemented on the desktop, so I left it unimplemented as well

Example of usage:

cameraState.animateTo(
  LatLngBounds(
    northEast = Position(20.009155194730226, 50.06807238031317),
    southWest = Position(19.91854897235649,50.04007893350368)
  ),
  padding = PaddingValues(50.dp),
  tilt = 0.0,
  bearing = 0.0
)

@sargunv sargunv added this to the v0.7.0 milestone Jan 22, 2025
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.

2 participants