I try to use my map on offline. On google layers, react-native-maps does it on its own. I also use a tile server for marine map. The server works with the WMS format and the library offers a WMSTile component (Unfortunately no specific example of use... ).
This component accepts a setting offlinemode and tileCachePath, I am not sure of the implementation and it does not work for offline.
<WMSTile
urlTemplate={MY_URL_TEMPLATE}
shouldReplaceMapContent={false}
tileCachePath={`${RNFS.CachesDirectoryPath}/tiles`}
offlineMode={true}
tileSize={256}
/>
MapScreen.tsx
useEffect(() => {
exists(`${RNFS.CachesDirectoryPath}/tiles`)
.then(exist => {
if (!exist){
mkdir(`${RNFS.CachesDirectoryPath}/tiles`)
}
})
})
App.tsx
When launching the application, check if a tiles folder exists because it is the one I specify to my WMSTile component but prioritizes it is not the right way.
For system files, I use react-native-fs
Thank you for your help