Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 593 Bytes

basic-functions.md

File metadata and controls

22 lines (17 loc) · 593 Bytes

Position, rotation, zoom, and tilt

When the map style finishes loading, your OnStyleLoaded closure will be executed and you can begin to manipulate the map. Set the position, rotation, zoom, and tilt as follows:

import Foundation
import Mapzen-ios-sdk

class PositionExampleViewController:  MZMapViewController {

  override func viewDidLoad() {
    super.viewDidLoad()
    _ = try? loadStyleAsync(.bubbleWrap) { [unowned self] (style) in
      self.position = TGGeoPointMake(-73.9903, 40.74433)
      self.rotation = 0
      self.zoom = 17
      self.tilt = 0
    }
  }

}