WhirlyGlobe
WhirlyGlobe copied to clipboard
iOS tutorial is out of date
I have noted some issues on the Vector Data tutorial for iOS
-
The user is advised to go to the resource folder they downloaded earlier. When following the tutorials, users have not downloaded anything other than the geography-class MBTile file. There needs to be a link added for users to download the resources folder.
-
Users are told to set up a private directory as
private var vectorDict: [String:AnyObject]?. AnyObject is deprecated, and Any should be used instead -
In the add countries function, we are given this code; for outline in allOutlines { if let jsonData = NSData(contentsOfFile: outline), let wgVecObj = MaplyVectorObject(fromGeoJSON: jsonData as Data) { // the admin tag from the country outline geojson has the country name save if let attrs = wgVecObj.attributes, let vecName = attrs.objectForKey("ADMIN") as? NSObject { wgVecObj.userObject = vecName } // add the outline to our view let compObj = self.theViewC?.addVectors([wgVecObj], desc: self.vectorDict) // If you ever intend to remove these, keep track of the MaplyComponentObjects above. }
However, MaplyVectorObject does not have a userObject member, and I cannot find any documentation on what to replace this with. Removing it entirely means no vectors appear. Please advice on what the correct code should be and update.
You can set a value in the attributes instead of the userObject.
We haven't updated the iOS tutorials completely since version 3. That comes out of our support budget, and very few users pay support. It's on the list, but I can't say when we'll get to it.