Programmatically clearing map cache

依然范特西╮ 提交于 2019-12-10 22:43:44

问题


I have caching enabled in my SupportMapFragment created with the Android Google Maps API v2. I'd like to be able to programmatically clear the cache of my program within the application itself, a requirement being levied on me. I am doing this using the trimCache() method described here by crony_cd.

When I execute this method though, it only seems to be deleting a small piece of the cache, presumably the cache files that my own application is creating, not the cache files created by the Google Maps API. Is it possible to wipe the cache that the Maps API produces?


回答1:


As far as I know no. The cache is controlled by Googles maps library on a project to project basis. That means tiles are cached for each app using maps. When you've decided to use Googles Maps library you'll also have to live with this, trying to remove these files or doing something with reflection will only possibly break your app with future updates of Google services.




回答2:


This is the same for me: my cache contains new files and one of its files has a size of 2.2M (and it can go until 20-30M.)...Those files appear only when I open the map activity.

So I guess that this is the cache map. But to my opinion, due to the size, it is not a link...

I do not have any idea for the moment on the way to manage this cache. I think it is not our job...



来源:https://stackoverflow.com/questions/14709071/programmatically-clearing-map-cache

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!