diff options
Diffstat (limited to 'ios')
41 files changed, 595 insertions, 0 deletions
diff --git a/ios/FAQ.md b/ios/FAQ.md new file mode 100644 index 0000000000..19ae74fdba --- /dev/null +++ b/ios/FAQ.md @@ -0,0 +1,49 @@ +# Mapbox GL for iOS FAQ + +Mapbox GL is a completely new renderer technology which will eventually replace and/or merge Mapbox's existing iOS toolsets, the [Mapbox iOS SDK](http://www.mapbox.com/mapbox-ios-sdk/) and [MBXMapKit](https://www.mapbox.com/mbxmapkit/). This FAQ shares our current plans for that migration. The plans are subject to change as Mapbox GL matures, but we wanted to both clarify our thinking as well as set expectations for where things are headed. + +### When will Mapbox GL be released? + +The library is [open source](https://github.com/mapbox/mapbox-gl-native) right now, but an official, production-recommended release will come later in 2015. + +### What iOS versions will be supported? + +Mapbox GL currently supports iOS 7 and later. This will continue to be the case. MBXMapKit also supports iOS 7 and greater, but this does mean that moving from the iOS SDK will leave behind iOS 5 and 6. + +### Will the API be similar to the Mapbox iOS SDK/MBXMapKit/MapKit? + +Yes. We are shooting for bringing the Mapbox GL API in line with Apple's MapKit for the easiest transition ability. + +MBXMapKit is already an add-on to MapKit, so Apple's `MKMapView` API is used directly. + +The Mapbox iOS SDK is "workalike", since it descends from an [upstream open source project](https://github.com/Alpstein/route-me) that predates Apple's own MapKit. It uses similar concepts like annotations (with the difference that the map view delegate provides `CALayer` instances instead of `UIView`, the intention being that Mapbox GL will support `UIView`), similar API for managing the map view center, bounds, and zoom levels, and an `RMUserLocation` API that is very much like `MKUserLocation`. But the Mapbox iOS SDK also features unique APIs like extensible tile sources, offline caching, UTFGrid interactivity, and point annotation clustering. + +### Will the iOS SDK's extra APIs make it over to Mapbox GL? + +The intention is yes. This includes: + +#### Tile sources + +The SDK uses the `RMTileSource` protocol to allow for extensible remote and local raster tile sources, as well as custom on-the-fly raster tile generation. We are planning to build a transitional API in Mapbox GL that acts as a wrapper to `RMTileSource` so that existing sources can be used to plug into the main Mapbox GL source API. + +#### Offline caching + +Both the Mapbox iOS SDK and MBXMapKit feature robust support for offline caching of raster tiles and the SDK features support for [MBTiles](http://mbtiles.org) tile sources. + +We're likely going to take a similar approach to both performance caching and offline maps as is done with the `0.3.0` release of MBXMapKit. That is, `NSURLCache` will be used for performance caching and specific, separate offline map database management will be used for fetching areas of map tiles. This is a cleaner design than exists in the SDK, which combines performance and offline caches and has a non-intuitive configuration API. + +We will likely also port over MBTiles support to Mapbox GL. + +#### UTFGrid interactivity + +[UTFGrid](https://github.com/mapbox/utfgrid-spec) is a technology for enabling interactive features in raster tiles. Support for the technology is provided in the Mapbox iOS SDK with categories in `RMInteractiveSource` in combination with either `RMMapboxSource` or `RMMBTilesSource`. + +Mapbox GL obsoletes this sort of pixel-based interactivity since the source data used for rendering can be queried on-device, so we are unlikely to port UTFGrid over to GL. + +#### Annotation clustering + +We're planning on adding support for point clustering to Mapbox GL and it will likely have a similar API to the SDK's. Clustering will happen on an individual style layer level. The performance for clustering, as well as annotations in general, will hopefully be better than in the SDK, since it will be done with direct OpenGL rendering instead of Core Animation layers. + +### What will the migration path look like? + +Ideally, the migration will be pretty lightweight because of the APIs supported above. There may be slight syntax changes, but they likely won't be more than would be expected from something like Mapbox iOS SDK version `1.x` to a hypothetical `2.x`. diff --git a/ios/MapboxGL.podspec b/ios/MapboxGL.podspec new file mode 100644 index 0000000000..6cdec1826d --- /dev/null +++ b/ios/MapboxGL.podspec @@ -0,0 +1,33 @@ +Pod::Spec.new do |m| + + m.name = 'MapboxGL' + m.version = '0.1.0' + + m.summary = 'Open source vector map solution for iOS with full styling capabilities.' + m.description = 'Open source OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa bindings.' + m.homepage = 'https://www.mapbox.com/blog/mapbox-gl/' + m.license = 'BSD' + m.author = { 'Mapbox' => 'mobile@mapbox.com' } + m.screenshot = 'https://raw.githubusercontent.com/mapbox/mapbox-gl-cocoa/master/pkg/screenshot.png' + m.social_media_url = 'https://twitter.com/Mapbox' + + m.source = { :git => 'https://github.com/mapbox/mapbox-gl-cocoa.git', :tag => m.version.to_s } + + m.platform = :ios + m.ios.deployment_target = '7.0' + + m.source_files = 'dist/static/Headers/*.h' + + m.requires_arc = true + + m.resource_bundle = { 'MapboxGL' => 'dist/static/MapboxGL.bundle/*' } + + m.frameworks = 'CoreLocation', 'Foundation', 'GLKit', 'SystemConfiguration', 'UIKit' + + m.libraries = 'MapboxGL', 'c++', 'sqlite3', 'z' + + m.vendored_libraries = 'dist/static/libMapboxGL.a' + + m.xcconfig = { 'OTHER_CPLUSPLUSFLAGS' => '-std=gnu++11 -stdlib=libc++' } + +end diff --git a/ios/README.md b/ios/README.md new file mode 100644 index 0000000000..2af03691e2 --- /dev/null +++ b/ios/README.md @@ -0,0 +1,68 @@ +# Mapbox GL for iOS + +Use or edit this project to get access to vector maps (via [Mapbox Vector Tiles](https://www.mapbox.com/blog/vector-tiles)) and dynamic OpenGL-based styling in your iOS apps by using `MGLMapView`. + +![](./screenshot.png) + +## Installation + +Currently in flux. See the parent `mapbox-gl-native` project `README` for details on building this library yourself. + +Static and dynamic prebuilt binaries are coming back, as is CocoaPods support. + +## Example usage + +### Objective-C + +```objective-c +MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:CGRectMake(0, 0, 400, 400) + accessToken:@"<access token string>"]; + +[mapView setCenterCoordinate:CLLocationCoordinate2DMake(28.369334, -80.743779) + zoomLevel:13 + animated:NO]; + +[mapView useBundledStyleNamed:@"outdoors"]; + +[self.view addSubview:mapView]; +``` + +### Swift + +```swift +let mapView = MGLMapView(frame: CGRect(x: 0, y: 0, width: 400, height: 400), + accessToken: "<access token string>") + +mapView.setCenterCoordinate(CLLocationCoordinate2D(latitude: 46.049900, longitude: -122.095678), + zoomLevel: 12, + animated: false) + +mapView.useBundledStyleNamed("outdoors") + +view.addSubview(mapView) +``` + +## Development + +If you'd like to contribute to this project, go up to [Mapbox GL native](https://github.com/mapbox/mapbox-gl-native) and clone the project. + +## Testing + +Currently in flux and not functioning. + +## Requirements + + * iOS 7+ + * a sense of adventure + +## Styling + +See the [online style reference](https://www.mapbox.com/mapbox-gl-style-spec/) for the latest documentation. Contained within the `MapboxGL.bundle` assets are a couple of starter styles in JSON format. + +The project will eventually get a programmatic styling API as well. + +## Related Projects + + * https://github.com/mapbox/mapbox-gl-style-spec + * https://github.com/mapbox/mapbox-gl-js + * https://github.com/mapbox/vector-tile-spec diff --git a/ios/app/MBXAppDelegate.h b/ios/app/MBXAppDelegate.h new file mode 100644 index 0000000000..da081fdcd5 --- /dev/null +++ b/ios/app/MBXAppDelegate.h @@ -0,0 +1,7 @@ +#import <UIKit/UIKit.h> + +@interface MBXAppDelegate : UIResponder <UIApplicationDelegate> + +@property (strong, nonatomic) UIWindow *window; + +@end
\ No newline at end of file diff --git a/ios/app/MBXAppDelegate.m b/ios/app/MBXAppDelegate.m new file mode 100644 index 0000000000..f0541b9971 --- /dev/null +++ b/ios/app/MBXAppDelegate.m @@ -0,0 +1,15 @@ +#import "MBXAppDelegate.h" +#import "MBXViewController.h" + +@implementation MBXAppDelegate + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions +{ + self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; + self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[MBXViewController new]]; + [self.window makeKeyAndVisible]; + + return YES; +} + +@end diff --git a/ios/app/MBXViewController.h b/ios/app/MBXViewController.h new file mode 100644 index 0000000000..924d3af60c --- /dev/null +++ b/ios/app/MBXViewController.h @@ -0,0 +1,5 @@ +#import <UIKit/UIKit.h> + +@interface MBXViewController : UIViewController + +@end diff --git a/ios/app/MBXViewController.mm b/ios/app/MBXViewController.mm new file mode 100644 index 0000000000..4945b73cc5 --- /dev/null +++ b/ios/app/MBXViewController.mm @@ -0,0 +1,266 @@ +#import "MBXViewController.h" + +#import <mbgl/ios/MGLMapView.h> + +#import <mbgl/platform/darwin/settings_nsuserdefaults.hpp> + +#import <CoreLocation/CoreLocation.h> + +static UIColor *const kTintColor = [UIColor colorWithRed:0.120 green:0.550 blue:0.670 alpha:1.000]; + +static NSDictionary *const kStyles = @{ + @"bright-v6": @"Bright", + @"basic-v6": @"Basic", + @"outdoors-v6": @"Outdoors", + @"satellite-v6": @"Satellite" +}; + +@interface MBXViewController () <UIActionSheetDelegate, CLLocationManagerDelegate> + +@property (nonatomic) MGLMapView *mapView; +@property (nonatomic) CLLocationManager *locationManager; + +@end + +@implementation MBXViewController + +mbgl::Settings_NSUserDefaults *settings = nullptr; + +#pragma mark - Setup + +- (id)init +{ + self = [super init]; + + if (self) + { + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveState:) name:UIApplicationDidEnterBackgroundNotification object:nil]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(restoreState:) name:UIApplicationWillEnterForegroundNotification object:nil]; + } + + return self; +} + +- (void)viewDidLoad +{ + [super viewDidLoad]; + + NSString *accessToken = [[NSProcessInfo processInfo] environment][@"MAPBOX_ACCESS_TOKEN"]; + if (accessToken) { + // Store to preferences so that we can launch the app later on without having to specify + // token. + [[NSUserDefaults standardUserDefaults] setObject:accessToken forKey:@"access_token"]; + } else { + // Try to retrieve from preferences, maybe we've stored them there previously and can reuse + // the token. + accessToken = [[NSUserDefaults standardUserDefaults] objectForKey:@"access_token"]; + } + + if ( ! accessToken) NSLog(@"No access token set. Mapbox vector tiles won't work."); + + self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds accessToken:accessToken]; + self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; + [self.view addSubview:self.mapView]; + + self.mapView.viewControllerForLayoutGuides = self; + + self.view.tintColor = kTintColor; + self.navigationController.navigationBar.tintColor = kTintColor; + self.mapView.tintColor = kTintColor; + + self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"settings.png"] + style:UIBarButtonItemStylePlain + target:self + action:@selector(showSettings)]; + + UIButton *titleButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [titleButton setFrame:CGRectMake(0, 0, 120, 40)]; + [titleButton setTitle:[[kStyles allValues] firstObject] forState:UIControlStateNormal]; + [titleButton setTitleColor:kTintColor forState:UIControlStateNormal]; + [titleButton addTarget:self action:@selector(cycleStyles) forControlEvents:UIControlEventTouchUpInside]; + self.navigationItem.titleView = titleButton; + + self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"locateUser.png"] + style:UIBarButtonItemStylePlain + target:self + action:@selector(locateUser)]; + + settings = new mbgl::Settings_NSUserDefaults(); + [self restoreState:nil]; +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" + +- (void)saveState:(NSNotification *)notification +{ + if (self.mapView && settings) + { + settings->longitude = self.mapView.centerCoordinate.longitude; + settings->latitude = self.mapView.centerCoordinate.latitude; + settings->zoom = self.mapView.zoomLevel; + settings->bearing = self.mapView.direction; + settings->debug = self.mapView.isDebugActive; + settings->save(); + } +} + +- (void)restoreState:(NSNotification *)notification +{ + if (self.mapView && settings) { + settings->load(); + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(settings->latitude, settings->longitude) zoomLevel:settings->zoom animated:NO]; + self.mapView.direction = settings->bearing; + [self.mapView setDebugActive:settings->debug]; + } +} + +#pragma clang diagnostic pop + +- (NSUInteger)supportedInterfaceOrientations +{ + return UIInterfaceOrientationMaskAll; +} + +#pragma mark - Actions + +- (void)showSettings +{ + UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:@"Map Settings" + delegate:self + cancelButtonTitle:@"Cancel" + destructiveButtonTitle:nil + otherButtonTitles:@"Reset North", @"Reset Position", @"Toggle Debug", nil]; + + [sheet showFromBarButtonItem:self.navigationItem.leftBarButtonItem animated:YES]; +} + +- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex +{ + if (buttonIndex == actionSheet.firstOtherButtonIndex) + { + [self.mapView resetNorth]; + } + else if (buttonIndex == actionSheet.firstOtherButtonIndex + 1) + { + [self.mapView resetPosition]; + } + else if (buttonIndex == actionSheet.firstOtherButtonIndex + 2) + { + [self.mapView toggleDebug]; + } +} + +- (void)cycleStyles +{ + UIButton *titleButton = (UIButton *)self.navigationItem.titleView; + + NSString *styleName = [titleButton titleForState:UIControlStateNormal]; + + if ( ! styleName) + { + styleName = [[kStyles allKeys] firstObject]; + } + else + { + NSUInteger index = [[kStyles allValues] indexOfObject:styleName] + 1; + if (index == [[kStyles allKeys] count]) index = 0; + styleName = [[kStyles allKeys] objectAtIndex:index]; + } + + [self.mapView useBundledStyleNamed:styleName]; + + [titleButton setTitle:kStyles[styleName] forState:UIControlStateNormal]; +} + +- (void)locateUser +{ + if ( ! self.locationManager) + { + self.locationManager = [CLLocationManager new]; + self.locationManager.delegate = self; + } + + if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) + { + [[[UIAlertView alloc] initWithTitle:@"Authorization Denied" + message:@"Please enable location services for this app in Privacy settings." + delegate:nil + cancelButtonTitle:nil otherButtonTitles:@"OK", nil] show]; + } + else + { +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 + if ([CLLocationManager instancesRespondToSelector:@selector(requestWhenInUseAuthorization)]) + { + if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse) + { + [self.locationManager startUpdatingLocation]; + } + else + { + [_locationManager requestWhenInUseAuthorization]; + } + } + else + { + [self.locationManager startUpdatingLocation]; + } +#else + [self.locationManager startUpdatingLocation]; +#endif + } +} + +#pragma mark - Destruction + +- (void)dealloc +{ + [[NSNotificationCenter defaultCenter] removeObserver:self]; + + if (settings) + { + [self saveState:nil]; + delete settings; + settings = nullptr; + } +} + +#pragma mark - Location + +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status +{ + switch (status) + { + case kCLAuthorizationStatusAuthorizedAlways: +#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000 + case kCLAuthorizationStatusAuthorizedWhenInUse: +#endif + { + [manager startUpdatingLocation]; + break; + } + default: + { + } + } +} + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" + +- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations +{ + CLLocation *latestLocation = locations.lastObject; + + if ([latestLocation distanceFromLocation:[[CLLocation alloc] initWithLatitude:self.mapView.centerCoordinate.latitude longitude:self.mapView.centerCoordinate.longitude]] > 100) + { + [self.mapView setCenterCoordinate:CLLocationCoordinate2DMake(latestLocation.coordinate.latitude, latestLocation.coordinate.longitude) zoomLevel:17 animated:YES]; + } + + [self.locationManager stopUpdatingLocation]; +} + +#pragma clang diagnostic pop + +@end diff --git a/ios/app/README.md b/ios/app/README.md new file mode 100644 index 0000000000..325670f1ea --- /dev/null +++ b/ios/app/README.md @@ -0,0 +1,3 @@ +This is the app for use in the development of Mapbox GL for iOS. + +If you want to run this app, head up to [`mapbox-gl-native`](https://github.com/mapbox/mapbox-gl-native) and follow the iOS installation instructions there.
\ No newline at end of file diff --git a/ios/app/app-info.plist b/ios/app/app-info.plist new file mode 100644 index 0000000000..c15cbeb64f --- /dev/null +++ b/ios/app/app-info.plist @@ -0,0 +1,51 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> +<plist version="1.0"> +<dict> + <key>CFBundleDevelopmentRegion</key> + <string>en</string> + <key>CFBundleDisplayName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundleExecutable</key> + <string>${EXECUTABLE_NAME}</string> + <key>CFBundleIdentifier</key> + <string>com.mapbox.MapboxGL</string> + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + <key>CFBundleName</key> + <string>${PRODUCT_NAME}</string> + <key>CFBundlePackageType</key> + <string>APPL</string> + <key>CFBundleShortVersionString</key> + <string>0.0.1</string> + <key>CFBundleSignature</key> + <string>MBGL</string> + <key>CFBundleVersion</key> + <string>0.0.1</string> + <key>LSRequiresIPhoneOS</key> + <true/> + <key>NSHumanReadableCopyright</key> + <string>(c) 2014 Mapbox</string> + <key>NSLocationWhenInUseUsageDescription</key> + <string>The map will be centered on the user's location.</string> + <key>UILaunchStoryboardName</key> + <string>Default</string> + <key>UIRequiredDeviceCapabilities</key> + <array> + <string>armv7</string> + </array> + <key>UISupportedInterfaceOrientations</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> + <key>UISupportedInterfaceOrientations~ipad</key> + <array> + <string>UIInterfaceOrientationPortrait</string> + <string>UIInterfaceOrientationPortraitUpsideDown</string> + <string>UIInterfaceOrientationLandscapeLeft</string> + <string>UIInterfaceOrientationLandscapeRight</string> + </array> +</dict> +</plist> diff --git a/ios/app/img/Default-568h@2x.png b/ios/app/img/Default-568h@2x.png Binary files differnew file mode 100644 index 0000000000..ea3706427a --- /dev/null +++ b/ios/app/img/Default-568h@2x.png diff --git a/ios/app/img/Default-667h@2x.png b/ios/app/img/Default-667h@2x.png Binary files differnew file mode 100644 index 0000000000..03f139de66 --- /dev/null +++ b/ios/app/img/Default-667h@2x.png diff --git a/ios/app/img/Icon-40.png b/ios/app/img/Icon-40.png Binary files differnew file mode 100644 index 0000000000..eca13393e6 --- /dev/null +++ b/ios/app/img/Icon-40.png diff --git a/ios/app/img/Icon-40@2x.png b/ios/app/img/Icon-40@2x.png Binary files differnew file mode 100644 index 0000000000..070d037539 --- /dev/null +++ b/ios/app/img/Icon-40@2x.png diff --git a/ios/app/img/Icon-60.png b/ios/app/img/Icon-60.png Binary files differnew file mode 100644 index 0000000000..ff4c6ab4b1 --- /dev/null +++ b/ios/app/img/Icon-60.png diff --git a/ios/app/img/Icon-60@2x.png b/ios/app/img/Icon-60@2x.png Binary files differnew file mode 100644 index 0000000000..b7f25955f5 --- /dev/null +++ b/ios/app/img/Icon-60@2x.png diff --git a/ios/app/img/Icon-72.png b/ios/app/img/Icon-72.png Binary files differnew file mode 100644 index 0000000000..0c876f664d --- /dev/null +++ b/ios/app/img/Icon-72.png diff --git a/ios/app/img/Icon-72@2x.png b/ios/app/img/Icon-72@2x.png Binary files differnew file mode 100644 index 0000000000..6da408204a --- /dev/null +++ b/ios/app/img/Icon-72@2x.png diff --git a/ios/app/img/Icon-76.png b/ios/app/img/Icon-76.png Binary files differnew file mode 100644 index 0000000000..895b4a1761 --- /dev/null +++ b/ios/app/img/Icon-76.png diff --git a/ios/app/img/Icon-76@2x.png b/ios/app/img/Icon-76@2x.png Binary files differnew file mode 100644 index 0000000000..7bc5208976 --- /dev/null +++ b/ios/app/img/Icon-76@2x.png diff --git a/ios/app/img/Icon-Small-50.png b/ios/app/img/Icon-Small-50.png Binary files differnew file mode 100644 index 0000000000..6d17da4b00 --- /dev/null +++ b/ios/app/img/Icon-Small-50.png diff --git a/ios/app/img/Icon-Small-50@2x.png b/ios/app/img/Icon-Small-50@2x.png Binary files differnew file mode 100644 index 0000000000..ac4ec19282 --- /dev/null +++ b/ios/app/img/Icon-Small-50@2x.png diff --git a/ios/app/img/Icon-Small.png b/ios/app/img/Icon-Small.png Binary files differnew file mode 100644 index 0000000000..aecbbc8a1d --- /dev/null +++ b/ios/app/img/Icon-Small.png diff --git a/ios/app/img/Icon-Small@2x.png b/ios/app/img/Icon-Small@2x.png Binary files differnew file mode 100644 index 0000000000..7773852e7a --- /dev/null +++ b/ios/app/img/Icon-Small@2x.png diff --git a/ios/app/img/Icon-Spotlight-40.png b/ios/app/img/Icon-Spotlight-40.png Binary files differnew file mode 100644 index 0000000000..eca13393e6 --- /dev/null +++ b/ios/app/img/Icon-Spotlight-40.png diff --git a/ios/app/img/Icon-Spotlight-40@2x.png b/ios/app/img/Icon-Spotlight-40@2x.png Binary files differnew file mode 100644 index 0000000000..070d037539 --- /dev/null +++ b/ios/app/img/Icon-Spotlight-40@2x.png diff --git a/ios/app/img/Icon.png b/ios/app/img/Icon.png Binary files differnew file mode 100644 index 0000000000..9ca8194eef --- /dev/null +++ b/ios/app/img/Icon.png diff --git a/ios/app/img/Icon@2x.png b/ios/app/img/Icon@2x.png Binary files differnew file mode 100644 index 0000000000..7c2e8ba037 --- /dev/null +++ b/ios/app/img/Icon@2x.png diff --git a/ios/app/img/iTunesArtwork b/ios/app/img/iTunesArtwork Binary files differnew file mode 100644 index 0000000000..ac6a0c58e8 --- /dev/null +++ b/ios/app/img/iTunesArtwork diff --git a/ios/app/img/iTunesArtwork.png b/ios/app/img/iTunesArtwork.png Binary files differnew file mode 100644 index 0000000000..b10824b048 --- /dev/null +++ b/ios/app/img/iTunesArtwork.png diff --git a/ios/app/img/iTunesArtwork@2x b/ios/app/img/iTunesArtwork@2x Binary files differnew file mode 100644 index 0000000000..fae1dad8bf --- /dev/null +++ b/ios/app/img/iTunesArtwork@2x diff --git a/ios/app/img/iTunesArtwork@2x.png b/ios/app/img/iTunesArtwork@2x.png Binary files differnew file mode 100644 index 0000000000..fdee900aa4 --- /dev/null +++ b/ios/app/img/iTunesArtwork@2x.png diff --git a/ios/app/img/locateUser.png b/ios/app/img/locateUser.png Binary files differnew file mode 100644 index 0000000000..aa8d1cf52e --- /dev/null +++ b/ios/app/img/locateUser.png diff --git a/ios/app/img/locateUser@2x.png b/ios/app/img/locateUser@2x.png Binary files differnew file mode 100644 index 0000000000..29c4905938 --- /dev/null +++ b/ios/app/img/locateUser@2x.png diff --git a/ios/app/img/settings.png b/ios/app/img/settings.png Binary files differnew file mode 100644 index 0000000000..5d7643eef5 --- /dev/null +++ b/ios/app/img/settings.png diff --git a/ios/app/img/settings@2x.png b/ios/app/img/settings@2x.png Binary files differnew file mode 100644 index 0000000000..2bb9f0ebad --- /dev/null +++ b/ios/app/img/settings@2x.png diff --git a/ios/app/main.m b/ios/app/main.m new file mode 100644 index 0000000000..954584f141 --- /dev/null +++ b/ios/app/main.m @@ -0,0 +1,10 @@ +#import <UIKit/UIKit.h> + +#import "MBXAppDelegate.h" + +int main(int argc, char * argv[]) +{ + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([MBXAppDelegate class])); + } +} diff --git a/ios/app/mapboxgl-app.gyp b/ios/app/mapboxgl-app.gyp new file mode 100644 index 0000000000..7287932fc5 --- /dev/null +++ b/ios/app/mapboxgl-app.gyp @@ -0,0 +1,57 @@ +{ + 'includes': [ + '../../gyp/common.gypi', + ], + 'targets': [ + { 'target_name': 'iosapp', + 'product_name': 'Mapbox GL', + 'type': 'executable', + 'product_extension': 'app', + 'mac_bundle': 1, + 'mac_bundle_resources': [ + '<!@(find ./img -type f)', + ], + + 'dependencies': [ + '../../mbgl.gyp:bundle_styles', + '../../mbgl.gyp:core', + '../../mbgl.gyp:platform-<(platform_lib)', + '../../mbgl.gyp:http-<(http_lib)', + '../../mbgl.gyp:asset-<(asset_lib)', + '../../mbgl.gyp:cache-<(cache_lib)', + ], + + 'sources': [ + './main.m', + './MBXAppDelegate.h', + './MBXAppDelegate.m', + './MBXViewController.h', + './MBXViewController.mm', + '../../platform/darwin/settings_nsuserdefaults.mm', + ], + + 'xcode_settings': { + 'SDKROOT': 'iphoneos', + 'SUPPORTED_PLATFORMS': 'iphonesimulator iphoneos', + 'INFOPLIST_FILE': 'app-info.plist', + 'TARGETED_DEVICE_FAMILY': '1,2', + 'COMBINE_HIDPI_IMAGES': 'NO', # don't merge @2x.png images into .tiff files + 'CLANG_ENABLE_OBJC_ARC': 'YES', + }, + + 'configurations': { + 'Debug': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Developer', + }, + }, + 'Release': { + 'xcode_settings': { + 'CODE_SIGN_IDENTITY': 'iPhone Distribution', + 'ARCHS': [ "armv7", "armv7s", "arm64", "i386", "x86_64" ], + }, + }, + }, + } + ] +} diff --git a/ios/docs/install_docs.sh b/ios/docs/install_docs.sh new file mode 100755 index 0000000000..4d116c0332 --- /dev/null +++ b/ios/docs/install_docs.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +if [ -z `which appledoc` ]; then + echo "Unable to find appledoc. Consider installing it from source or Homebrew." + exit 1 +fi + +VERSION=$( git tag | sort -r | sed -n '1p' ) +echo "Creating new docs for $VERSION..." +echo + +appledoc \ + --output /tmp/`uuidgen` \ + --project-name "Mapbox GL $VERSION" \ + --project-company Mapbox \ + --create-docset \ + --company-id com.mapbox \ + --ignore app \ + --ignore dist \ + --ignore pkg \ + --ignore test \ + --ignore .m \ + --ignore .mm \ + .
\ No newline at end of file diff --git a/ios/docs/remove_docs.sh b/ios/docs/remove_docs.sh new file mode 100755 index 0000000000..bb8c008dc2 --- /dev/null +++ b/ios/docs/remove_docs.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +echo +echo "Removing docs from ~/Library/Developer/Shared/Documentation/DocSets..." +echo + +rm -rfv ~/Library/Developer/Shared/Documentation/DocSets/com.mapbox.Mapbox-GL-*
\ No newline at end of file diff --git a/ios/mapbox-gl-cocoa b/ios/mapbox-gl-cocoa deleted file mode 160000 -Subproject f36ee137496c8cf11ab604cacbb63ca645e6741 diff --git a/ios/screenshot.png b/ios/screenshot.png Binary files differnew file mode 100644 index 0000000000..58db4413db --- /dev/null +++ b/ios/screenshot.png |