-
-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Padding error on iOS: Unable to calculate appropriate zoom level for bounds #1032
Comments
@mfazekas @ferdicus I was wondering if there was any way of moving this forward, as it has prevented us from upgrading to the newest version. It's a common action (adding padding to the map), and it's reproducible on the most recent versions of React Native and Mapbox in the simplest example I could put together. Is there any more information I can provide, or another way of using this feature that would avoid the problem? Any discussion on this issue would be very helpful. Thanks! |
Hey @naftalibeder, |
@naftalibeder Does going back to older Mapbox version (say 5.6.0) fixes the issue?! https://github.com/react-native-mapbox-gl/maps/issues/841#issuecomment-651727563 |
@mfazekas Yes, we've been locked onto version |
@naftalibeder plese see the link in my comment, above it describes how to use older (5.6.0) Mapbox IOS libs with newer ReactNAtiveMapboxGL versions (8.1.0.rc2 or later). The padding seems to be introduced in 5.7.0 of iOS libraries and it seems to be hard/impossible to work around in React Native wrappers. I'll need to look this exact bug though |
@mfazekas Thanks for pointing that out - I think I remember trying that solution at one point and it not working, but I will try to reproduce it on the minimal example project I created for this issue. Will update! |
@mfazekas Unfortunately I'm not even able to complete the installation with that modification - if I follow the recommendations, I oscillate between these two errors:
and
Feel free to try the installation yourself on the linked branch: https://github.com/TruckMap/mapbox-example-padding/tree/downgrade-mapbox-gl |
@naftalibeder you need to remove the |
Thanks for the tip, I had thought So after running the app with the older Mapbox library, I experienced the same pattern of errors, except that instead of throwing a redbox error, the app simply crashes the main thread with the error And for the padding configurations that do not cause a crash, the map still does not respond to the padding setting. |
I've submitted a fix at, you should be able to test it: npm install --save react-native-mapbox-gl/maps#mfazekas/fix-boudnsPadding-ios |
Thank you so much, this is a big improvement. It has fixed the crash, but now I am finding a different set of issues. Specifically:
|
@naftalibeder i've updated the PR so that it uses edgePadding instead of contentInset. This should address most issues noted here. Used this code as test app: |
@mfazekas Left a note on the PR! |
Description
There is a bug in Mapbox that causes an error on iOS when a cumulative padding of
64
or greater is applied to the camera. In addition, padding does not have any effect on the way bounds are centered on the screen on iOS.Steps to reproduce
readme.md
.Expected behavior
The padding values should influence the way the bounds are centered in the map view, and not cause crashes.
Other information
This issue is referenced in #841 and #956 as well.
Versions
iOS
iPhone 11
,iPhone SE
,iPhone 6S
iOS 13.7
,iOS 14.0
8.1.0-rc.4
0.63.2
The text was updated successfully, but these errors were encountered: