mirror of
https://github.com/meshtastic/Meshtastic-Apple.git
synced 2026-04-20 22:13:56 +00:00
Add a little logging for tile import process
This commit is contained in:
parent
e83af36337
commit
2cd3c33b89
1 changed files with 11 additions and 3 deletions
|
|
@ -40,13 +40,17 @@ struct MeshtasticAppleApp: App {
|
|||
}
|
||||
.onOpenURL(perform: { (url) in
|
||||
|
||||
print("QR Code URL received from the Camera \(url)")
|
||||
print("Some sort of URL was received \(url)")
|
||||
channelUrl = url
|
||||
print("User wants to open URL: \(channelUrl?.absoluteString ?? "No QR Code Link")")
|
||||
|
||||
|
||||
if url.absoluteString.lowercased().contains("https://meshtastic.org/e/#") {
|
||||
saveQR = true
|
||||
print("User wants to open a Channel Settings URL: \(channelUrl?.absoluteString ?? "No QR Code Link")")
|
||||
} else {
|
||||
print("User wants to import a MBTILES offline map file: \(channelUrl?.absoluteString ?? "No Tiles link")")
|
||||
}
|
||||
|
||||
|
||||
//we are expecting a .mbtiles map file that contains raster data
|
||||
//save it to the documents directory, and name it offline_map.mbtiles
|
||||
|
|
@ -60,7 +64,11 @@ struct MeshtasticAppleApp: App {
|
|||
try? fileManager.removeItem(atPath: destination.path)
|
||||
}
|
||||
|
||||
try? fileManager.copyItem(at: url, to: destination)
|
||||
do {
|
||||
try fileManager.copyItem(at: url, to: destination)
|
||||
} catch {
|
||||
print("Copy MB Tile file failed. Error: \(error)")
|
||||
}
|
||||
|
||||
if (fileManager.fileExists(atPath: destination.path)) {
|
||||
print("ℹ️ Saved the map file")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue