Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 1.27 KB

getting-started.md

File metadata and controls

31 lines (23 loc) · 1.27 KB

Getting started

1. Sign up for an API key

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"

2. Add a map to your storyboard

Adding a Mapzen map to your storyboard is as easy as:

  1. Drag a standard UIViewController onto your storyboard canvas.
  2. Create a subclass file named, for example: DemoMapViewController and set its super class to be MZMapViewController.
  3. Back, in the storyboard, change the UIViewController's subclass to be DemoMapViewController.

3. Initialize the map

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.