hauke96 / GeoNotes

A simple app to create georeferences notes.
GNU General Public License v3.0
55 stars 10 forks source link

Feature request: update map background cache #110

Open urbalazs opened 1 year ago

urbalazs commented 1 year ago

As a mapper I want to have a button in the settings to update (re-download) the cached map background tiles so that I can see up-to-date map tile images for the area that is being mapped.

Use case example:

I am using and old smart phone without SIM and mobile internet. I used to update the maps at home via Wi-Fi, so I have no internet connection while mapping. I am mapping many different places (home, neighborhood, village of my parents, different places) and I already downloaded the map background tiles from OSM and I can use them offline. In the meantime I added many new details to the map and the cache, which was downloaded months ago, is now out-dated, I cannot see my recent changes. I downloaded exactly the tiles what I need for mapping: for the proper area and for the proper zoom levels. Currently, there is only one way to update the map background cache: clear it completely and download the map background images again. But for this, I have to navigate to the places, zooming in and out the map, and I have to repeat this for each place where I am mapping. This is very time-consuming and it is a possible risk that I forget to download some tiles and I will not have background image offline. If there would be a button to update (re-download) all tiles in the cache, this makes my workflow much more easier.

hauke96 commented 1 year ago

Hi, thanks for the feature request. There is already a button in the settings to clear the background map cache. Not that this takes a while when using GeoNotes for a longer time (on my phone that can take minutes).

After clearing the cache, you can return to the map and scroll/zoom/move around the area you want to pre-download. The downloaded map tiles are then new and cached. It's a bit of manual work, but should work great.

Automatically pre-downloading the tiles is basically the feature for offline maps (s. here #33 ) and is listed in the README.md in the section about features that will probably not make it. The reason why this will probably not be implemented is not, that it's a bad idea, but rather that It's very likely a huge feature with - so far - very little to no use for me personally. But if someone implements this properly, I'll won't deny a pull request ;)

However, caching the tiles is somewhat different because OsmDroid (the underlying map framework) already does that when using the map. I also found this example of a fragment that seems to implement your wanted feature. I'll look further into that. But if I can't get it to work right away, this is probably something I'll not work on soon.