This document explains how to build the Mapbox OS X SDK and integrate it into your own Cocoa application.
The Mapbox OS X SDK requires the OS X 10.10.0 SDK or above.
make xpackage
, which produces a Mapbox.framework
in the gyp/build/Release/
folder.Copy gyp/build/Release/Mapbox.framework
into your project.
In the project editor, select your application target, go to the General tab, and add Mapbox.framework
to the Embedded Binaries section.
Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target. In the Info tab, set MGLMapboxAccessToken
to your access token. You can obtain one from the Mapbox account page.
In a XIB or storyboard, add a Custom View and set its custom class to MGLMapView
. If you need to manipulate the map view programmatically, import the Mapbox
module (Swift) or Mapbox.h
umbrella header (Objective-C).
The Mapbox iOS SDK’s API documentation applies to the Mapbox OS X SDK with few differences, mostly around unimplemented features like user location tracking.
You can also try clearing the Xcode cache with make clear_xcode_cache
.