offlinemanager .restDatabase() #3027
sampathkumarch
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
import React from 'react';
import {StyleSheet, View} from 'react-native';
import Mapbox from '@rnmapbox/maps';
const styles = StyleSheet.create({
mapView: {flex: 1},
});
class BugExample extends React.Component {
const getOfflinePacks = async () => {
try {
const packs = await Mapbox.offlineManager.getPacks();
};
async componentDidMount() {
const handleDeleteMap = async () => {
try {
};
}
render() {
return (
<Mapbox.MapView
ref={(c) => (this._map = c)}
onPress={this.onPress}
style={styles.mapView}
>
<Mapbox.Camera
zoomLevel={10}
centerCoordinate={[33.43887899585923, 47.041693870480955]}
/>
</Mapbox.MapView>
}
HI,
https://github.com/rnmapbox using Version 10 ,
while downloading the offline maps by using different names and different coordinates, so the offline maps are downloaded properly, After Using getpacks() function then what the maps downloaded its showing
But the problem here ,
i want to delete the specific offline map so am using await Mapbox.offlineManager.deletePack("specific name"), but here only the name only deleting not deleting from the app cache memory,
Another way am resetDatabase() using still not removing the data from the ambient cache memory
from the getPacks()
LOG prev... offline pack names------ [{"_metadata": {"_rnmapbox": [Object], "name": "pack1"}, "pack": {"bounds": [Array], "completedResourceCount": 7, "completedResourceSize": 75603619, "expires": "Sun Oct 01 15:12:33 GMT+05:30 2023", "metadata": "{"name":"pack1","_rnmapbox":{"bounds":{"coordinates":[[[ ],[ ],[ ],[ ],[
[ ]]],"type":"Polygon"},"zoomRange":[5,40],"styleURI":"mapbox:\/\/styles\/mapbox\/satellite-streets-v12"}}", "percentage": 100, "requiredResourceCount": 7, "state": "complete"}}]
from deletepack()
getiing this one
LOG deleteing -- undefined
Beta Was this translation helpful? Give feedback.
All reactions