diff options
author | Jason Wray <jason@mapbox.com> | 2016-05-05 18:51:39 -0400 |
---|---|---|
committer | Jason Wray <jason@mapbox.com> | 2016-07-26 18:54:02 -0700 |
commit | 833a0a26df3d0beeb9f419f3eac91c8d2e21b437 (patch) | |
tree | 6eebd93d7262a4f66484eaa32792442d6acd0a86 | |
parent | 8dc99e60a532a24867810a75bd88b3ed02c246b2 (diff) | |
download | qtlocation-mapboxgl-833a0a26df3d0beeb9f419f3eac91c8d2e21b437.tar.gz |
Limit callouts to point annotations
Also, include callout properties in object description.
-rw-r--r-- | platform/darwin/src/MGLPointAnnotation.h | 13 | ||||
-rw-r--r-- | platform/darwin/src/MGLPointAnnotation.m | 7 | ||||
-rw-r--r-- | platform/darwin/src/MGLShape.h | 13 |
3 files changed, 18 insertions, 15 deletions
diff --git a/platform/darwin/src/MGLPointAnnotation.h b/platform/darwin/src/MGLPointAnnotation.h index 13afcab717..c2c43d2e07 100644 --- a/platform/darwin/src/MGLPointAnnotation.h +++ b/platform/darwin/src/MGLPointAnnotation.h @@ -1,6 +1,11 @@ #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> +#if TARGET_OS_IPHONE +#import <UIKit/UIKit.h> +#import "MGLCalloutView.h" +#endif + #import "MGLShape.h" #import "MGLTypes.h" @@ -20,6 +25,14 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, assign) CLLocationCoordinate2D coordinate; +#if TARGET_OS_IPHONE + +@property (nonatomic) BOOL canShowCallout; + +@property (nonatomic, nullable) UIView <MGLCalloutView> *calloutView; + +#endif + @end NS_ASSUME_NONNULL_END diff --git a/platform/darwin/src/MGLPointAnnotation.m b/platform/darwin/src/MGLPointAnnotation.m index 9495a2c6f8..f23382049a 100644 --- a/platform/darwin/src/MGLPointAnnotation.m +++ b/platform/darwin/src/MGLPointAnnotation.m @@ -3,14 +3,17 @@ @implementation MGLPointAnnotation @synthesize coordinate; +@synthesize canShowCallout; +@synthesize calloutView; - (NSString *)description { - return [NSString stringWithFormat:@"<%@: %p; title = %@; subtitle = %@; coordinate = %f, %f>", + return [NSString stringWithFormat:@"<%@: %p; title = %@; subtitle = %@; coordinate = %f, %f; callout: %@ (%@)>", NSStringFromClass([self class]), (void *)self, self.title ? [NSString stringWithFormat:@"\"%@\"", self.title] : self.title, self.subtitle ? [NSString stringWithFormat:@"\"%@\"", self.subtitle] : self.subtitle, - coordinate.latitude, coordinate.longitude]; + coordinate.latitude, coordinate.longitude, + canShowCallout ? @"yes" : @"no", calloutView]; } @end diff --git a/platform/darwin/src/MGLShape.h b/platform/darwin/src/MGLShape.h index 8a43c75950..40c92fc32d 100644 --- a/platform/darwin/src/MGLShape.h +++ b/platform/darwin/src/MGLShape.h @@ -1,10 +1,5 @@ #import <Foundation/Foundation.h> -#if TARGET_OS_IPHONE -#import <UIKit/UIKit.h> -#import "MGLCalloutView.h" -#endif - #import "MGLAnnotation.h" #import "MGLTypes.h" @@ -31,14 +26,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, copy, nullable) NSString *subtitle; -#if TARGET_OS_IPHONE - -@property (nonatomic) BOOL canShowCallout; - -@property (nonatomic, nullable) UIView <MGLCalloutView> *calloutView; - -#endif - #if !TARGET_OS_IPHONE /** |