Map cache "valid for"

Started by john_percy, April 28, 2018, 18:26:10

0 Members and 1 Guest are viewing this topic.

john_percy

I am attempting to use an overlay to display traffic delays and road closures and I can't get it to display reliably..

I have some questions regarding the time validity of the map cache.
1. If I "Set valid for" to 0, does that mean the map is not cached, or that the cache does not expire?
2. Does the same validity apply when the map is used as an overlay rather than a base map?
3. Regardless of the expiry time, is the map cached anyway within the same session of Locus. That is, is the validity of the cached copy only tested when Locus is restarted? To put it a different way, once the map is accessed once in a session, is the same image used until Locus is closed?

Much the same questions apply if I attempt to use an online map with traffic conditions.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

Hello John,
1. time value "0" means = no caching at all. By default, maps have defined an infinite positive number, which say that cache never expires.
2. Yes, same value should be used for overlays as well. It is an exactly same map with exactly same parameters, just placed as the second layer.
3. cache validity should be tested every time, app try to load map tile from cache (SQLite file). In app is also small in-memory cache so a few tiles is stored in memory in case, they will be immediately needed, anyway when you scroll a screen to the side and return back, data are again loaded from SQLite file (so again validated against "valid for" time).

If you have an online map with traffic conditions, simply try to set there 0 (no caching) or 1 (one hour caching) and you will see. Hope it will work. I've never used it in practice so feel free to write me if there will be any problem.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

john_percy

Thanks for that info, helpful.
I think there may a problem with a totally transparent tile (which is most likely to occur in an overlay and would occur in my traffic overlay where there are no traffic delays) failing to clear the previous tile and displaying old information, using SRC OVER. I have encountered this when zooming in or out, rather than the data changing but I guess the same would apply with changing traffic.
Where I know this happens is with a vector theme to overlay roads etc on to a satellite map. The background is generally pale white but over the sea the tiles were empty and transparent. Zooming in or out left the previous tile displayed in areas of transparent tiles. In this case I remedied it by drawing an off white background over the whole map first.
I think this may be a problem with my traffic project.

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

Good day John,
I'm trying to clean my older todo list and this topic is inside.
What is the status here? I'm asking also because I noticed that blend modes for overlay maps are somehow broken in 3.38+ version. A least on my device, overlay draw some "ghosts". So I wanted to know if I may help here somehow.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

john_percy

I'll look at this. To be honest, I'm not sure if I can remember. I *think* I couldn't get the traffic overlays to refresh reliably but this may be a server side problem judging by problems reported by others elsewhere.

Sent from my moto g(6) plus using Tapatalk

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

mobrob

When I look at the different maps available in Locus every map has a "0" for the map cache validity time  ???

Is it possible that therefore caching is completely disabled in Locus of the integrated maps?

If yes Locus is next to useless to me as network coverage often is not available or only in edge mode.
  •  

hans.castorp

You can download offline Maps in Locus. After they are downloaded, no further network access is needed and they are cached indefinitely.
  •  

mobrob

Thanks, but I am not talking about the offline functionality I am talking about tiles that are loaded and displayed when online and later when the phone is out of network coverage are just taken from the local cache. This caching mechanism  doesn't seem to work in Locus anymore.
  •  

john_percy

Have you checked Settings > Maps > Online Maps > Cache Maps is set on?
On my installation, Maps (Online Maps) > ... > Details gives details of whether the map can be cached and the size of the map in the cache.
Maps (Online Maps) > ... > Set 'valid for' is blank by default but can be changed to cause regular updating where required.



Sent from my moto g(6) plus using Tapatalk

Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

Menion

Please try to open "details" of for example OSM - Classic map. At the bottom should be "Valid for" text. What do you see there? Same as me?

If not, then as John wrote, you may set own value. If set value above 1 year, you will get this "unlimited" label. Most of the maps are definitely not limited. Only some have a subscription so this "valid for" parameter is defined by the validity of subscription.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

mobrob

I checked Settings > Maps > Online Maps > Cache Maps - the value is on.

And as I wrote in my post for each and every map I see the entry "Valid for 0 Hours".

This does not change even if I stop Locus and delete the Locus app data, cache and the "Locus" folder on the sd-card storage.

Now with empty cache I opened the OSM Outdoors map, accepted the terms of use and Locus downloaded the visible map tiles. I then activated air-plane mode and restarted Locus. No map tiles are available anymore. I only see the old cached map tiles flashing for may be a few milliseconds then again the map tiles with the error message are shown.
  •  

Menion

Really interesting. May I ask you for a backup of settings? I'll check what is set there in your case. Backup of settings should be done over menu > more > Backup manager. Thanks.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

Menion

mobrob, thanks for the backup!!
I'm really stupid. I've made a small issue in the last version and all new! users have all maps that have no limit, set to 0 hours! Ah, really sorry for this and thanks for the help with it. I'll fix it in next version. Till then, for the map you want to use, simply set some high number, it should work.
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  
    The following users thanked this post: mobrob