mapbox / mapbox/mapbox-maps-ios
Map Rendering Issue: Blurry View After Viewport Update
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Xcode version: 16.1
- iOS version: 18.1
- Devices affected:
- Maps SDK Version: 11.8.0
## Observed behavior and steps to reproduce
In my iOS app, users can search for a location and tap on any search result. Upon tapping, the map animates to center on the selected location by adjusting the viewport. However, sometimes after the animation completes, the map appears blurred even though the user is at the correct location. The blur disappears when the user interacts with the map, such as by zooming in or out.
**Video Demonstration of Issue**: In this video, I searched for multiple locations. Notice that when I search for and animate to 'Cuba', the map appears blurred after the animation. The blur disappears once I interact with the map.
https://github.com/user-attachments/assets/a0332196-4172-4310-b1e2-2d2fe8c94136
**Code Snippet**:
``` swift
MapReader { _ in
Map(viewport: $viewport)
// MARK: - for places update camera
.onChange(of: updateCoordinate) { _ in
if let coordinates = selectedCoordinates {
// Step 1: Zoom out and rotate the globe
withViewportAnimation(.easeInOut(duration: 1.5)) {
viewport = .camera(
center: CLLocationCoordinate2D(
latitude: coordinates.latitude,
longitude: coordinates.longitude
), // Roughly set the direction
zoom: 2,
bearing: 0
)
}
// Roughly set the direction
// detach from the plane if the animation is in progress
DispatchQueue.main.asyncAfter(deadline: .now() + 1.5) {
withViewportAnimation(.easeInOut(duration: 2)) {
viewport = .camera(
center: CLLocationCoordinate2D(
latitude: coordinates.latitude,
longitude: coordinates.longitude
),
zoom: 12,
bearing: 0
)
}
}
}
}
}
```
## Expected behavior
Once the animation completes, the map should appear clear and sharp without requiring any user interaction.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the supplied Swift MapReader and Map viewport animation sequence on Xcode 16.1, iOS 18.1, and Maps SDK 11.8.0. Compare the map after both animations with its appearance after user interaction; done means the map remains clear and sharp when the animation completes.
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
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100