Back to examples
beginner

Satellite styles

Use the satellite base layer on your map.

      

import Mapbox

class ViewController: 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)
        
        // 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)
    }
    
}




      
      


#import "ViewController.h"
@import Mapbox;

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    // A hybrid style with unobtrusive labels is also available via +satelliteStreetsStyleURLWithVersion:.
    NSURL *styleURL = [MGLStyle satelliteStyleURL];
    MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:styleURL];

    // Tint the ℹ️ button.
    mapView.attributionButton.tintColor = [UIColor whiteColor];

    mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    
    // Set the map’s center coordinate and zoom level.
    [mapView setCenterCoordinate:CLLocationCoordinate2DMake(45.5188, -122.6748)
                       zoomLevel:13
                        animated:NO];
    
    [self.view addSubview:mapView];
}

@end