This object is in archive! 
"Clear map cache" for online maps not working
Solved
In Locus 4.16.0 the "clear map cache" action for online maps is not working in the sense after the action, Locus still shows outdated map tiles. Stock Android 10 on Fairphone 3. Seems a regression of https://help.locusmap.eu/topic/map-cache-cleaning-not-working
Context and reproduction steps:
- 2023-05-08 16:34 I committed the changeset https://www.openstreetmap.org/changeset/135860909#map=15/48.7869/5.5438
- In Locus, I opened menu > map manager > online > OSM Classic and moved to 48.78904 5.54145 and did a screenshot for before my changes, as I wanted to do a before and after comparision.
- The day after, I opened menu > map manager > online > OSM Classic > map's 3 dot menu > clear map cache. I expected to see a map with my changes but saw the update only in one zoom level. I assumed the tile server is quite busy and I need to come back in a few days.
- 2023-05-11 09:30 I retried clearing & loading and still, only some tiles got updated tiles:
I wondered for the unusual big delay and opened https://www.openstreetmap.org/query?lat=48.78936&lon=5.54306#map=17/48.78730/5.53780 where my changes were visible on all zoom levels:
So the OSM tile server was up to date but Locus did not fetch these updated tiles. Hence, I also tried to move map view away from that area, then delete the cache, end Locus, start Locus, but also no update. As I assumed Locus 3+4 could use the same cache and clearing in one is not sufficient, I cleared cache and killed both Locus 3 and 4, but no success. - 2023-05-14 12:30 after clearing the cache again, the view is still the old for some zooms:
updated: 13
some tiles updated, some old: 14+15+17+18
completely updated: 16
BTW, in the manual page https://docs.locusmap.app/doku.php?id=manual:user_guide:maps_online#action_menu the text and screenshot show different context menu entries' text than the actual application.
Hello Georg,
appreciate your precise tests!! I think I've found one another possible reason for this. The library I use for downloading of map tiles uses its own small cache that may do this. I've tested it and it seems to work as expected now. So give a try next (Beta) version, thanks!
Hello Georg,
appreciate your precise tests!! I think I've found one another possible reason for this. The library I use for downloading of map tiles uses its own small cache that may do this. I've tested it and it seems to work as expected now. So give a try next (Beta) version, thanks!
Hello Georg,
this is really weird.
"OSM - Other: Classic" map is cached into the app file Locus/mapsOnline/OSM - Other_Classic.sqlitedb file. Mentioned the "Clear map cache" button to delete this whole file so you may easily verify that this function really works. It is possible that app still displays the last visible map without the reload, but simple zoom in/out should reload all data. I'm testing it and seems to work correctly. May you check if the file is deleted for you? Thanks
Hello Georg,
this is really weird.
"OSM - Other: Classic" map is cached into the app file Locus/mapsOnline/OSM - Other_Classic.sqlitedb file. Mentioned the "Clear map cache" button to delete this whole file so you may easily verify that this function really works. It is possible that app still displays the last visible map without the reload, but simple zoom in/out should reload all data. I'm testing it and seems to work correctly. May you check if the file is deleted for you? Thanks
Hi Menion, also on my device, the file exists and – according to total commander search – exactly once across internal and SD card storage. It is deleted by "clear map cache". After that, moving around and zooming in/out causes more tiles to be updated but not all tiles (now LM 4.17.0). Judged by feeling (I did not count), for this change set, a lower percentage of tiles stays outdated – but the modified area was around 3-4 times bigger, so also the total amount of tiles is bigger.
Based on 2 last points, IMHO
Best regards, Georg
Hi Menion, also on my device, the file exists and – according to total commander search – exactly once across internal and SD card storage. It is deleted by "clear map cache". After that, moving around and zooming in/out causes more tiles to be updated but not all tiles (now LM 4.17.0). Judged by feeling (I did not count), for this change set, a lower percentage of tiles stays outdated – but the modified area was around 3-4 times bigger, so also the total amount of tiles is bigger.
Based on 2 last points, IMHO
Best regards, Georg
Hello Georg,
agree that some "move & zoom" should not be necessary. Seems I was lazy to do it properly years ago ...
I'll improve it to the next version, so "Clear map cache" will also clear map tiles from memory and refresh/reload the map. Thanks for the "push"!
Hello Georg,
agree that some "move & zoom" should not be necessary. Seems I was lazy to do it properly years ago ...
I'll improve it to the next version, so "Clear map cache" will also clear map tiles from memory and refresh/reload the map. Thanks for the "push"!
Hi Menion, thank your for refining the cache updating logic, :-) Sadly, 4.17.1 does still show the described behavior:
https://www.openstreetmap.org/search?query=wertheim#map=17/49.77732/9.50938 as of 20230530 09:10 shows all added ways (e.g. the horizontal street on top and the playground & red steps in the middle):
Locus Zoom 16 as of 20230530 09:11 also shows all added ways
Locus Zoom 17 as of 20230530 09:11 shows added ways only in some of the tiles (bottom) while some stay old (top):
I did try several different ways, all with the same result.
On the one hand, the behavior is affecting users, as "Classic" is the usually the map that is updated most quickly (minutes or hours instead of days) and also offering high zoom levels, hence I often use it after I did bold edits to check & use them in Locus. On the other hand, it's not severe as bold edits are not frequent and I can also use Vespucci to view OSM Classic tiles. All in all, it shows cache logic is not working as expected, which may be the reason for other "weird" behaviors.
Best regards,
Georg
Hi Menion, thank your for refining the cache updating logic, :-) Sadly, 4.17.1 does still show the described behavior:
https://www.openstreetmap.org/search?query=wertheim#map=17/49.77732/9.50938 as of 20230530 09:10 shows all added ways (e.g. the horizontal street on top and the playground & red steps in the middle):
Locus Zoom 16 as of 20230530 09:11 also shows all added ways
Locus Zoom 17 as of 20230530 09:11 shows added ways only in some of the tiles (bottom) while some stay old (top):
I did try several different ways, all with the same result.
On the one hand, the behavior is affecting users, as "Classic" is the usually the map that is updated most quickly (minutes or hours instead of days) and also offering high zoom levels, hence I often use it after I did bold edits to check & use them in Locus. On the other hand, it's not severe as bold edits are not frequent and I can also use Vespucci to view OSM Classic tiles. All in all, it shows cache logic is not working as expected, which may be the reason for other "weird" behaviors.
Best regards,
Georg
Hello Georg,
appreciate your precise tests!! I think I've found one another possible reason for this. The library I use for downloading of map tiles uses its own small cache that may do this. I've tested it and it seems to work as expected now. So give a try next (Beta) version, thanks!
Hello Georg,
appreciate your precise tests!! I think I've found one another possible reason for this. The library I use for downloading of map tiles uses its own small cache that may do this. I've tested it and it seems to work as expected now. So give a try next (Beta) version, thanks!
Dear Menion, in 4.17.2 and 3.68.2 after "clear map cache", the updated tiles showed up instantly 🙂 Thank you for your endurance in fixing this bug!
Dear Menion, in 4.17.2 and 3.68.2 after "clear map cache", the updated tiles showed up instantly 🙂 Thank you for your endurance in fixing this bug!
Perfect, thanks a lot too.
Tis "minor" fix has generally a positive effect on the online map performance, perfect!
Perfect, thanks a lot too.
Tis "minor" fix has generally a positive effect on the online map performance, perfect!
Hi Menion,
FYI, in v4.18.1 I encountered an incomplete removal of tiles, leading to ways with gaps in some zoom levels (at right):
After repeating "clear map cache" 2-3 times, display was all right – this is sufficiently easy to do, thus IMHO no action required, but I wanted to let you know there is still something not fully reliable in case you consider it more relevant. I think I shall mention because it's a little odd that I did not encounter the issue in Locus 3 despite using it way more often than v4.
Best regards, Georg
Hi Menion,
FYI, in v4.18.1 I encountered an incomplete removal of tiles, leading to ways with gaps in some zoom levels (at right):
After repeating "clear map cache" 2-3 times, display was all right – this is sufficiently easy to do, thus IMHO no action required, but I wanted to let you know there is still something not fully reliable in case you consider it more relevant. I think I shall mention because it's a little odd that I did not encounter the issue in Locus 3 despite using it way more often than v4.
Best regards, Georg
Hi,
interesting. Locus Classic and Locus Map use identical map cores so there should be no difference. I currently have no other idea what to improve anyway if it happens more often, let me know and we may do something with it (probably some special version). Thanks.
Hi,
interesting. Locus Classic and Locus Map use identical map cores so there should be no difference. I currently have no other idea what to improve anyway if it happens more often, let me know and we may do something with it (probably some special version). Thanks.
Replies have been locked on this page!