mapbox / mapbox/mapbox-maps-ios

MapViewAnnotation positions not updated after device rotation in non-full-screen iPad window

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

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Mapbox Maps SDK: 11.18.2
- Xcode: 26.3
- iOS: 26.4
- Device: iPad 11 Pro (physical)
- SwiftUI

## Observed behavior and steps to reproduce

When using MapViewAnnotation in a SwiftUI Map, annotation positions become incorrect after device rotation when the app window is not full-screen (Split View, Slide Over, or Stage Manager resized window).

The annotations remain at their pre-rotation screen positions instead of being recalculated for the new map projection.

## Expected behavior

Annotations should reposition to match their geographic coordinates in the new map projection, just like PolylineAnnotation and other layer-based annotations do.

## Notes / preliminary analysis

- Full-screen window + rotation: annotations briefly shift but snap back correctly
- Non-full-screen window + rotation: annotations shift and stay wrong
- Dragging the system window resize handle immediately fixes the positions (annotations snap to correct locations)

## Additional links and references

![Image](https://github.com/user-attachments/assets/b9b6b765-4d7a-47dc-9346-60a34dbf499e)
![Image](https://github.com/user-attachments/assets/c9d89cf3-1f74-4e3a-9500-361c9080e6e7)

Workarounds attempted (none successful):

- proxy.map?.triggerRepaint()
- Camera center nudge and restore
- Zoom nudge and restore
- Viewport reset (.idle then restore)
- .onGeometryChange to detect container size change

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

Reproduce the issue with MapViewAnnotation in a SwiftUI Map on an iPad using Split View, Slide Over, or a resized Stage Manager window, then rotate the device and compare the annotation positions with layer-based annotations. Start by tracing the MapViewAnnotation geometry and rotation-update path; done means annotations are recalculated and remain aligned with their geographic coordinates without requiring a window resize.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, swift
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.