diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2015-11-24 12:11:10 -0800 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2015-11-24 12:11:10 -0800 |
commit | f782f5eeb793bc4489a906969ab4774a2befbbb8 (patch) | |
tree | 5cb561547697635e81788f659c8ff327fa7185b2 /platform | |
parent | e87834f15d43981bf9aca3a82d1f31059d0fd8a7 (diff) | |
download | qtlocation-mapboxgl-f782f5eeb793bc4489a906969ab4774a2befbbb8.tar.gz |
Attach compass gesture recognizer to compass view
Fixes #3099.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/ios/MGLMapView.mm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/ios/MGLMapView.mm b/platform/ios/MGLMapView.mm index 20e5507c85..db5ef1ee46 100644 --- a/platform/ios/MGLMapView.mm +++ b/platform/ios/MGLMapView.mm @@ -292,10 +292,11 @@ std::chrono::steady_clock::duration durationInSeconds(float duration) _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 |