maps: iOS: Unhandled error when offline
Describe the bug On iOS, an unhandled error is thrown if there is no network connection.
To Reproduce run on iOS and have device disconnected from the internet.
Example:
import React from 'react';
import MapboxGL from '@react-native-mapbox-gl/maps';
class BugReportExample extends React.Component {
render() {
return (
<MapboxGL.MapView
style={{ flex: 1 }}
compassEnabled={true}
styleURL={MapboxGL.StyleURL.Dark}
localizeLabels={true}>
<MapboxGL.Camera followZoomLevel={16} followUserLocation={true} followUserMode={'normal'} />
<MapboxGL.SymbolLayer id="road-label-simple" style={{ visibility: 'none' }} />
<MapboxGL.LineLayer id="road-simple" style={{ visibility: 'visible' }} />
)}
{children}
</MapboxGL.MapView>
);
}
}
Expected behavior Expected to catch the error like on android
Screenshots

Versions (please complete the following information):
- Platform: iOS
- Device: iPhone 11
- Emulator/ Simulator: yes
- OS: iOS 13.4
- react-native-mapbox-gl Version: 8.1.0-rc.2
- React Native Version: 0.62.2
Additional context Hey, I would be happy to hear if someone has encountered a similar issue and how they have handled it. The maps work as expected both on iOS and android when online, and on android the error is not thrown.
Help would be much appreciated. Thanks
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (7 by maintainers)
@FernandesTeu Hey. I’ve used the
Loggerto filter out the specific errors I was encountering as @mfazekas suggested.This does the job for me until the issue is resolved.
Thank you all
@mfazekas, this issue seems to be fixed upstream. We “just” need to update the iOS SDK 😃
@ibraude i think that’s just and error level log. You should be able to use
Loggerto filter this out.Somehting like: