You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
Render a tile source hosted locally on the Android device (using nanohttpd). For example, style.json is: { "version": 8, "sources": { "offline": { "type": "raster", "tiles": [ "http://127.0.0.1:8080/tiles/{z}/{x}/{y}.png" ], "maxzoom": 12 } }, "layers": [ { "id": "offline", "type": "raster", "source": "offline" } ] }
Check that locally hosted tiles render correctly in Mapbox.
Turn off cellular data and wifi.
Expected behavior
Mapbox continues to fetch and render the locally hosted tiles.
Actual behavior
Mapbox no longer fetches tiles from the locally hosted source. Logcat warns 07-25 09:24:49.846: W/MapboxEventManager(4486): Not connected to network, so empty events cache and return without attempting to send events.
I presume this is related to #6123, where Mapbox is detecting a lack of network connection and not requesting resources to avoid 404 errors. However, http://127.0.0.1:8080/tiles/{z}/{x}/{y}.png is still available (I can manually fetch them within the app and receive a 200 response) . It would be nice if the offline check could be disabled in AndroidManifest.xml.
The text was updated successfully, but these errors were encountered:
We actually support overriding the connection status through Mapbox#setConnected(true)
/** * Manually sets the connectivity state of the app. This is useful for apps which control their * own connectivity state and want to bypass any checks to the ConnectivityManager. * * @param connected flag to determine the connectivity state, true for connected, false for * disconnected, and null for ConnectivityManager to determine. */publicstaticsynchronizedvoidsetConnected(Booleanconnected) {
// Connectivity state overridden by appINSTANCE.connected = connected;
}
Closing this issue as answered. Let us know if you run into any issues.
Platform: Android (using react-native-mapbox-gl)
Mapbox SDK version: 4.2.2
Steps to trigger behavior
{ "version": 8, "sources": { "offline": { "type": "raster", "tiles": [ "http://127.0.0.1:8080/tiles/{z}/{x}/{y}.png" ], "maxzoom": 12 } }, "layers": [ { "id": "offline", "type": "raster", "source": "offline" } ] }
Expected behavior
Mapbox continues to fetch and render the locally hosted tiles.
Actual behavior
Mapbox no longer fetches tiles from the locally hosted source. Logcat warns
07-25 09:24:49.846: W/MapboxEventManager(4486): Not connected to network, so empty events cache and return without attempting to send events
.I presume this is related to #6123, where Mapbox is detecting a lack of network connection and not requesting resources to avoid 404 errors. However, http://127.0.0.1:8080/tiles/{z}/{x}/{y}.png is still available (I can manually fetch them within the app and receive a 200 response) . It would be nice if the offline check could be disabled in AndroidManifest.xml.
The text was updated successfully, but these errors were encountered: