Map fails to load if bike lanes url is down
Environment
- Android OS version: 16
- Devices affected: all
- Maps SDK Version: 11.12.2
Observed behavior and steps to reproduce
-
Our app embeds bike lanes in the map style as a source, like this: "sources": { "bikeLanes": { "data": "https://bikeslanes.net/map/bike-lanes", "type": "geojson" } }
-
So Mapbox should fetch the bike lanes from the provided data URL.
We have noticed that on a fresh app install, while Mapbox is initializing the map, if the bike lanes URL is down, the entire map fails to load. Mapbox does not display the map.
Expected behavior
The map should still render. Just the bike lanes layer should not be visible.
Notes / preliminary analysis
- iOS SDK seems to be more resilient, because the map does load on our iOS app if the bike lanes URL is down.
We are experiencing same behaviour in the app
@yousrasd Hi, can you provide any minimal reproduction code?
@persidskiy
fun applyMapTheme(styleUrl: String) {
// Skip if already using this style version
if (currentStyleEtag == styleEtag) {
return
}
// Set up error handling for style loading failures
styleErrorObserver = mapboxMapView.mapboxMap.subscribeMapLoadingError { error ->
logger.warn("Failed to load map style: ${error.message}")
}
// Load the new map style asynchronously
mapboxMapView.mapboxMap.loadStyle(
style = styleUrl,
onStyleLoaded = { styleLoadComplete() }
)
}
private fun styleLoadComplete() {
// Process map style initialization
}