diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/BUILD_OSX | 92 | ||||
-rw-r--r-- | docs/BUILD_OSX.md | 19 | ||||
-rw-r--r-- | docs/DEVELOP_OSX.md | 6 |
3 files changed, 7 insertions, 110 deletions
diff --git a/docs/BUILD_OSX b/docs/BUILD_OSX deleted file mode 100644 index 6a43025201..0000000000 --- a/docs/BUILD_OSX +++ /dev/null @@ -1,92 +0,0 @@ -# Building Mapbox GL Native for iOS - -This section is for people contributing to Mapbox GL directly in the context of their own app. - -### Build - -1. Install [appledoc](http://appledoc.gentlebytes.com/appledoc/) for API docs generation. - - ``` - curl -L -o appledoc.zip https://github.com/tomaz/appledoc/releases/download/v2.2-963/appledoc.zip - unzip appledoc.zip - cp appledoc /usr/local/bin - cp -Rf Templates/ ~/.appledoc - ``` - -1. Run `make ipackage`. The packaging script will produce the statically-linked `libMapbox.a`, `Mapbox.bundle` for resources, a `Headers` folder, and a `Docs` folder with HTML API documentation. - -### Access Tokens - -_The demo applications use Mapbox vector tiles, which require a Mapbox account and API access token. Obtain an access token on the [Mapbox account page](https://www.mapbox.com/account/apps/)._ - -Set up the access token by editing the scheme for the application target, then adding an environment variable with the name `MAPBOX_ACCESS_TOKEN`. - -![edit scheme](https://cloud.githubusercontent.com/assets/98601/5460702/c4610262-8519-11e4-873a-8597821da468.png) - -![setting access token in Xcode scheme](https://cloud.githubusercontent.com/assets/162976/5349358/0a086f00-7f8c-11e4-8433-bdbaccda2b58.png) - -### Test - -In the context of your own app, you can now either: - -#### CocoaPods - -Currently, until [#1437](https://github.com/mapbox/mapbox-gl-native/issues/1437) is completed, to install a _development version_ of Mapbox GL using CocoaPods you will need to build it from source manually per above. - -1. Zip up the build product. - - ``` - cd build/ios/pkg/static - ZIP=mapbox-ios-sdk.zip - rm -f ../${ZIP} - zip -r ../${ZIP} * - ``` - -1. Modify a custom `Mapbox-iOS-SDK.podspec` to download this zip file. - - ```rb - {...} - - m.source = { - :http => "http://{...}/mapbox-ios-sdk.zip", - :flatten => true - } - - {...} - ``` - -1. Update your app's `Podfile` to point to the `Mapbox-iOS-SDK.podspec`. - - ```rb - pod 'Mapbox-iOS-SDK', :podspec => 'http://{...}/Mapbox-iOS-SDK.podspec' - ``` - -1. Run `pod update` to grab the newly-built library. - -#### Binary - -1. Built from source manually per above. - -1. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that: - - - `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting. - - `Mapbox.bundle` is in your target's *Copy Bundle Resources* build phase. - - `libMapbox.a` is in your target's *Link Binary With Libraries* build phase. - -1. Add the following Cocoa framework dependencies to your target's *Link Binary With Libraries* build phase: - - - `GLKit.framework` - - `ImageIO.framework` - - `MobileCoreServices.framework` - - `QuartzCore.framework` - - `SystemConfiguration.framework` - - `libc++.dylib` - - `libsqlite3.dylib` - - `libz.dylib` - - `CoreTelephony.framework` (optional, telemetry-only) - -1. Add `-ObjC` to your target's "Other Linker Flags" build setting (`OTHER_LDFLAGS`). - -## Troubleshooting - -On OS X, you can also try clearing the Xcode cache with `make clear_xcode_cache`. diff --git a/docs/BUILD_OSX.md b/docs/BUILD_OSX.md index 5b4f6e6327..a2e936d59b 100644 --- a/docs/BUILD_OSX.md +++ b/docs/BUILD_OSX.md @@ -4,26 +4,13 @@ This project provides an OS X SDK analogous to the Mapbox iOS SDK. Mapbox does n ### Build -1. Run `make xpackage`. The packaging script will produce the statically-linked `libMapbox.a`, `Mapbox.bundle` for resources, and a `Headers` folder. +1. Run `make xpackage`, which produces a `Mapbox.framework` in the `gyp/build/Release/` folder. ### Install -1. Copy the contents of `build/osx/pkg/static` into your project. It should happen automatically, but ensure that: +1. Copy `gyp/build/Release/Mapbox.framework` into your project. It should happen automatically, but ensure that `Mapbox.framework` is listed in the *Linked Frameworks and Libraries* section of the General tab for your application target. - - `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting. - - `Mapbox.bundle` is in your target's *Copy Bundle Resources* build phase. - - `libMapbox.a` is in your target's *Link Binary With Libraries* build phase. - -1. Add the following Cocoa framework dependencies to your target's *Link Binary With Libraries* build phase: - - - `SystemConfiguration.framework` - - `libc++.tbd` - - `libsqlite3.tbd` - - `libz.tbd` - -1. Add `-ObjC` to your target's "Other Linker Flags" build setting (`OTHER_LDFLAGS`). - -1. 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](https://www.mapbox.com/account/apps/). +1. 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](https://www.mapbox.com/studio/account/tokens/). 1. 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). diff --git a/docs/DEVELOP_OSX.md b/docs/DEVELOP_OSX.md index 3ca96ebf24..4b30a1e94a 100644 --- a/docs/DEVELOP_OSX.md +++ b/docs/DEVELOP_OSX.md @@ -6,12 +6,14 @@ To create projects, you can run: - `make lproj`: Creates an Xcode project with platform-independent handlers for downloads and settings storage. This is what is also being built on Linux. - `make osx run-osx`: Builds and runs the OS X application on the command line with `xcodebuild`. -Note that you can't have more than one project in Xcode open at a time because the static library project is shared across the OS X, Linux and iOS project. +Note that you can't have more than one project in Xcode open at a time because the static library project is shared across the OS X, Linux, and iOS projects. -### Access Tokens +### Access tokens The demo applications use Mapbox vector tiles, which require a Mapbox account and API access token. Obtain an access token on the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/). You will be prompted for this access token the first time you launch the demo application. ### Usage Through the OS X SDK, the demo application supports a variety of standard gestures and keyboard shortcuts. For more details, open Mapbox GL Help from the Help menu. + +You can also [integrate the Mapbox OS X SDK into your own Cocoa application](BUILD_OSX.md). |