Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
Attach compass gesture recognizer to compass view
Browse files Browse the repository at this point in the history
Fixes #3099.
  • Loading branch information
1ec5 committed Nov 24, 2015
1 parent 6d4e86f commit 8ba6f80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Known issues:

## iOS master

- Fixed an issue preventing the compass from responding to taps after the compass is moved programmatically. ([#3116](https://github.com/mapbox/mapbox-gl-native/pull/3116))

## iOS 3.0.0

- If you install this SDK via CocoaPods, CocoaPods version 0.38.0 or above is required. ([#2132](https://github.com/mapbox/mapbox-gl-native/pull/2132))
Expand Down
3 changes: 2 additions & 1 deletion platform/ios/MGLMapView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,11 @@ - (void)commonInit
_compassView.accessibilityLabel = @"Compass";
_compassView.frame = CGRectMake(0, 0, _compassView.image.size.width, _compassView.image.size.height);
_compassView.alpha = 0;
_compassView.userInteractionEnabled = YES;
[_compassView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCompassTapGesture:)]];
UIView *container = [[UIView alloc] initWithFrame:CGRectZero];
[container addSubview:_compassView];
container.translatesAutoresizingMaskIntoConstraints = NO;
[container addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleCompassTapGesture:)]];
[self addSubview:container];

// setup interaction
Expand Down

0 comments on commit 8ba6f80

Please sign in to comment.