summaryrefslogtreecommitdiff
path: root/platform/osx
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-04-21 13:42:08 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-04-21 14:43:49 -0700
commit0dbec51401a70b121dd8e086f0d5fd7962c011a9 (patch)
tree367c3a401692d60ada4d2c9a1243bc3f28c42a88 /platform/osx
parentb2beeda50bbd48fecad957d194dd5b40c72eb9c7 (diff)
downloadqtlocation-mapboxgl-0dbec51401a70b121dd8e086f0d5fd7962c011a9.tar.gz
[ios, osx] Copyedited installation documentation
Copyedited installation documentation to make sense to less experienced Xcode users, ensure consistency, remove redundant language, and reflect recent build changes.
Diffstat (limited to 'platform/osx')
-rw-r--r--platform/osx/INSTALL.md38
1 files changed, 28 insertions, 10 deletions
diff --git a/platform/osx/INSTALL.md b/platform/osx/INSTALL.md
index e4566625eb..eaca3a2ba3 100644
--- a/platform/osx/INSTALL.md
+++ b/platform/osx/INSTALL.md
@@ -6,25 +6,43 @@ This document explains how to build the Mapbox OS X SDK and integrate it into yo
The Mapbox OS X SDK requires the OS X 10.10.0 SDK or above.
-### Build
+### Building the SDK
1. [Install core dependencies](../../INSTALL.md).
1. Run `make xpackage`, which produces a `Mapbox.framework` in the `gyp/build/Release/` folder.
-### Install
+### Installation
-1. Copy `gyp/build/Release/Mapbox.framework` into your project.
+1. Open the project editor, select your application target, then go to the General tab. Drag Mapbox.framework from the `build/osx/Build/Products/Release/` directory into the “Embedded Binaries” section. (Don’t drag it into the “Linked Frameworks and Libraries” section; Xcode will add it there automatically.) In the sheet that appears, make sure “Copy items if needed” is checked, then click Finish.
-1. In the project editor, select your application target, go to the General tab, and add `Mapbox.framework` to the *Embedded Binaries* section.
+1. Mapbox vector tiles require a Mapbox account and API access token. In the project editor, select the application target, then go to the Info tab. Under the “Custom OS X Application Target Properties” section, set `MGLMapboxAccessToken` to your access token. You can obtain an access token from the [Mapbox account page](https://www.mapbox.com/studio/account/tokens/).
-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/).
+## Usage
-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).
+In a storyboard or XIB, add a view to your view controller. (Drag Custom View from the Object library to the View Controller scene on the Interface Builder canvas.) In the Identity inspector, set the view’s custom class to `MGLMapView`. If you need to manipulate the map view programmatically:
-## Use
+1. Switch to the Assistant Editor.
+1. Import the `Mapbox` module.
+1. Connect the map view to a new outlet in your view controller class. (Control-drag from the map view in Interface Builder to a valid location in your view controller implementation.) The resulting outlet declaration should look something like this:
-The [Mapbox iOS SDK’s API documentation](https://www.mapbox.com/ios-sdk/api/) applies to the Mapbox OS X SDK with few differences, mostly around unimplemented features like user location tracking.
+```objc
+// ViewController.m
+@import Mapbox;
+
+@interface ViewController : NSViewController
+
+@property (strong) IBOutlet MGLMapView *mapView;
-## Troubleshooting
+@end
+```
-You can also try clearing the Xcode cache with `make clear_xcode_cache`.
+```swift
+// ViewController.swift
+import Mapbox
+
+class ViewController: NSViewController {
+ @IBOutlet var mapView: MGLMapView!
+}
+```
+
+The [Mapbox iOS SDK’s API documentation](https://www.mapbox.com/ios-sdk/api/) applies to the Mapbox OS X SDK with few differences, mostly around unimplemented features like user location tracking.