Skip to content

Commit

Permalink
Fallback missing tiles when there is no network
Browse files Browse the repository at this point in the history
  • Loading branch information
Feodor0090 committed Aug 30, 2023
1 parent ba78afd commit a7d791d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/mahomaps/map/TilesProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,18 @@ public void RunCache() {
}
}

Image img = null;
if (Settings.cacheMode == Settings.CACHE_FS && localPath != null) {
img = tryLoadFromFS(tc);
} else if (Settings.cacheMode == Settings.CACHE_RMS) {
img = tryLoadFromRMS(tc);
Image img = tryLoad(tc);

// if tile is not cached...
if (img == null) {
// but we can't download it...
if (!Settings.allowDownload) {
// and cache lookup actually was attempted...
if (Settings.cacheMode != Settings.CACHE_DISABLED) {
// let's try lower zooms and upscale them.
img = tryLoadFallback(tc);
}
}
}

synchronized (tc) {
Expand Down

0 comments on commit a7d791d

Please sign in to comment.