diff options
author | Julian Rex <julian.rex@gmail.com> | 2019-02-05 13:50:12 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-05 13:50:12 -0500 |
commit | 5ba4a6a980119010fba6515a14d3a67a73dd4672 (patch) | |
tree | 875553d90445741c91e45f1f7aa89dd0aa9a7d84 /platform/ios/app | |
parent | 47852b6c42b7884dbb7ad107a112c7e0d9f96ed0 (diff) | |
download | qtlocation-mapboxgl-5ba4a6a980119010fba6515a14d3a67a73dd4672.tar.gz |
[ios] Reverts "Enable customize positions of mapview ornaments (#13556)" (#13870)
This reverts commit e22d28c285c1543ebbf75d205f0129e74b0fbb8a.
Diffstat (limited to 'platform/ios/app')
-rw-r--r-- | platform/ios/app/MBXOrnamentsViewController.h | 5 | ||||
-rw-r--r-- | platform/ios/app/MBXOrnamentsViewController.m | 93 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 11 |
3 files changed, 1 insertions, 108 deletions
diff --git a/platform/ios/app/MBXOrnamentsViewController.h b/platform/ios/app/MBXOrnamentsViewController.h deleted file mode 100644 index 087101cdc0..0000000000 --- a/platform/ios/app/MBXOrnamentsViewController.h +++ /dev/null @@ -1,5 +0,0 @@ -#import <UIKit/UIKit.h> - -@interface MBXOrnamentsViewController : UIViewController - -@end diff --git a/platform/ios/app/MBXOrnamentsViewController.m b/platform/ios/app/MBXOrnamentsViewController.m deleted file mode 100644 index 5e575f8c7d..0000000000 --- a/platform/ios/app/MBXOrnamentsViewController.m +++ /dev/null @@ -1,93 +0,0 @@ -#import "MBXOrnamentsViewController.h" - -@import Mapbox; - -@interface MBXOrnamentsViewController ()<MGLMapViewDelegate> - -@property (nonatomic) MGLMapView *mapView; -@property (nonatomic) NSTimer *timer; -@property (nonatomic) NSInteger currentPositionIndex; - -@end - -@implementation MBXOrnamentsViewController - -- (void)setCurrentPositionIndex:(NSInteger)currentPositionIndex { - NSArray *ornamentPositions = @[@[ - @(MGLOrnamentPositionTopLeft), - @(MGLOrnamentPositionTopRight), - @(MGLOrnamentPositionBottomRight), - @(MGLOrnamentPositionBottomLeft) - ], - @[ - @(MGLOrnamentPositionTopRight), - @(MGLOrnamentPositionBottomRight), - @(MGLOrnamentPositionBottomLeft), - @(MGLOrnamentPositionTopLeft) - ], - @[ - @(MGLOrnamentPositionBottomRight), - @(MGLOrnamentPositionBottomLeft), - @(MGLOrnamentPositionTopLeft), - @(MGLOrnamentPositionTopRight) - ], - @[ - @(MGLOrnamentPositionBottomLeft), - @(MGLOrnamentPositionTopLeft), - @(MGLOrnamentPositionTopRight), - @(MGLOrnamentPositionBottomRight) - ], - @[ - @(MGLOrnamentPositionTopLeft), - @(MGLOrnamentPositionTopRight), - @(MGLOrnamentPositionBottomRight), - @(MGLOrnamentPositionBottomLeft) - ], - ]; - NSArray *currentPosition = ornamentPositions[currentPositionIndex]; - self.mapView.scaleBarPosition = [currentPosition[0] integerValue]; - self.mapView.compassViewPosition = [currentPosition[1] integerValue]; - self.mapView.logoViewPosition = [currentPosition[2] integerValue]; - self.mapView.attributionButtonPosition = [currentPosition[3] integerValue]; - - _currentPositionIndex = currentPositionIndex; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - self.title = @"Ornaments"; - - MGLMapView *mapView = [[MGLMapView alloc] initWithFrame:self.view.frame]; - mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [mapView setCenterCoordinate:CLLocationCoordinate2DMake(39.915143, 116.404053) - zoomLevel:16 - direction:30 - animated:NO]; - mapView.delegate = self; - mapView.showsScale = YES; - [self.view addSubview:mapView]; - - self.mapView = mapView; -} - -- (void)viewDidDisappear:(BOOL)animated { - [self.timer invalidate]; - self.timer = nil; -} - -- (void)viewDidAppear:(BOOL)animated { - self.timer = [NSTimer scheduledTimerWithTimeInterval:1 - target:self - selector:@selector(onTimerTick) - userInfo:nil - repeats:YES]; -} - -- (void)onTimerTick { - self.currentPositionIndex ++; - if (self.currentPositionIndex >= 4) { - self.currentPositionIndex = 0; - } -} - -@end diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 9c506cadfa..b2c6ca26b3 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -7,7 +7,6 @@ #import "MBXUserLocationAnnotationView.h" #import "LimeGreenStyleLayer.h" #import "MBXEmbeddedMapViewController.h" -#import "MBXOrnamentsViewController.h" #import "MBXFrameTimeGraphView.h" @@ -105,9 +104,8 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { MBXSettingsMiscellaneousShowSnapshots, MBXSettingsMiscellaneousShouldLimitCameraChanges, MBXSettingsMiscellaneousShowCustomLocationManager, - MBXSettingsMiscellaneousOrnamentsPlacement, MBXSettingsMiscellaneousPrintLogFile, - MBXSettingsMiscellaneousDeleteLogFile + MBXSettingsMiscellaneousDeleteLogFile, }; // Utility methods @@ -501,7 +499,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { @"Show Snapshots", [NSString stringWithFormat:@"%@ Camera Changes", (_shouldLimitCameraChanges ? @"Unlimit" : @"Limit")], @"View Route Simulation", - @"Ornaments Placement", ]]; if (self.debugLoggingEnabled) @@ -759,12 +756,6 @@ CLLocationCoordinate2D randomWorldCoordinate() { } break; } - case MBXSettingsMiscellaneousOrnamentsPlacement: - { - MBXOrnamentsViewController *ornamentsViewController = [[MBXOrnamentsViewController alloc] init]; - [self.navigationController pushViewController:ornamentsViewController animated:YES]; - break; - } default: NSAssert(NO, @"All miscellaneous setting rows should be implemented"); break; |