Mapbox-gl-native: MGLMapView invalidates entire view hierarchy layout on device rotation

Created on 8 Feb 2019  路  3Comments  路  Source: mapbox/mapbox-gl-native

Steps to reproduce

  1. Create a single view iOS app with a viewcontroller that has an MGLMapView inside of a container view's viewcontroller
  2. Restrict the app to only portrait mode
  3. Put a log inside the parent viewcontroller's viewDidLayoutSubviews method
  4. Run the app and physically rotate the device

Expected behavior

The Mapbox should not invalidate the parent view's layout and cause viewDidLayoutSubviews to fire, so no log should be seen from step #3 above.

Actual behavior

The Mapbox seems to be invalidating the entire view hierarchy and causing viewDidLayoutSubviews to fire with every rotation - even though only portrait mode is allowed. Please see the following GitHub issue that highlights a possible problem this could cause with compatibility with other libraries: Pulley Issue #307. In particular, see this comment.

Configuration

Mapbox SDK versions: 4.8.0
iOS/macOS versions: 12.1.2
Device/simulator models:
Xcode version: 10.1

bug iOS

Most helpful comment

Fixed in #13900

All 3 comments

cc: @chloekraw

Thanks @ksinghal - it looks like we layout subviews on each device rotation, regardless of how the application has defined its supported orientations.

See https://github.com/mapbox/mapbox-gl-native/pull/13900 for a quick experiment.

Fixed in #13900

Was this page helpful?
0 / 5 - 0 ratings