rnmapbox/maps

[Bug]: Does MapboxGL.offlineManager.createPack support custom styles?

vienha opened this issue · 1 comments

Mapbox Implementation

Mapbox

Mapbox Version

10.1.31

React Native Version

0.75.4

Platform

iOS, Android

@rnmapbox/maps version

10.1.31

Standalone component to reproduce

import Mapbox, {
 Camera,
 MapView,
 offlineManager,
 StyleURL,
} from '@rnmapbox/maps';
import React, { useState } from 'react';
import { Button, Dimensions, TextInput } from 'react-native';
Mapbox.setAccessToken('my_token_here');
const OfflineExample = () => {
 const [packName, setPackName] = useState('pack-1');
 const [showEditTitle, setShowEditTitle] = useState(false);
 const STYLE_URL = 'custom_style_url'
 const CENTER_COORD: [number, number] =[105.928, 21.0087];
 return (
   <>
     <Button
       title="Create Pack"
       onPress={() => {
         const options = {
           name: packName,
           styleURL: STYLE_URL,
           bounds: [
           [105.517826, 20.90185],
           [105.906464, 21.204365],
         ],
           minZoom: 0,
           maxZoom: 17,
           metadata: {
             whatIsThat: 'foo',
           },
         };
         console.log("options", JSON.stringify(options));
         offlineManager.createPack(options, (region, status) =>
           console.log('=> progress callback region:', 'status: ', status),(region,sattus)=>{
              console.log("Lỗi tải gói: " + sattus);
           }
         );
       }}
     />
     <MapView style={{ flex: 1 }} styleURL={STYLE_URL}>
       <Camera zoomLevel={10} centerCoordinate={CENTER_COORD} />
     </MapView>
   </>
 );
};
export default OfflineExample;

Observed behavior and steps to reproduce

When i call the offlineManager.createPack method, I receive the status:

{"completedResourceCount": 0, "completedResourceSize": 0, "erroredResourceCount": 0, "loadedResourceCount": 0, "loadedResourceSize": 0, "name": "offlinePack", "percentage": NaN, "requiredResourceCount": 0, "state": "complete"}

I wonder if rnmapbox supports creating offline packs with custom styles?

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

No code example found in issue body - More info