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 8.0 and above using Objective-C, Swift, or Interface Builder. It takes stylesheets that conform to the Mapbox Style Specification, applies them to vector tiles that conform to the Mapbox Vector Tile Specification, and renders them using OpenGL.

Mapbox iOS SDK screenshots

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.6.0

Packaging

  • Xcode 8.0 or higher is now recommended for using this SDK. (#8775)
  • Fixed an issue in the static framework where localizations would never load. (#9074)
  • Updated MGLMapView’s logo view to display the new Mapbox logo. (#8771, #8773)
  • Added a Hungarian localization. (#9347)

Styles

  • Added support for 3D extrusion of buildings and other polygonal features via the MGLFillExtrusionStyleLayer class and the fill-extrusion layer type in style JSON. (#8431)
  • MGLMapView and MGLTilePyramidOfflineRegion now default to version 10 of the Mapbox Streets style. Similarly, several style URL class methods of MGLStyle return URLs to version 10 styles. Unversioned variations of these methods are no longer deprecated. MGLStyleDefaultVersion should no longer be used with any style other than Streets. (#6301)
  • Added class methods to MGLStyle that correspond to the new Traffic Day and Traffic Night styles. (#6301)
  • MGLSymbolStyleLayer’s iconImageName, iconScale, textFontSize, textOffset, and textRotation properties can now be set to a source or composite function. (#8544, #8590, #8592, #8593)
  • Fixed an issue where setting the MGLVectorStyleLayer.predicate property failed to take effect if the relevant source was not in use by a visible layer at the time. (#8653)
  • Fixed an issue preventing programmatically added style layers from appearing in already cached tiles. (#8954)
  • Fixed an issue causing a composite function’s highest zoom level stop to be misinterpreted. (#8613, #8790)
  • Fixed an issue where re-adding a layer that had been previously removed from a style would reset its paint properties. Moved initializers for MGLTileSource, MGLStyleLayer, and MGLForegroundStyleLayer to their concrete subclasses; because these classes were already intended for initialization only via concrete subclasses, this should have no developer impact. (#8626)
  • Fixed a crash that occurred when removing a source that was still being used by one or more style layers. Since this is a programming error, a warning is logged to the console instead. (#9129)
  • Feature querying results now account for any changes to a feature’s size caused by a source or composite style function. (#8665)
  • Fixed the behavior of composite functions that specify fractional zoom level stops. (#9289)
  • Letter spacing is now disabled in Arabic text so that ligatures are drawn correctly. (#9062)
  • Improved the performance of styles using source and composite style functions. (#9185, #9257)

Annotations

  • Added a new initializer to MGLAnnotationView so that it is possible to create a new instance with an associated annotation object. (#9029)
  • Added a new rotatesToMatchCamera property to MGLAnnotationView that, when set to true, causes the annotation view to rotate along with the map’s rotation angle giving the appearance that the annoation view is pinned to the map. (#9147)
  • Fixed an issue causing a view-backed annotation to disappear immediately instead of animating when the annotation’s coordinate property is set to a value outside the current viewport. (#8565)
  • Fixed an issue in which MGLMapView overrode the tint colors of its annotation views. (#8789)
  • Fixed an issue causing annotation views to persist in the map’s annotation container view even after their associated annotations were removed. (#9025)
  • The MGLPolyline.coordinate and MGLPolygon.coordinate properties now return the midpoint and centroid, respectively, instead of the first coordinate. (#8713)

User interaction

  • Added a scale bar to MGLMapView that indicates the scale of the map. (#7631)
  • Fixed an issue causing the map to go blank during a flight animation that travels a very short distance. (#9199)
  • Fixed an issue where gesture recognizers associated with map view interactivity were not disabled when their related interactions were disabled. (#8304)
  • Fixed an issue preventing the Mapbox Telemetry confirmation dialog from appearing when opened from within a map view in a modal view controller. (#9027)
  • Corrected the size of MGLMapView’s compass. (#9060)
  • The Improve This Map button in the attribution action sheet now leads to a feedback tool that matches MGLMapView’s rotation and pitch. -[MGLAttributionInfo feedbackURLAtCenterCoordinate:zoomLevel:] no longer respects the feedback URL specified in TileJSON. (#9078)
  • -[MGLMapViewDelegate mapView:shouldChangeFromCamera:toCamera:] can now block any panning caused by a pinch gesture. (#9344)
  • If the user taps on the map while it is flying to the user’s location, the user dot no longer appears in the incorrect location. (#7916)

Other changes

  • Fixed a crash that occurred when accessing the MGLMultiPolygon.coordinate property. (#8713)
  • Fixed a crash or console spew when MGLMapView is initialized with a frame smaller than 64 points wide by 64 points tall. (#8562)
  • Fixed an issue that caused the compass and scale bar to underlap navigation and tab bars. (#7716)
  • The error passed into -[MGLMapViewDelegate mapViewDidFailLoadingMap:withError:] now includes a more specific description and failure reason. (#8418)
  • Improved CPU and battery performance while animating a tilted map’s camera in an area with many labels. (#9031)
  • Fixed an issue rendering polylines that contain duplicate vertices. (#8808)
  • Added struct boxing to MGLCoordinateSpan, MGLCoordinateBounds, MGLOfflinePackProgress, and MGLTransition. (#9343)