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

When animating the camera to LatLngBounds, the padding persists #3197

Open
michalgwo opened this issue Feb 3, 2025 · 2 comments
Open

When animating the camera to LatLngBounds, the padding persists #3197

michalgwo opened this issue Feb 3, 2025 · 2 comments
Labels

Comments

@michalgwo
Copy link

MapLibre Android Version

11.8.0

Android SDK Version

API 29

Device

Xiaomi Redmi Note 7

What happened?

According to the documentation newLatLngBounds

You can specify padding, in order to inset the bounding box from the map view's edges. The padding will not persist and impact following camera transformations.

In fact, padding does persist.

Steps to reproduce

  1. Set logger, so you can see that padding persist
map.addOnCameraMoveListener {
  println("cameraPosition: ${map.cameraPosition}")
}
  1. Run the code
map.animateCamera(
  CameraUpdateFactory.newLatLngBounds(
    bounds = LatLngBounds.from(50.06807238031317, 20.009155194730226, 50.04007893350368, 19.91854897235649),
    bearing = 0.0,
    tilt = 0.0,
    paddingLeft = 70,
    paddingTop = 70,
    paddingRight = 70,
    paddingBottom = 900,
  ),
  1000,
)
  1. Look at the log and see that Padding:[70.00000143051147, 70.00000143051147, 70.00000143051147, 900.0000228881836] is there even after other camera transformations. It's also visible when zoomed out, for example, screenshot from my app when zoomed out after animateCamera() with padding.

Image

Renderer

OpenGL (choose this if you are unsure)

Relevant log output

Additional context

No response

@louwers
Copy link
Collaborator

louwers commented Feb 3, 2025

Could you check if this happens prior to 11.8.0?

@michalgwo
Copy link
Author

It happens on 11.7.1 and 11.4.0 as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants