diff options
Diffstat (limited to 'platform/ios/demo/Examples/Swift/DefaultStylesExample.swift')
-rw-r--r-- | platform/ios/demo/Examples/Swift/DefaultStylesExample.swift | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/platform/ios/demo/Examples/Swift/DefaultStylesExample.swift b/platform/ios/demo/Examples/Swift/DefaultStylesExample.swift new file mode 100644 index 0000000000..2c1eb6e390 --- /dev/null +++ b/platform/ios/demo/Examples/Swift/DefaultStylesExample.swift @@ -0,0 +1,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) + } +} |