Authored by Stenmark

Fixed bug with removeLabel

Not sure why removeLabel has to be called before replaceImage:anchorPoint:
... ... @@ -75,16 +75,15 @@
- (void) tapOnMarker: (RMMarker*) marker onMap: (RMMapView*) map
{
NSLog(@"MARKER TAPPED!");
[marker removeLabel];
if(!tap)
{
[marker replaceImage:[[UIImage imageNamed:@"marker-red.png"] CGImage] anchorPoint:CGPointMake(0.5,1.0)];
[marker removeLabel];
// [marker setTextLabel:@"World"];
tap=YES;
}else
{
[marker replaceImage:[[UIImage imageNamed:@"marker-blue.png"] CGImage] anchorPoint:CGPointMake(0.5,1.0)];
[marker removeLabel];
// [marker setTextLabel:@"Hello"];
tap=NO;
}
... ...
... ... @@ -94,7 +94,7 @@ static CGImageRef _markerBlue = nil;
}
if (aLabel != nil)
{
{
label = [aLabel retain];
//[self addSublayer:[label layer]];
[self addSublayer:[label layer]];
... ... @@ -139,6 +139,7 @@ static CGImageRef _markerBlue = nil;
{
[[label layer] removeFromSuperlayer];
[label release];
label = nil;
}
}
... ...