maps: [Bug]: MapboxGL.offlineManager.createPack is not working with custom style
Mapbox Implementation
Mapbox
Mapbox Version
10.0.0-beta.76
Platform
iOS, Android
Standalone component to reproduce
<MapboxGL.MapView
ref={mapRef}
style={style.mapContainer}
styleURL={CUSTOM_STYLE_URL}
compassEnabled
compassViewPosition={3}
regionDidChangeDebounceTime={1500}
logoEnabled={false}
attributionEnabled={false}
scaleBarEnabled={false}
onRegionDidChange={onRegionDidChange}
onPress={presenter.onMapPress}
testID="mapView"
>
<MapboxGL.Camera
ref={cameraRef}
zoomLevel={presenter.zoom}
animationMode="moveTo"
animationDuration={600}
centerCoordinate={presenter.centerCoordinates}
/>
<MapboxGL.UserLocation showsUserHeadingIndicator />
{renderExperiences( presenter )}
</MapboxGL.MapView>
Observed behavior and steps to reproduce
I made a function to download the map:
await MapboxGL.offlineManager.createPack(
{
name: this.packName,
styleURL: CUSTOM_STYLE_URL,
minZoom: 8,
maxZoom: 16,
bounds: this.selectedLocation.coordinatesBounds,
},
this.mapDownloadProgressListener,
this.mapDownloadErrorListener,
);
the function is called when user press on download button. That button shows up when the map is already draw in the screen.
When the user is Offline, the map shows up but, not work properly beacuse the roads, trips, stations, all the details in the map they do not show well. It is as if the map is not downloading, and the reality is that it is not downloading because the errorListener is triggered.
Expected behavior
The map should display well, in full detail when I am offline with the custom style.
Notes / preliminary analysis
I believe that createPack does not support customs styles, or so I read on some sites.
Additional links and references
No response
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (2 by maintainers)
@JamesIde if you have a pack created with same style url, as the map’s styleURL, then mapbox should use that pack.