Maps

  • The MGLAccountManager object provides a global way to set a Mapbox API access token, as well as other settings used framework-wide.

    See more

    Declaration

    Objective-C

    @interface MGLAccountManager : NSObject

    Swift

    class MGLAccountManager : NSObject
  • An MGLMapCamera object represents a viewpoint from which the user observes some point on an MGLMapView.

    See more

    Declaration

    Objective-C

    @interface MGLMapCamera : NSObject <NSSecureCoding, NSCopying>

    Swift

    class MGLMapCamera : NSObject, NSSecureCoding, NSCopying
  • Options for enabling debugging features in an MGLMapView instance.

    See more

    Declaration

    Objective-C

    enum MGLMapDebugMaskOptions : NSUInteger {}

    Swift

    struct MGLMapDebugMaskOptions : OptionSetType
  • An interactive, customizable map view with an interface similar to the one provided by Apple’s MapKit.

    Using MGLMapView, you can embed the map inside a view, allow users to manipulate it with standard gestures, animate the map between different viewpoints, and present information in the form of annotations and overlays.

    The map view loads scalable vector tiles that conform to the Mapbox Vector Tile Specification. It styles them with a style that conforms to the Mapbox GL style specification. Such styles can be designed in Mapbox Studio and hosted on mapbox.com.

    A collection of Mapbox-hosted styles is available through the MGLStyle class. These basic styles use Mapbox Streets or Mapbox Satellite data sources, but you can specify a custom style that makes use of your own data.

    Mapbox-hosted vector tiles and styles require an API access token, which you can obtain from the Mapbox account page. Access tokens associate requests to Mapbox’s vector tile and style APIs with your Mapbox account. They also deter other developers from using your styles without your permission.

    Note

    You are responsible for getting permission to use the map data and for ensuring that your use adheres to the relevant terms of use.
    See more

    Declaration

    Objective-C

    @interface MGLMapView : UIView

    Swift

    class MGLMapView
  • A fast deceleration rate for a map view.

    Declaration

    Objective-C

    extern const CGFloat MGLMapViewDecelerationRateFast

    Swift

    let MGLMapViewDecelerationRateFast: CGFloat
  • Disables decleration in a map view.

    Declaration

    Objective-C

    extern const CGFloat MGLMapViewDecelerationRateImmediate

    Swift

    let MGLMapViewDecelerationRateImmediate: CGFloat
  • The default deceleration rate for a map view.

    Declaration

    Objective-C

    extern const CGFloat MGLMapViewDecelerationRateNormal

    Swift

    let MGLMapViewDecelerationRateNormal: CGFloat
  • The MGLMapViewDelegate protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the MGLMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request information about annotations displayed on the map, such as the styles and interaction modes to apply to individual annotations.

    See more

    Declaration

    Objective-C

    @protocol MGLMapViewDelegate <NSObject>

    Swift

    protocol MGLMapViewDelegate
  • A collection of convenience methods for creating style URLs of default styles provided by Mapbox. Learn more about Mapbox default styles.

    See more

    Declaration

    Objective-C

    @interface MGLStyle : NSObject

    Swift

    class MGLStyle : NSObject
  • A version number identifying the default version of the suite of default styles provided by Mapbox. This version number may be passed into one of the “StyleURLWithVersion” class methods of MGLStyle.

    The value of this constant generally corresponds to the latest released version as of the date on which this SDK was published. You can use this constant to ascertain the style used by MGLMapView and MGLTilePyramidOfflineRegion when no style URL is specified. Consult the Mapbox Styles API documentation for the most up-to-date style versioning information.

    Warning

    The value of this constant may change in a future release of the SDK. If you use any feature that depends on a specific aspect of a default style – for instance, the minimum zoom level that includes roads – you may use the current value of this constant or the underlying style URL, but do not use the constant itself. Such details may change significantly from version to version.

    Declaration

    Objective-C

    static const NSInteger MGLStyleDefaultVersion = 9

    Swift

    let MGLStyleDefaultVersion: Int