1.3 KiB
Building Mapbox GL Native for OS X
This project provides an OS X SDK analogous to the Mapbox iOS SDK. Mapbox does not officially support it to the same extent as the iOS SDK; however, bug reports and pull requests are certainly welcome. This document explains how to build the OS X SDK and integrate it into your own Cocoa application.
Build
- Run
make xpackage, which produces aMapbox.frameworkin thegyp/build/Release/folder.
Install
-
Copy
gyp/build/Release/Mapbox.frameworkinto your project. It should happen automatically, but ensure thatMapbox.frameworkis listed in the Linked Frameworks and Libraries section of the General tab for your application target. -
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).
Troubleshooting
You can also try clearing the Xcode cache with make clear_xcode_cache.