Skip to content

Instantly share code, notes, and snippets.

@plu

plu/KMMapPoint.h Secret

Last active January 2, 2016 12:59
Show Gist options
  • Save plu/b3835e6afe7538fada15 to your computer and use it in GitHub Desktop.
Save plu/b3835e6afe7538fada15 to your computer and use it in GitHub Desktop.
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import <MapKit/MapKit.h>
@interface KMPointMapItem : NSObject <MKAnnotation>
- (instancetype)initWithLocation:(KMLocation *)location;
@property (nonatomic, assign) BOOL shouldBeMerged;
@property (nonatomic, strong) NSArray *containedAnnotations;
@property (nonatomic, strong) KMPointMapItem *clusterAnnotation;
@property (nonatomic, readwrite) CLLocationCoordinate2D coordinate;
@end
#import "KMLocation.h"
#import "KMPointMapItem.h"
@interface KMPointMapItem ()
@property (nonatomic, strong) KMLocation *location;
@end
@implementation KMPointMapItem
- (instancetype)initWithLocation:(KMLocation *)location
{
if (self = [super init]) {
_coordinate = CLLocationCoordinate2DMake(location.latitude.doubleValue, location.longitude.doubleValue);
_location = location;
_shouldBeMerged = YES;
}
return self;
}
- (NSString *)title
{
return self.location.name;
}
@end
@rochakrajameta
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment