Mapbox iOS SDK

The Mapbox iOS SDK is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 7.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the Mapbox GL Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using OpenGL.

For setup information, check out the Mapbox iOS SDK homepage. For detailed usage instructions, read “First steps with the Mapbox iOS SDK” and consult the online examples. A full changelog is also available.

If you have any questions, please contact our support team. We welcome your bug reports and feature requests.

Changes in version 3.1.0

  • The SDK is now distributed as a dynamic framework instead of a static library, resulting in a simpler installation workflow and significantly reduced download size. The framework contains both simulator and device content; due to an Xcode bug, you’ll need to strip out the simulator content before submitting your application to the App Store. (#3183)
  • Fixed an issue causing the entire MGLMapView to leak. (#3447)
  • MGLMapView methods that alter the viewport now accept optional completion handlers. (#3090)
  • You can now modify an annotation’s image after adding the annotation to the map. (#3146)
  • Tapping now selects annotations more reliably. Tapping near the top of a large annotation image now selects that annotation. An annotation image’s alignment insets influence how far away the user can tap and still select the annotation. For example, if your annotation image has a large shadow, you can keep that shadow from being tappable by excluding it from the image’s alignment rect. (#3261)
  • Annotations remain visible after switching to a different style. (#3049)
  • The minimum and maximum zoom levels can now be configured using the minimumZoomLevel and maximumZoomLevel properties, respectively. The map is no longer limited to zoom level 18: by default, the maximum zoom level is now 20, allowing for a more detailed map in urban areas. (#3712)
  • A new method on MGLMapView, -flyToCamera:withDuration:completionHandler:, lets you transition between viewpoints along an arc as if by aircraft. (#3171, #3301)
  • MGLMapCamera’s altitude values now match those of MKMapCamera. (#3362)
  • MGLMapView properties like centerCoordinate and camera now offset the center to account for any translucent top or bottom bar. As a result, when user tracking is enabled and the map view is an immediate child of a view controller, the user dot is centered in the unobscured portion of the map view. To override this offset, modify the contentInset property; you may also need to set the containing view controller’s automaticallyAdjustsScrollViewInsets property to NO. (#3583)
  • In user tracking mode, the user dot stays in a fixed position within MGLMapView while the map pans smoothly. A new property, userLocationVerticalAlignment, determines the user dot’s fixed position. (#3589)
  • When the user tracking mode is set to MGLUserTrackingModeFollowWithCourse, an optional targetCoordinate is kept within sight at all times as the user changes location. This property, in conjunction with the userLocationVerticalAlignment property, may be useful for displaying the user’s progress toward a waypoint. (#3680)
  • Heading or course tracking mode can now be enabled as soon as an MGLMapView is initialized. (#3680)
  • Zooming and rotation gestures no longer disable user tracking mode. (#3589)
  • User tracking mode starts out at a lower zoom level by default. (#3589)
  • Fixed an issue with small map views not properly fitting annotations within bounds. (#3407)
  • When the user rotates the map to within 7° of true north, the map view now snaps to true north. (#3403)
  • The map view’s background can now be transparent or translucent, as long as the style’s background layer is transparent or translucent and MGLMapView.opaque is set to NO. (#3096)
  • Documentation is now generated by jazzy instead of appledoc. ♪♫ (#3203)
  • New API to provide a custom callout view to the map for annotations. (#3456)
  • Made telemetry on/off setting available in-app. (#3445)
  • Fixed an issue with users not being counted by Mapbox if they had disabled telemetry. (#3495)
  • Fixed crash caused by MGLAnnotationImage with non-integer width or height (#2198)
  • Fixed “include of non-modular header” errors in Swift projects managed by CocoaPods. (#3679)
  • Avoids triggering the blue background location status bar when user has granted when in use permission. (#3671)
  • Deprecated the debugActive property and -toggleDebug method on MGLMapView in favor of a new debugMask property that exposes individual style debugging options. (#3742)