White map after rotate screen
Environment
- Xcode version: 12.5.1
- iOS version: 14.4
- Devices affected: All
- Maps SDK Version: 10.2.0
Observed behavior and steps to reproduce
I open the map in portrait mode, loading all styles, layers, etc. On the end of loading (on styleDataLoaded event) I set the center of the camera to the map via mapView.camera.ease When it finish I also restrict the camera bounds as you suggested in this ticket (https://github.com/mapbox/mapbox-maps-ios/issues/820)
func restrictCameraInsideBounds() {
let southwest = mapView.mapboxMap.coordinate(for: CGPoint(x: 0, y: bounds.size.height))
let northeast = mapView.mapboxMap.coordinate(for: CGPoint(x: bounds.size.width, y: 0))
let restrictedBounds = CoordinateBounds(
southwest: southwest,
northeast: northeast
)
let cameraBoundsOptions = CameraBoundsOptions(bounds: restrictedBounds)
try! mapView.mapboxMap.setCameraBounds(with: cameraBoundsOptions)
}
However when I get mapLoaded event and without any touches rotate the screen map disappears. If I click on the screen map is still invisible, but when I made a drag gesture on the screen map appeared. What is funny when I perform some action i.e drag, zoom, etc. before I rotated screen map will be visible after changing orientation.
When I disable restrictCameraInsideBounds function map works perfect after rotate device
Expected behavior
Map should be still visible after rotate screen.
@MaciejPachciarekSMT thank you for reporting this behavior. I am able to reproduce on v10.2.0 - when restrictCameraInsideBounds() is outside of .mapLoaded the map works as expected when rotated, but when it's inside the closure, the reported behavior is visible.
@MaciejPachciarekSMT are you still experiencing this behavior? I am no longer able to reproduce.
@ZiZasaurus are we talking about the 10.2.0 version?
Hello @MaciejPachciarekSMT, thank you for your detailed report, we are able to reproduce this issue in maps v10.6.0. We are planning to address it in Mapbox Maps SDK v10.8.0.
- Xcode version: 14.0
- iOS version: 16.0
- Devices affected: reproduced on iPhone SE 2020 and various Simulator devices
- Maps SDK version: 10.9.0
I can confirm this issue has been addressed for MapBox v10.8.1, however after bumping the version to latest stable (v10.9.0), I am again able to reproduce it.
@michalronin thank you for following up. Can you please provide a screen recording or sample project reproducing this behavior? I am currently unable to reproduce the behavior as outlined by the user above on v10.9.0. Please see my screen recording below:
https://user-images.githubusercontent.com/44972592/197539628-05f8df8e-1f42-4c6a-9f2f-cb49f934bbbb.MP4
Closing this ticket, but please feel free to reopen if you continue to experience this behavior.