aboutsummaryrefslogtreecommitdiffstats
path: root/platform/ios/demo/Examples/Swift/SimpleMapViewExample.swift
blob: 924474c7c296c44961126d07fd1c108b65af3b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Mapbox

@objc(SimpleMapViewExample_Swift)

class SimpleMapViewExample_Swift: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let mapView = MGLMapView(frame: view.bounds)
        mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
        
        // Set the map’s center coordinate and zoom level.
        mapView.setCenter(CLLocationCoordinate2D(latitude: 59.31, longitude: 18.06), zoomLevel: 9, animated: false)
        view.addSubview(mapView)
    }
}