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

Material Compass wrong behaviour when uneven padding is applied to the camera #270

Open
michalgwo opened this issue Feb 3, 2025 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@michalgwo
Copy link
Contributor

What happened?

When you set the padding to the camera (it happens only if padding at least on one side is different from the other sides), and then press the compass, the position of the camera changes. It should be easy to reproduce with the steps below, but please let me know if you can't, so I will attach a video.

It may be useful to see how malibre-native implemented compass click listener on Android. maplibreMap.setFocalBearing() is public, so we can easily implement this. I don't know about other platforms.

Affected Platforms

Android

Platform Version

Android API 29

Library Version

0.6.0

Sample Code

To reproduce:

  1. Go to Camera State Demo and set padding to the camera, for example, top = 10.dp, end = 100.dp
val cameraState = rememberCameraState(firstPosition = CameraPosition(target = CHICAGO, zoom = 15.0, padding = PaddingValues(top = 10.dp, end = 100.dp)))
  1. Run the app and try using the compass. The deviation is small after clicking the first time, but it's bigger the second and third times, so try it a couple of times.
@michalgwo michalgwo added the bug Something isn't working label Feb 3, 2025
@sargunv sargunv added this to the v0.7.0 milestone Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants