Sign up for an API key from the Mapzen developer portal. Then, use it in the App Delegate's applicationDidFinishLaunching:
:
import Mapzen-ios-sdk
---- Inside your applicationDidFinishLaunching() ----
MapzenManager.sharedManager.apiKey = "your-mapzen-api-key"
Adding a Mapzen map to your storyboard is as easy as:
- Drag a standard UIViewController onto your storyboard canvas.
- Create a subclass file named, for example:
DemoMapViewController
and set its super class to beMZMapViewController
. - Back, in the storyboard, change the UIViewController's subclass to be
DemoMapViewController
.
Override viewDidLoad()
in DemoMapViewController
's implementation and instruct it to load a map style like so:
_ = try? loadStyleAsync(.bubbleWrap) { [unowned self] (style) in
// the map is now ready for interaction
}
This will load the house style Bubble Wrap that's packaged with the SDK.
Your map is now ready to use.
For advanced use (animations, custom styles, etc.) please refer to the Tangram ES documentation.