blob: ddf04d5ce33aff548eff09090a62ecb73f79d3b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import Mapbox
@objc(SatelliteStyleExample_Swift)
class SatelliteStyleExample_Swift: UIViewController {
var mapView: MGLMapView!
override func viewDidLoad() {
super.viewDidLoad()
// A hybrid style with unobtrusive labels is also available via satelliteStreetsStyleURL(withVersion:).
mapView = MGLMapView(frame: view.bounds, styleURL: MGLStyle.satelliteStyleURL(withVersion: 9))
// Tint the ℹ️ button.
mapView.attributionButton.tintColor = .white
mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
// Set the map’s center coordinate and zoom level.
mapView.setCenter(CLLocationCoordinate2D(latitude: 45.5188, longitude: -122.6748), zoomLevel: 13, animated: false)
view.addSubview(mapView)
}
}
|