Fixed mapview caching bugs
This commit is contained in:
parent
3fecb368e5
commit
a373af2b0f
|
@ -25,6 +25,7 @@ import logging
|
||||||
# I tried it with a simpler one (just Mozilla/5.0) this also gets rejected
|
# I tried it with a simpler one (just Mozilla/5.0) this also gets rejected
|
||||||
USER_AGENT = 'Kivy-garden.mapview'
|
USER_AGENT = 'Kivy-garden.mapview'
|
||||||
|
|
||||||
|
import RNS
|
||||||
|
|
||||||
class Downloader:
|
class Downloader:
|
||||||
_instance = None
|
_instance = None
|
||||||
|
@ -51,6 +52,7 @@ class Downloader:
|
||||||
self._futures = []
|
self._futures = []
|
||||||
Clock.schedule_interval(self._check_executor, 1 / 60.0)
|
Clock.schedule_interval(self._check_executor, 1 / 60.0)
|
||||||
if not exists(self.cache_dir):
|
if not exists(self.cache_dir):
|
||||||
|
RNS.log("Creating cache dir "+str(self.cache_dir), RNS.LOG_WARNING)
|
||||||
makedirs(self.cache_dir)
|
makedirs(self.cache_dir)
|
||||||
|
|
||||||
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||||
|
|
|
@ -123,7 +123,7 @@ class Tile(Rectangle):
|
||||||
cache_key=map_source.cache_key,
|
cache_key=map_source.cache_key,
|
||||||
**self.__dict__
|
**self.__dict__
|
||||||
)
|
)
|
||||||
return join(self.cache_dir, fn)
|
return join(self.map_source.cache_dir, fn)
|
||||||
|
|
||||||
def set_source(self, cache_fn):
|
def set_source(self, cache_fn):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue