mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

White map after rotate screen

Open MaciejPachciarekSMT opened this issue 4 years ago • 4 comments

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 avatar Jan 10 '22 13:01 MaciejPachciarekSMT

@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.

ZiZasaurus avatar Jan 10 '22 17:01 ZiZasaurus

@MaciejPachciarekSMT are you still experiencing this behavior? I am no longer able to reproduce.

ZiZasaurus avatar Jun 02 '22 20:06 ZiZasaurus

@ZiZasaurus are we talking about the 10.2.0 version?

MaciejPachciarekSMT avatar Jun 03 '22 05:06 MaciejPachciarekSMT

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.

evil159 avatar Jun 23 '22 12:06 evil159

  • 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 avatar Oct 23 '22 13:10 michalronin

@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

ZiZasaurus avatar Oct 24 '22 13:10 ZiZasaurus

Closing this ticket, but please feel free to reopen if you continue to experience this behavior.

ZiZasaurus avatar Nov 19 '22 14:11 ZiZasaurus