mapbox / mapbox/mapbox-navigation-ios
Noticeable Black Flash Before NavigationMapView Loads
@MaximAlien is already working on this.
Since Aug 22, 2022.
- Dominant language
- Swift
- Stars
- 918
- Forks
- 326
- Avg merge
- 1h 16m
- Merged PRs (30d)
- 3
Description
Mapbox Navigation SDK version
2.6.0
Steps to reproduce
Please see attached video for the example. I've had the following code in viewDidLoad for Mapbox Navigation V0 and V1 (2 years) with no issues.
navigationMapView = NavigationMapView(frame: CGRect(x: 0.0, y: 0.0, width: mapHolder.frame.size.width, height: mapHolder.frame.size.height))
navigationMapView.delegate = self
navigationMapView.userLocationStyle = .puck2D()
navigationMapView.navigationCamera.viewportDataSource = NavigationViewportDataSource(mapView.mapView, viewportDataSourceType: .raw)
navigationMapView.navigationCamera.follow()
mapHolder.addSubview(navigationMapView)
Now that I'm updating the app to Mapbox Navigation V2, I'm seeing a noticeable black flash after the navigationMapView is added to the UIView and before it loads (or at least I'm guessing that's what's happening).
I've tried changing the NavigationMapView backgroundColor to UIColor.white. I've also tried adding it to the UIView holder in viewWillAppear and viewDidLoad with no luck. Any ideas? Again, this has not been a problem in the last 2 years with V0 and V1. Just ironing out issues before release. Thank you for your help!
https://user-images.githubusercontent.com/5864607/185236156-f157e15e-b4ca-4e58-a475-e7db73d8f6fb.MOV
Expected behavior
NavigationMapView should load smoothly without a black flash.
Actual behavior
There is a noticeable black flash after the NavigationMapView is added as a subview to the UIView holder, but before the map loads.
Is this a one-time issue or a repeatable issue?
repeatable
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.
Assessment
This issue has not been assessed yet.