blob: 2c1eb6e390c2763ebdf230060d34d494d3cdb1c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import Mapbox
@objc(DefaultStylesExample_Swift)
class DefaultStylesExample_Swift: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let mapView = MGLMapView(frame: view.bounds,
styleURL: MGLStyle.outdoorsStyleURL(withVersion: 9))
// Tint the ℹ️ button and the user location annotation.
mapView.tintColor = .darkGray
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Set the map’s center coordinate and zoom level.
mapView.setCenter(CLLocationCoordinate2D(latitude: 51.50713,
longitude: -0.10957),
zoomLevel: 13, animated: false)
view.addSubview(mapView)
}
}
|