using rnmapbox downloaded the map but not able to delete #2992
Unanswered
sampathkumarch
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
am using rnmapbox for maps , it has offline download map so am downloaded different names with different maps while deleting maps unable to delete from the ambient cache. how many i downloaded that much data was stored in-app data.
import geoViewport from '@mapbox/geo-viewport';
import Mapbox, { Camera, MapView, offlineManager } from '@rnmapbox/maps';
import React, { useState } from 'react';
import { Button, Dimensions, TextInput, View, StyleSheet } from 'react-native';
Mapbox.setAccessToken('acess tken ');
const CENTER_COORD: [number, number] = [-73.970895, 40.723279];
const MAPBOX_VECTOR_TILE_SIZE = 512;
const STYLE_URL = Mapbox.StyleURL.Satellite;
const Test = () => {
const [packName, setPackName] = useState('pack-1');
const [showEditTitle, setShowEditTitle] = useState(false);
return (
<Button
title={
Pack name: ${packName}
}onPress={() => {
setShowEditTitle(!showEditTitle);
}}
/>
{showEditTitle && (
<TextInput
value={packName}
autoFocus={true}
onChangeText={(text) => setPackName(text)}
onBlur={() => setShowEditTitle(false)}
/>
)}
<Button
title="Get all packs"
onPress={async () => {
const packs = await offlineManager.getPacks();
console.log('=> packs:', packs);
packs.forEach((pack) => {
console.log(
'pack:',
pack,
'name:',
pack.name,
'bounds:',
pack?.bounds,
'metadata',
pack?.metadata,
);
});
}}
/>
<Button
title="Get pack"
onPress={async () => {
const pack = await offlineManager.getPack(packName);
if (pack) {
console.log(
'pack:',
pack,
'name:',
pack.name,
'bounds:',
pack?.bounds,
'metadata',
pack?.metadata,
);
);
};
export default Test;
const styles = StyleSheet.create({
container: {
height: 600,
width: 370,
},
map: {
flex: 1,
},
})
any one look this example help this point
Beta Was this translation helpful? Give feedback.
All reactions