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 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.
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. A full changelog is also available.
If you have any questions, please see our help page. We welcome your bug reports, feature requests, and contributions.
Changes in version 4.0.0
Packaging
- Removed support for 32-bit simulators. (#10962)
- Added Danish and Hebrew localizations. (#10967, #11136)
- Removed methods, properties, and constants that had been deprecated as of v3.7.4. (#11205)
Styles and rendering
- Added support for a new layer type:
MGLHeatmapStyleLayer
, a powerful way to visualize point data distributions using heatmaps, fully customizable through runtime styling. #11046 - The layout and paint properties on subclasses of
MGLStyleLayer
are now of typeNSExpression
instead ofMGLStyleValue
. A new “Predicates and Expressions” guide provides an overview of the supported operators. (#10726) - Renamed
MGLRasterSource
toMGLRasterTileSource
andMGLVectorSource
toMGLVectorTileSource
. (#11568) - Added an
MGLComputedShapeSource
class that allows applications to supply vector data to a style layer on a per-tile basis. (#9983) - A style can now display smooth hillshading and customize its appearance at runtime using the
MGLHillshadeStyleLayer
class. Hillshading is based on a rasterized digital elevation model supplied by theMGLRasterDEMSource
class. (#10642) - The
MGLSymbolStyleLayer.textFontNames
property can now depend on a feature’s attributes. (#10850) - Added
MGLShapeSourceOptionWrapsCoordinates
, to specify whether the shape of anMGLComputedShapeSource
should be wrapped to accommodate coordinates with longitudes beyond −180 and 180; andMGLShapeSourceOptionClipsCoordinates
, to specify whether the shape of anMGLComputedShapeSource
should be clipped at the edge of each tile. (#11041) - Added support for Mapzen Terrarium DEM encoding. (#11274)
Map rendering
- Improved the reliability of collision detection between symbols near the edges of tiles, as well as between symbols when the map is tilted. It is no longer necessary to enable
MGLSymbolStyleLayer.symbolAvoidsEdges
to prevent symbols in adjacent tiles from overlapping with each other. (#10436) - Symbols can fade in and out as the map pans, rotates, or tilts. (#10436)
- Properties such as
MGLSymbolStyleLayer.iconAllowsOverlap
andMGLSymbolStyleLayer.iconIgnoresPlacement
now account for symbols in other sources. (#10436) - Fixed an issue preventing a dynamically-added
MGLRasterStyleLayer
from drawing until the map pans. (#10270) - Fixed an issue preventing
MGLImageSource
s from drawing on the map when the map is zoomed in and tilted. (#10677) - Improved the sharpness of raster tiles on Retina displays. (#10984)
- Fixed a crash parsing a malformed style. (#11001)
- Reduced memory usage by clearing in-memory tile cache before entering background. (#11197)
- Fixed an issue where symbols with empty labels would always be hidden. (#11206)
- Fixed an issue where a tilted map could flicker while displaying rotating symbols. (#11488)
- Increased the maximum width of labels by a factor of two. (#11508)
Annotations
- Fixed an issue preventing
MGLAnnotationImage.image
from being updated. (#10372) - Improved performance of
MGLAnnotationView
-backed annotations that havescalesWithViewingDistance
enabled. (#10951) - Fixed an issue where tapping a group of annotations may not have selected the nearest annotation. (#11438)
- The
MGLMapView.selectedAnnotations
property (backed by-[MGLMapView setSelectedAnnotations:]
) now selects annotations that are off-screen. (#9790) - The
animated
parameter to-[MGLMapView selectAnnotation:animated:]
now controls whether the annotation and its callout are brought on-screen. Ifanimated
isNO
then the annotation is selected if offscreen, but the map is not panned. Currently only point annotations are supported. Setting theMGLMapView.selectedAnnotations
property now animates. (#3249) - Fixed a crash when rapidly adding and removing annotations. (#11551, #11575)
Map snapshots
- Fixed a memory leak that occurred when creating a map snapshot. (#10585)
Other changes
- The
-[MGLMapView convertRect:toCoordinateBoundsFromView:]
method and theMGLMapView.visibleCoordinateBounds
property’s getter now indicate that the coordinate bounds straddles the antimeridian by extending one side beyond ±180 degrees longitude. (#11265) - Feature querying results now account for the
MGLSymbolStyleLayer.circleStrokeWidth
property. (#10897) - Fixed an issue preventing labels from being transliterated when VoiceOver was enabled on iOS 10.x and below. (#10881)
- Labels are now transliterated from more languages when VoiceOver is enabled. (#10881)
- Long-pressing the attribution button causes the SDK’s version number to be displayed in the action sheet that appears. (#10650)
- Reduced offline download size for styles with symbol layers that render only icons, and no text. (#11055)
- Added haptic feedback that occurs when the user rotates the map to due north, configurable via
MGLMapView.hapticFeedbackEnabled
. (#10847) - Added
MGLMapView.showsScale
as the recommended way to show the scale bar. This property can be set directly in Interface Builder. (#11335) - Fixed an issue where the scale bar would not appear until the map had moved. (#11335)