mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
fix: map tiles being downloaded remotely twice
The url returned by MKTileOverlay.url(forTilePath:) is subsequently used by MKTileOverlay.loadTile(at:result:) for download. In the case of a tile that was just cached by OfflineTileManager.persistLocally(path:) we now return the local file URL to avoid downloading the remote image twice.
This commit is contained in:
parent
416d5e5f41
commit
ae66e5af59
1 changed files with 2 additions and 1 deletions
|
|
@ -148,8 +148,9 @@ class OfflineTileManager: ObservableObject {
|
|||
try data.write(to: filename)
|
||||
} catch {
|
||||
print("💀 Save Tile Error = \(error)")
|
||||
return url
|
||||
}
|
||||
return url
|
||||
return filename
|
||||
}
|
||||
private func filterTilesAlreadyExisting(paths: [MKTileOverlayPath]) -> [MKTileOverlayPath] {
|
||||
paths.filter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue