Skip to content

Instantly share code, notes, and snippets.

@plu

plu/KMMapPoint.h Secret

Last active January 2, 2016 12:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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

Hey plu can you provide the whole code of it to perform clustering..I am student and want to perform clustering of gmsmarkers on google map in ios..but not get the code which can direct me in right direction to find solutions.Thanks in advance

@rochakrajameta
Copy link

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