hungio / route-me

Automatically exported from code.google.com/p/route-me
0 stars 0 forks source link

conflict between original marker code and path objects #75

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This code from RMMarkerManager.m looks like it would create undesired side 
effects on a map 
view using both markers and paths.

Probably not worth fixing since a significant rewrite of marker handling is in 
work.

- (void) removeMarkers
{
    [[contents overlay] setSublayers:[NSArray arrayWithObjects:nil]]; 
}

- (void) hideAllMarkers 
{
    [[contents overlay] setHidden:YES];
}

- (void) unhideAllMarkers
{
    [[contents overlay] setHidden:NO];
}

Original issue reported on code.google.com by halmuel...@gmail.com on 8 Mar 2009 at 11:30

GoogleCodeExporter commented 8 years ago
Hi, i think this is a good work around:

- (void) removeMarkers
{
    //[[contents overlay] setSublayers:[NSArray arrayWithObjects:nil]];
    NSMutableArray *layers = [[NSMutableArray alloc] init];
    for (CALayer *layer in [[contents overlay] sublayers]) {
        if (![layer isMemberOfClass:[RMMarker class]]) {
            [layers addObject:layer];
        }
    }
    [[contents overlay] setSublayers:[layers autorelease]];
}

Original comment by m.krause...@googlemail.com on 6 Jul 2010 at 10:13