Search code examples
iosobjective-cmapsskmaps

SKMapsVersioningDelegate Manage update with local maps.json file


I'm writing an app that use skmaps , after this question/answer :

skobbler can i cache json data?

i have passed to a local maps.json file, instead a direct download each time the app starts. Now i'm trying to manage the update process of the map with SKMapsVersioningDelegate.

-My first question is, what does it mean update maps? This delegation methods in a standard implementation will simply overwrite a maps.json file with a new version if it become available during the use of the app or the delegation will'not update the json file in my app and it update only the packages of the map that i have already downloaded for offline use?

-If the delegation works on or replace the maps.json file , there's a way to simulate a map update? In my resource folder i have a json map file with a version set to 20140910. Anyway if i log my actual version :

 SKVersionInformation *latestVersion = availableVersions[0];
NSLog(@"Actual version %@",latestVersion.version);

i retrive this version number 20141230. During this process SKMapsVersioningDelegate is never been called. SKVersionInformation where search information?


Solution

  • Please check the 2.5 map update demo.

    It should not matter if the Maps.json file is stored locally or remote, it's the version file that decides if new maps are available.

    The update SDK will detect that a new version file is available and will update it. Once this is done you will have to manually decide, for each onboard map package, if you want to redownload it or not.

    The update API will not automatically update the local Maps.json, so you'll have to do this manually. This being said, for updating the onboard packages you don't need to reparse the Maps.json file but you only need to know their name (identifier) - i.e. for the state of California this would be: USCA. The package identifiers don't change from version to version