PDA

View Full Version : [iOS] SKTools SKTDownloadManager not saving Maps Correctly



gabri15
21.10.2015, 10:59
Hello.

I'm using latest SKMaps SDK (2.5.1) and his SKTools project. I've ran the demo project, ignoring that it may crash while the MapJSONParser operation is running, when it loads fine and I install a package the log throws these lines:


2015-10-21 10:42:16.421 Elby[69340:3324709] Invalid property type for propertyName downloadType. Skip
2015-10-21 10:42:16.421 Elby[69340:3324709] Invalid property type for propertyName custom. Skip
2015-10-21 10:42:16.422 Elby[69340:3324709] Invalid property type for propertyName bSkmDownloaded. Skip
2015-10-21 10:42:16.422 Elby[69340:3324709] Invalid property type for propertyName bNBDownloaded. Skip
2015-10-21 10:42:16.422 Elby[69340:3324709] Invalid property type for propertyName bTexturesDownloaded. Skip
2015-10-21 10:42:16.422 Elby[69340:3324709] Invalid property type for propertyName bNBUnzipped. Skip

So even when the download is finished and "installed" when I restart the app and check for installed offline maps with:


self.downloadedMaps = SKMapsService.sharedInstance().packagesManager.ins talledOfflineMapPackages as! [SKMapPackage]
for package in self.downloadedMaps{
NSLog("Package Name: %@", package.name)
}

It never prints anything, the array is empty after restarting the app to load the maps.

Regards.

gabri15
21.10.2015, 12:59
Those logs where only under iOS simulator, they didn't show up in a real device. Tough, when I make a download and an install I make the next call to get the result of the operation:


let result: SKAddPackageResult = SKMapsService.sharedInstance().packagesManager.add OfflineMapPackageNamed(code, inContainingFolderPath: path)
switch result{
case SKAddPackageResult.Success:
NSLog("Map successfuly saved")
break
case SKAddPackageResult.MissingNgiDatFile:
NSLog("Map missing Ngi Dat File")
break
case SKAddPackageResult.MissingNgiFile:
NSLog("Map missing Ngi File")
break
case SKAddPackageResult.MissingSkmFile:
NSLog("Map missing SKM File")
break
case SKAddPackageResult.MissingTxgFile:
NSLog("Map TGX File")
break
case SKAddPackageResult.CannotEraseFile:
NSLog("Map TGX File")
break
default:
NSLog("Unrecognized result.")
break
}


And I get an default message every time... What's happening there?

gabri15
21.10.2015, 13:27
There is a bug in the SKMapsSwiftDemo Project, in the file MapDownloadViewController.swift:


func downloadManager(downloadManager: SKTDownloadManager, saveDownloadHelperToDatabase downloadHelper: SKTDownloadObjectHelper) {
print("saveDownloadHelperToDatabase")
let path: String = (SKTDownloadManager.libraryDirectory() as NSString).stringByAppendingPathComponent(downloadH elper.getCode()) as String
let code: String = downloadHelper.getCode()

You forgot to add the pathcomponent in the path String so it would never find the map.

Regards.

Adela_Silvia
22.10.2015, 14:02
Thank gabri15 for reporting this.
We've sent this thread to our development team.

Update[28-10-2015]: we confirm that is was a bug on our side and the fix will be available in the next SDK update

gabri15
22.10.2015, 14:06
Thank gabri15 for reporting this.
We've sent this thread to our development team.

I also request to include in the SwiftDemo more SKTools utilities like You have in your Skobbler iOS app like downloading package statuses, changing them, updating individually offline maps views...

That would help a lot in our project.

Thank you.

Adela_Silvia
22.10.2015, 14:20
Thank you for your suggestions. We'll mark this request on our list for the next SDK updates.