Mapbox Maps SDK for iOS
The Mapbox Maps SDK for iOS is an open-source framework for embedding interactive map views with scalable, customizable vector maps into Cocoa Touch applications on iOS 9.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.
For setup information, check out the Mapbox Maps SDK for iOS homepage. For detailed usage instructions, read “First steps with the Mapbox Maps SDK for iOS” and consult the online examples.
If you have any questions, please see our help page. We welcome your bug reports, feature requests, and contributions.
Changes in version 5.8.0
Styles and rendering
- The
IN
andCONTAINS
predicate operators can now test whether a string is a substring of another string or whether the evaluated feature (SELF
) lies within a givenMGLShape
orMGLFeature
. (#183, #184 - Added the
MGLLineStyleLayer.lineSortKey
andMGLFillStyleLayer.fillSortKey
properties. (#179, #16194, #16220) - The
MGLSymbolStyleLayer.iconTextFit
property now respects the cap insets of any nine-part stretchable image passed into the-[MGLStyle setImage:forName:]
method. You can define the stretchable area in Xcode’s asset catalog or by calling the-[UIImage resizableImageWithCapInsets:]
method. (#182) - The
-[MGLStyle localizeLabelsIntoLocale:]
and-[NSExpression mgl_expressionLocalizedIntoLocale:]
methods can now localize text into Traditional Chinese and Vietnamese. (#173) - Fixed an issue where an
MGLSymbolStyleLayer.lineDashPattern
value of{1, 0}
resulted in hairline gaps. (#16202) - Improved the performance of loading a style that has many style images. (#16187)
Snapshots
- Added the
MGLMapSnapshotter.delegate
property andMGLMapSnapshotterDelegate
protocol for customizing the style before taking a snapshot. (#235) - You no longer need to explicitly capture the
MGLMapSnapshotter
object in the completion handler that you specify in-[MGLMapSnapshotter startWithCompletionHandler:]
. Even if you declare the snapshotter locally without holding a strong reference to it, the snapshotter is only deallocated after the completion handler finishes, and the completion handler generally receives a valid snapshot. (#210) - The
-[MGLMapSnapshotter cancel]
method no longer calls the completion handler passed into-[MGLMapSnapshotter startWithCompletionHandler:]
. (#210) - Fixed an issue where the
MGLMapSnapshotter.loading
property always returnedNO
, even while loading a snapshot. (#210)
Networking and storage
- Downloaded offline packs no longer reduce the storage space available for ambient caching of tiles and other resources. (#15622)
- Added the
-[MGLOfflineStorage preloadData:forURL:modificationDate:expirationDate:eTag:mustRevalidate:completionHandler:]
method for determining when the data is ready to retrieve from the cache. (#188) - Fixed issues where an offline pack would stop downloading before completion. (#16230, #16240)
- When an offline pack encounters an HTTP 404 error, the
MGLOfflinePackUserInfoKeyError
user info key of theMGLOfflinePackErrorNotification
now indicates the resource that could not be downloaded. (#16240)
Other changes
- Added the
MGLMapView.minimumPitch
andMGLMapView.maximumPitch
properties to further limit how much the user or your code can tilt the map. (#208) - Fixed a crash while quitting the application after adding an annotation to
MGLMapView
. (#252) - Improved performance when continuously animating a tilted map. (#16287)
- Fixed a memory leak when zooming with any options enabled in the
MGLMapView.debugMask
property. (#15179)
Recent changes
See the full changelog for previous releases.