Fixed mapview caching bugs

This commit is contained in:
Mark Qvist 2023-10-26 19:42:18 +02:00
parent 3fecb368e5
commit a373af2b0f
2 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import logging
# I tried it with a simpler one (just Mozilla/5.0) this also gets rejected
USER_AGENT = 'Kivy-garden.mapview'
import RNS
class Downloader:
_instance = None
@ -51,6 +52,7 @@ class Downloader:
self._futures = []
Clock.schedule_interval(self._check_executor, 1 / 60.0)
if not exists(self.cache_dir):
RNS.log("Creating cache dir "+str(self.cache_dir), RNS.LOG_WARNING)
makedirs(self.cache_dir)
logging.getLogger("urllib3").setLevel(logging.WARNING)

View File

@ -123,7 +123,7 @@ class Tile(Rectangle):
cache_key=map_source.cache_key,
**self.__dict__
)
return join(self.cache_dir, fn)
return join(self.map_source.cache_dir, fn)
def set_source(self, cache_fn):
try: