Created
April 10, 2010 22:21
-
-
Save rodericj/362334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "CSImageAnnotationView.h" | |
#import "CSMapAnnotation.h" | |
#define kHeight 100 | |
#define kWidth 100 | |
#define kBorder 2 | |
@implementation CSImageAnnotationView | |
@synthesize imageView = _imageView; | |
- (id)initWithAnnotation:(id )annotation reuseIdentifier:(NSString *)reuseIdentifier | |
{ | |
self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]; | |
self.frame = CGRectMake(0, 0, kWidth, kHeight); | |
self.backgroundColor = [UIColor whiteColor]; | |
CSMapAnnotation* csAnnotation = (CSMapAnnotation*)annotation; | |
UIImage* image = [UIImage imageNamed:csAnnotation.userData]; | |
_imageView = [[UIImageView alloc] initWithImage:image]; | |
_imageView.frame = CGRectMake(kBorder, kBorder, kWidth - 2 * kBorder, kWidth - 2 * kBorder); | |
[self addSubview:_imageView]; | |
return self; | |
} | |
-(void) dealloc | |
{ | |
[_imageView release]; | |
[super dealloc]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment