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

Commit

Permalink
Limit callouts to point annotations
Browse files Browse the repository at this point in the history
Also, include callout properties in object description.
  • Loading branch information
friedbunny committed Jul 27, 2016
1 parent 8dc99e6 commit 833a0a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
13 changes: 13 additions & 0 deletions platform/darwin/src/MGLPointAnnotation.h
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
7 changes: 5 additions & 2 deletions platform/darwin/src/MGLPointAnnotation.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 0 additions & 13 deletions platform/darwin/src/MGLShape.h
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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

/**
Expand Down

0 comments on commit 833a0a2

Please sign in to comment.