Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: offlineManager.invalidatePack is not implemented #2910

Closed
chris-gaona opened this issue Jun 14, 2023 · 3 comments
Closed

[BUG]: offlineManager.invalidatePack is not implemented #2910

chris-gaona opened this issue Jun 14, 2023 · 3 comments
Labels
Android Android related tickets bug 🪲 Something isn't working iOS iOS related tickets todo Valid bug, but we don't have time to look into v10

Comments

@chris-gaona
Copy link

chris-gaona commented Jun 14, 2023

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

iOS

@rnmapbox/maps version

10.0.7

Standalone component to reproduce

import React from 'react';
import {StyleSheet, View} from 'react-native';
import MapboxGL from '@rnmapbox/maps';

const styles = StyleSheet.create({
    mapView: {flex: 1},
});

class BugExample extends React.Component {
    async componentDidMount() {
        console.log('>>>>>>>>>>start creating pack', );
        await MapboxGL.offlineManager.createPack(
            {
                name: 'field-1', // any
                bounds: [[32.23782523101579, 46.39912398458027], [33.43887899585923, 47.041693870480955]], // any LARGE area
                styleURL: MapboxGL.StyleURL.Street,
                minZoom: 10,
                maxZoom: 12,
            },
            (pack, status) => {
                console.log('>>>>>>>>>>pack progress', pack.name, status.percentage, status.completedTileCount);
                if (status.state === 'completed') {
                    MapboxGL.offlineManager.deletePack('field-1');
                    // throws error where deletePack is not a function (android only)
                }
            },
            (pack, error) => {
                console.log('>>>>>>>>>>pack error', pack.name, error);
            },
        );

        // always shows a single pack without metadata nor identifier (name)
        console.log(MapboxGL.offlineManager.getPacks());

        // HERE's where the error is thrown
        await MapboxGL.offlineManager.invalidatePack('field-1')
    }

    render() {
        return (
            <View style={styles.mapView}>
                <MapboxGL.MapView
                    ref={(c) => (this._map = c)}
                    onPress={this.onPress}
                    style={styles.mapView}
                >
                    <MapboxGL.Camera
                        zoomLevel={10}
                        centerCoordinate={[33.43887899585923, 47.041693870480955]}
                    />
                </MapboxGL.MapView>
            </View>
        );
    }
}

export default BugExample;

Observed behavior and steps to reproduce

Example of the error thrown below:

Screenshot 2023-06-14 at 4 45 26 PM

Expected behavior

await Mapbox.offlineManager.invalidatePack(packName) should be implemented.

Notes / preliminary analysis

await Mapbox.offlineManager.invalidatePack(packName) is not implemented and throws a JS function is undefined error.

Additional links and references

No response

@chris-gaona chris-gaona changed the title [BUG]: OfflineManager.invalidatePack is not implemented [BUG]: offlineManager.invalidatePack is not implemented Jun 14, 2023
@mfazekas
Copy link
Contributor

@chris-gaona Thanks for the report, It's not yet implemented for v10. I think we can use TileStore.removeTileRegion

https://docs.mapbox.com/ios/maps/guides/offline/#delete-style-packs-and-regions

@mfazekas mfazekas added bug 🪲 Something isn't working iOS iOS related tickets Android Android related tickets v10 labels Jun 15, 2023
@sampathkumarch
Copy link

sampathkumarch commented Aug 28, 2023

Hi @chris-gaona ,
While using

:MapboxGL.offlineManager.createPack()

Am able to downloading the maps like I gave multiple map boundaries and along with multiple names . After that app memory size was increased then I want to delete few offline maps so am using this one

MapboxGL.offlineManager.deletePack('field-1')

using whatever i used names for create offline map , but name only deleting along with data was not deleted , while check the app memory still same size is there .

So I want how to delete the offline map from the app ambient cache memory

@mfazekas mfazekas added the todo Valid bug, but we don't have time to look into label Dec 9, 2023
@mfazekas
Copy link
Contributor

mfazekas commented Dec 9, 2023

Valid bug, but not planned do to lack of resources. Closing as not planned.

@mfazekas mfazekas closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android related tickets bug 🪲 Something isn't working iOS iOS related tickets todo Valid bug, but we don't have time to look into v10
Projects
None yet
Development

No branches or pull requests

3 participants