Skip to content

Commit

Permalink
fix for tapping user location point and drawer handling when making a…
Browse files Browse the repository at this point in the history
… new feature layer
  • Loading branch information
tyburg committed Oct 29, 2024
1 parent bc051e0 commit ef46203
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mapcache-ios.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 60;
CURRENT_PROJECT_VERSION = 61;
DEVELOPMENT_TEAM = ZL8G5D9G2H;
ENABLE_TESTABILITY = YES;
GCC_NO_COMMON_BLOCKS = YES;
Expand Down Expand Up @@ -1476,7 +1476,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CURRENT_PROJECT_VERSION = 60;
CURRENT_PROJECT_VERSION = 61;
DEVELOPMENT_TEAM = ZL8G5D9G2H;
GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "mapcache-ios/Info.plist";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ @interface MCFeatureLayerDetailsViewController ()
@property (strong, nonatomic) MCFieldWithTitleCell *layerNameCell;
@property (strong, nonatomic) MCButtonCell *buttonCell;
@property (strong, nonatomic) MCDescriptionCell *descriptionCell;
@property (nonatomic) BOOL haveScrolled;
@property (nonatomic) CGFloat contentOffset;
@end

@implementation MCFeatureLayerDetailsViewController
Expand Down Expand Up @@ -52,7 +54,15 @@ - (void)viewDidLoad {
self.tableView.estimatedRowHeight = 100;
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.separatorStyle = UIAccessibilityTraitNone;

UIEdgeInsets tabBarInsets = UIEdgeInsetsMake(0, 0, self.tabBarController.tabBar.frame.size.height, 0);
self.tableView.contentInset = tabBarInsets;
self.tableView.scrollIndicatorInsets = tabBarInsets;
self.contentOffset = 0;
self.haveScrolled = NO;

[self.view addSubview:self.tableView];
[self addDragHandle];
[self addCloseButton];

[[MCMetrics shared] featureLayerDetails];
Expand Down Expand Up @@ -157,11 +167,42 @@ - (BOOL)textFieldShouldReturn:(UITextField *)textField {
return YES;
}


#pragma mark - NGADrawerView methods
- (void) closeDrawer {
[self.drawerViewDelegate popDrawer];
}

- (void) drawerWasCollapsed {
[super drawerWasCollapsed];
[self.tableView setScrollEnabled:NO];
}


- (void) drawerWasMadeFull {
[super drawerWasMadeFull];
[self.tableView setScrollEnabled:YES];
}

// Override this method to make the drawer and the scrollview play nice
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
if (self.haveScrolled) {
[self rollUpPanGesture:scrollView.panGestureRecognizer withScrollView:scrollView];
}
}

// If the table view is scrolling rollup the gesture to the drawer and handle accordingly.
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
self.haveScrolled = YES;

if (!self.isFullView) {
scrollView.scrollEnabled = NO;
scrollView.scrollEnabled = YES;
} else {
scrollView.scrollEnabled = YES;
}
}




#pragma mark - GPKGSButtonCellDelegate
Expand Down
4 changes: 4 additions & 0 deletions mapcache-ios/map/MCMapViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ -(void)mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated{
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view {
NSLog(@"MCMapController - Tapped map point");

if ([view.annotation isKindOfClass:MKUserLocation.class]) {
return;
}

if ([view isKindOfClass:MKAnnotationView.class] || [view isKindOfClass:MKMarkerAnnotationView.class]) {
[self zoomToPointWithOffset:view.annotation.coordinate];
[self.mapActionDelegate showDetailsForAnnotation:(GPKGMapPoint *)view.annotation];
Expand Down

0 comments on commit ef46203

Please sign in to comment.