Normalize ornament positioning relative to safe areas on iOS and Android
@maios já está trabalhando nisso.
Desde 15/7/2026.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
Mapbox ornaments such as the logo, attribution button, compass, and scale bar are positioned differently on iOS and Android when the map extends behind system UI.
On iOS, the native Maps SDK treats ornament margins as relative to the MapView safe area. https://docs.mapbox.com/ios/maps/api/10.5.1/Structs/OrnamentOptions.html
On Android, ornament margins are applied relative to the edges of the native map view. System insets are not handled in the same way.
This results in inconsistent ornament positioning between platforms.
There is also a visual alignment difference between the attribution ornament on iOS and Android. On iOS, the attribution is rendered inside a button with additional internal padding, while Android aligns it more closely to the configured ornament margin. As a result, using the same marginLeft for the attribution and logo does not necessarily align their visible content on iOS, even when their ornament frames share the same position.
Current Behavior safe area
The same ornament settings produce different visual positions on iOS and Android.
For example:
await mapboxMap.logo.updateSettings(
LogoSettings(
position: OrnamentPosition.BOTTOM_LEFT,
marginLeft: 8,
marginBottom: 8,
),
);
The expected interpretation is:
8 logical pixels from the bottom-left safe-area boundary
The effective behavior is closer to:
iOS: safe-area inset + 8
Android: map-view edge + 8
A typical workaround looks like this:
final safeArea = MediaQuery.paddingOf(context);
final bottomMargin = Platform.isAndroid
? safeArea.bottom + 8
: 8;
This workaround must be repeated for every affected ornament and every relevant edge. It also couples application code to a native platform difference that is not represented by the Flutter API.
Current Behavior attribution
For example, an additional iOS-specific offset may be required to visually align the attribution with the logo:
const iOSAttributionContentInset = 8.0;
final attributionLeftMargin = Platform.isIOS
? (logoLeftMargin - iOSAttributionContentInset).clamp(0.0, double.infinity)
: logoLeftMargin;
await mapboxMap.attribution.updateSettings(
AttributionSettings(
position: OrnamentPosition.BOTTOM_LEFT,
marginLeft: attributionLeftMargin,
marginBottom: 36,
),
);
Without this adjustment, the attribution button can appear visually indented compared with the logo on iOS, even when both use the same configured left margin.
Expected Behavior
The Flutter SDK should expose a platform-consistent ornament positioning model.
When safe-area-aware positioning is enabled, ornament margins should be measured from the Flutter view's unobstructed safe-area boundary on both iOS and Android.
- Linguagem predominante
- Dart
- Estrelas
- 382
- Forks
- 205
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de mapbox/mapbox-maps-flutter
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 30/100
mapbox/mapbox-maps-flutter#1152 ·
-
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
mapbox/mapbox-maps-flutter#1150 · 1 comentário ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
mapbox/mapbox-maps-flutter#1144 ·
-
iOS: the map cannot be captured or read by flutter, because it is a platform viewTalvez já em andamento @Nixxx19 assumiu há 92 dias. Aberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
mapbox/mapbox-maps-flutter#1142 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
mapbox/mapbox-maps-flutter#1140 ·
Todas as issues de mapbox/mapbox-maps-flutter
Issues semelhantes
-
消费码加载时间太长Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
HeZeBang/TechPie-flutter#294 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
ccch1mneyyy/dsh-Go#2192 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100