mapbox / mapbox/mapbox-maps-android

ScaleBar is not correctly aligned when using an End alignment

Open
#2,492 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Kotlin
Stars
578
Forks
161
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Android OS version: 15 (AP31.240617.015)
- Devices affected: Pixel 7a
- Maps SDK Version: 11.7.0

## Observed behavior and steps to reproduce

When using the ScaleBar (with Compose) with an End alignment (e.g. TopEnd), the ScaleBar is not correctly aligned at the end, because it seems to reserve space to grow at the end.

Using the following configuration:
```
scaleBar = {
ScaleBar(
modifier = Modifier.background(Color.Magenta),
alignment = Alignment.TopEnd,
)
}
```

## Expected behavior

Instead in that case, the ScaleBar should be end aligned and it should grow towards the start as needed.

## Additional links and references

![image](https://github.com/user-attachments/assets/1c73bde8-0bed-4842-82e1-9bf9943e235a)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Compose ScaleBar configuration with Alignment.TopEnd on the affected Android setup, then trace the ScaleBar alignment and sizing behavior. Done means the ScaleBar is aligned to the end edge and grows toward the start without reserving space beyond that edge.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.