Rewrote some copy to provide more context and link to more GL-related repos, including GL JS. Put the various SDKs in a table so we can show the various CI bot status images. Integrated target list into the relevant documents. Rewrote large portions of iOS and OS X setup documentation to guide normal developers to more friendly places. Combined some Android documentation. Moved SDK-specific documentation into platform/. Added a temporary readme in ios/ that points to the one in platform/ios/.
1.4 KiB
Integrating the Mapbox OS X SDK into your application
This document explains how to build the Mapbox OS X SDK and integrate it into your own Cocoa application.
Requirements
The Mapbox OS X SDK requires the OS X 10.10.0 SDK or above.
Build
- Install core dependencies.
- Run
make xpackage, which produces aMapbox.frameworkin thegyp/build/Release/folder.
Install
-
Copy
gyp/build/Release/Mapbox.frameworkinto your project. -
In the project editor, select your application target, go to the General tab, and add
Mapbox.frameworkto 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
MGLMapboxAccessTokento 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 theMapboxmodule (Swift) orMapbox.humbrella header (Objective-C).
Use
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.
Troubleshooting
You can also try clearing the Xcode cache with make clear_xcode_cache.