View Full Version : Maps download and meta files

21.01.2015, 13:48
Hello there,

In our app, we want to ship without any pre-installed maps and then let users choose a city and then download the corresponding map for offline use.

The download of the map data (skm/ngi/etc files) works great but the offline map doesn't display since the meta files are missing. I got the meta files from the pre-installed London example app and if I copy the meta files manually in the iOS simulator, then the map in our app displays fine.

How can we download the meta information together with the map data? Or is there another solution to get the meta information without pre-installing the map?

Thanks for your help,

21.01.2015, 15:32
Hi Daniel,
What version of the SDK are you using?
If you are using 2.3, and downloading the offline maps through the app (similar to how we do it in the demo project), that should also take care of the meta files.

Could you describe the steps you are taking for downloading a map?

21.01.2015, 16:34
Hi dandronic and thanks for the quick reply,

I'm using 2.3. I've done a big more digging and it seems that if I set SKConnectivityModeOffline, the meta files are not downloaded. But it all goes well if I set SKConnectivityModeOnline. I've verified this both in my app and in the SKMapsFrameworkDemo iOS example.

However, I want to make sure that the maps are shown in offline mode after they are downloaded. How can I achieve this? Which call triggers the download of the meta information? It seems to happen before the actual map download.

I see I can change the connectivity mode in SKMapsService. When is the best time to switch to offline to make sure that the meta files are downloaded but that the maps are always shown in offline mode?

21.01.2015, 17:23
Indeed - it seems like a timing issue (switching to offline before the meta files are downloaded).

Let me check to see when it would be safe to switch to offline and get back to you.

23.01.2015, 14:05
Thanks for the confirmation. Any definitive answer on this?

26.01.2015, 16:22
Here is the answer from our development team:

"There are 2 possible ways to implement:
1. In the AppDelegate.m file of the app register to map versioning manager callbacks:
[SKMapsService sharedInstance].mapsVersioningManager.delegate= self;
The following callback will be called when the download of the meta files is finished. The connectivity mode should be set here to offline:
- (void)mapsVersioningManagerLoadedMetadata: (SKMapsVersioningManager *)versioningManager {
[SKMapsService sharedInstance].connectivityMode = SKConnectivityModeOffline;

2. The other way is to put the meta files in the Preinstalled maps folder of the SKMaps.bundle. Please find in the attachment a zip with the meta files(Overwrite your preinstalled maps folder with the one in the attachment) or you can use the ones generated into the library folder's path of the device. In this case the SDK could be initialized in offline mode.
SKMapsInitSettings* initSettings = [[SKMapsInitSettings alloc]init];
initSettings.mapDetailLevel = SKMapDetailLevelFull; //Use Full version of maps.
//Can be set to a light version.
initSettings.connectivityMode = SKConnectivityModeOffline;
[[SKMapsService sharedInstance]initializeSKMapsWithAPIKey:API_KEY settings:initSettings];
After downloading a country it will appear on the map."

26.01.2015, 20:08
The first option seems to be the best solution in my case. Thank you!