...
|
...
|
@@ -42,12 +42,25 @@ static CGImageRef _markerBlue = nil; |
|
|
@synthesize location;
|
|
|
@synthesize data;
|
|
|
@synthesize labelView;
|
|
|
@synthesize textForegroundColor;
|
|
|
@synthesize textBackgroundColor;
|
|
|
|
|
|
+ (RMMarker*) markerWithNamedStyle: (NSString*) styleName
|
|
|
{
|
|
|
return [[[RMMarker alloc] initWithNamedStyle: styleName] autorelease];
|
|
|
}
|
|
|
|
|
|
// init
|
|
|
- (id)init
|
|
|
{
|
|
|
if (self = [super init]) {
|
|
|
labelView = nil;
|
|
|
textForegroundColor = [UIColor blackColor];
|
|
|
textBackgroundColor = [UIColor clearColor];
|
|
|
}
|
|
|
return self;
|
|
|
}
|
|
|
|
|
|
- (id) initWithCGImage: (CGImageRef) image
|
|
|
{
|
|
|
return [self initWithCGImage: image anchorPoint: CGPointMake(0.5, 1.0)];
|
...
|
...
|
@@ -55,7 +68,7 @@ static CGImageRef _markerBlue = nil; |
|
|
|
|
|
- (id) initWithCGImage: (CGImageRef) image anchorPoint: (CGPoint) _anchorPoint
|
|
|
{
|
|
|
if (![super init])
|
|
|
if (![self init])
|
|
|
return nil;
|
|
|
|
|
|
self.contents = (id)image;
|
...
|
...
|
@@ -131,17 +144,19 @@ static CGImageRef _markerBlue = nil; |
|
|
- (void) setTextLabel: (NSString*)text
|
|
|
{
|
|
|
CGPoint position = CGPointMake([self bounds].size.width / 2 - [text sizeWithFont:[UIFont systemFontOfSize:15]].width / 2, 4);
|
|
|
[self setTextLabel:text toPosition:position withFont:[UIFont systemFontOfSize:15] withTextColor:[UIColor blackColor] withBackgroundColor:[UIColor clearColor]];
|
|
|
[self setTextLabel:text toPosition:position withFont:[UIFont systemFontOfSize:15] withTextColor:[self textForegroundColor] withBackgroundColor:[self textBackgroundColor]];
|
|
|
}
|
|
|
|
|
|
- (void) setTextLabel: (NSString*)text toPosition:(CGPoint)position
|
|
|
{
|
|
|
[self setTextLabel:text toPosition:position withFont:[UIFont systemFontOfSize:15] withTextColor:[UIColor blackColor] withBackgroundColor:[UIColor clearColor]];
|
|
|
[self setTextLabel:text toPosition:position withFont:[UIFont systemFontOfSize:15] withTextColor:[self textForegroundColor] withBackgroundColor:[self textBackgroundColor]];
|
|
|
}
|
|
|
|
|
|
- (void) setTextLabel: (NSString*)text withFont:(UIFont*)font withTextColor:(UIColor*)textColor withBackgroundColor:(UIColor*)backgroundColor
|
|
|
{
|
|
|
CGPoint position = CGPointMake([self bounds].size.width / 2 - [text sizeWithFont:font].width / 2, 4);
|
|
|
[self setTextForegroundColor:textColor];
|
|
|
[self setTextBackgroundColor:backgroundColor];
|
|
|
[self setTextLabel:text toPosition:position withFont:font withTextColor:textColor withBackgroundColor:backgroundColor];
|
|
|
}
|
|
|
|
...
|
...
|
@@ -154,6 +169,8 @@ static CGImageRef _markerBlue = nil; |
|
|
textSize.height+4);
|
|
|
|
|
|
UILabel *aLabel = [[UILabel alloc] initWithFrame:frame];
|
|
|
[self setTextForegroundColor:textColor];
|
|
|
[self setTextBackgroundColor:backgroundColor];
|
|
|
[aLabel setNumberOfLines:0];
|
|
|
[aLabel setAutoresizingMask:UIViewAutoresizingFlexibleWidth];
|
|
|
[aLabel setBackgroundColor:backgroundColor];
|
...
|
...
|
@@ -209,8 +226,10 @@ static CGImageRef _markerBlue = nil; |
|
|
|
|
|
- (void) dealloc
|
|
|
{
|
|
|
self.labelView = nil;
|
|
|
self.data = nil;
|
|
|
self.data = nil;
|
|
|
self.labelView = nil;
|
|
|
self.textForegroundColor = nil;
|
|
|
self.textBackgroundColor = nil;
|
|
|
[super dealloc];
|
|
|
}
|
|
|
|
...
|
...
|
|