Skip to content

Commit ef46203

Browse files
committed
fix for tapping user location point and drawer handling when making a new feature layer
1 parent bc051e0 commit ef46203

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

mapcache-ios.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@
14471447
CLANG_ENABLE_MODULES = YES;
14481448
CODE_SIGN_IDENTITY = "iPhone Developer";
14491449
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1450-
CURRENT_PROJECT_VERSION = 60;
1450+
CURRENT_PROJECT_VERSION = 61;
14511451
DEVELOPMENT_TEAM = ZL8G5D9G2H;
14521452
ENABLE_TESTABILITY = YES;
14531453
GCC_NO_COMMON_BLOCKS = YES;
@@ -1476,7 +1476,7 @@
14761476
CLANG_ENABLE_MODULES = YES;
14771477
CODE_SIGN_IDENTITY = "iPhone Developer";
14781478
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
1479-
CURRENT_PROJECT_VERSION = 60;
1479+
CURRENT_PROJECT_VERSION = 61;
14801480
DEVELOPMENT_TEAM = ZL8G5D9G2H;
14811481
GCC_NO_COMMON_BLOCKS = YES;
14821482
INFOPLIST_FILE = "mapcache-ios/Info.plist";

mapcache-ios/geopackage/NewLayerWizard/MCFeatureLayerDetailsViewController.m

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ @interface MCFeatureLayerDetailsViewController ()
2121
@property (strong, nonatomic) MCFieldWithTitleCell *layerNameCell;
2222
@property (strong, nonatomic) MCButtonCell *buttonCell;
2323
@property (strong, nonatomic) MCDescriptionCell *descriptionCell;
24+
@property (nonatomic) BOOL haveScrolled;
25+
@property (nonatomic) CGFloat contentOffset;
2426
@end
2527

2628
@implementation MCFeatureLayerDetailsViewController
@@ -52,7 +54,15 @@ - (void)viewDidLoad {
5254
self.tableView.estimatedRowHeight = 100;
5355
self.tableView.rowHeight = UITableViewAutomaticDimension;
5456
self.tableView.separatorStyle = UIAccessibilityTraitNone;
57+
58+
UIEdgeInsets tabBarInsets = UIEdgeInsetsMake(0, 0, self.tabBarController.tabBar.frame.size.height, 0);
59+
self.tableView.contentInset = tabBarInsets;
60+
self.tableView.scrollIndicatorInsets = tabBarInsets;
61+
self.contentOffset = 0;
62+
self.haveScrolled = NO;
63+
5564
[self.view addSubview:self.tableView];
65+
[self addDragHandle];
5666
[self addCloseButton];
5767

5868
[[MCMetrics shared] featureLayerDetails];
@@ -157,11 +167,42 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField {
157167
return YES;
158168
}
159169

160-
170+
#pragma mark - NGADrawerView methods
161171
- (void) closeDrawer {
162172
[self.drawerViewDelegate popDrawer];
163173
}
164174

175+
- (void) drawerWasCollapsed {
176+
[super drawerWasCollapsed];
177+
[self.tableView setScrollEnabled:NO];
178+
}
179+
180+
181+
- (void) drawerWasMadeFull {
182+
[super drawerWasMadeFull];
183+
[self.tableView setScrollEnabled:YES];
184+
}
185+
186+
// Override this method to make the drawer and the scrollview play nice
187+
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
188+
if (self.haveScrolled) {
189+
[self rollUpPanGesture:scrollView.panGestureRecognizer withScrollView:scrollView];
190+
}
191+
}
192+
193+
// If the table view is scrolling rollup the gesture to the drawer and handle accordingly.
194+
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
195+
self.haveScrolled = YES;
196+
197+
if (!self.isFullView) {
198+
scrollView.scrollEnabled = NO;
199+
scrollView.scrollEnabled = YES;
200+
} else {
201+
scrollView.scrollEnabled = YES;
202+
}
203+
}
204+
205+
165206

166207

167208
#pragma mark - GPKGSButtonCellDelegate

mapcache-ios/map/MCMapViewController.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,10 @@ -(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated{
723723
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
724724
NSLog(@"MCMapController - Tapped map point");
725725

726+
if ([view.annotation isKindOfClass:MKUserLocation.class]) {
727+
return;
728+
}
729+
726730
if ([view isKindOfClass:MKAnnotationView.class] || [view isKindOfClass:MKMarkerAnnotationView.class]) {
727731
[self zoomToPointWithOffset:view.annotation.coordinate];
728732
[self.mapActionDelegate showDetailsForAnnotation:(GPKGMapPoint *)view.annotation];

0 commit comments

Comments
 (0)