MBXMapKit has been deprecated

MBXMapKit is no longer maintained. Instead, we recommend our Mapbox GL-based iOS SDK 2.0.0+ for vector-based maps.

Easy Mapbox integration with Apple's MapKit

Easy Mapbox integration with Apple's MapKit

A small open source library for building map applications on the Apple platform. Provides highly flexible visual styling & offline use for iPhone, iPad, and Mac devices.

MBXMapKitv0.7.0
Installation Supports iOS versions 7.0+ & OSX versions 10.9+

Feature overview

MBXMapKit makes it easy to integrate custom maps that you've made with Mapbox into your MapKit projects. Using MBXMapKit, you can:

  • Use a custom styled Mapbox map made with the Mapbox online editor to completely replace Apple's maps.
  • Create a transparent regional overlay in Mapbox Studio, upload it to Mapbox, then add it as an overlay to any MapKit-based map.
  • Download Mapbox maps, including any server-side markers and their icons, for completely and unlimited offline use when a network connection isn't available.
  • Control the image quality of downloaded maps in order to optimize bandwidth use.

API overview

MBXMapKit's main workhorse is MBXRasterTileOverlay, which makes it easy to add raster map tile layers (either replacing or adding to existing map content). To familiarize yourself with overlays, check out Apple’s MapKit documentation for details on getting started. Using overlays means that Apple's framework is only added to, allowing for all of its strengths to be leveraged as well as existing MapKit-based code to be easily migrated to MBXMapKit.

  • MBXRasterTileOverlay lets you easily add one or more overlays using either a Mapbox Map ID for online, Mapbox-hosted maps, or a previously-cached MBXOfflineMapDatabase.
  • The MBXRasterTileOverlayDelegate protocol works with overlays to allow you to tap into overlay lifecycle events such as metadata and marker loading and possible errors encountered along the way.
  • MBXOfflineMapDownloader is a shared object for downloading offline maps tile-by-tile. Mapbox offers unrestricted control for caching our maps such as Mapbox Streets on mobile devices with MBXMapKit.
  • The MBXOfflineMapDownloaderDelegate protocol lets you track the state and progress of map download operations.

Full API documentation is available on the web or right in Xcode, either inline or in Xcode's Quick Help inspector. You can also run the provided install_docs.sh shell script in a Terminal window, which leverages appledoc to create and install a documentation set into Xcode's documentation viewer.

Tile caching

Caching usage
You can cache maps for as much and as long as you like but you may not run a proxy or intermediate cache between Mapbox and devices or further redistribute maps from a devices cache. For the full details see our Terms of Service.

Retina support

Mapbox Streets has retina support for tiles that can be utilized by MBXMapKit. This brings high-DPI display for devices such as the iPhone 4 and newer, retina iPads, and retina Macs.

Retina tiles are enhanced with wider streets and enlarged labels. A resulting image on retina-capable devices is incredibly sharp. Here’s a side-by-side comparison up close:

There's nothing special to do to support retina devices. Mapbox automatically adds the @2x suffix to map tile requests and the platform automatically adjusts the tile content as necessary.