Beta
Maps SDK for iOS v10
All docsMaps SDK for iOS v10ExamplesDisplay a simple map view

Display a simple map view

ViewController
import UIKit
import MapboxMaps
class ViewController: UIViewController {
internal var mapView: MapView!
override public func viewDidLoad() {
super.viewDidLoad()
// Create a map view.
let myResourceOptions = ResourceOptions(accessToken: "your_public_access_token")
mapView = MapView(with: view.bounds, resourceOptions: myResourceOptions)
// Center the map camera over Stockholm.
mapView.cameraManager.setCamera(
centerCoordinate: CLLocationCoordinate2D(
latitude: 59.31, longitude: 18.06
),
zoom: 9.0
)
// Add the map.
self.view.addSubview(mapView)
}
}