Authored by Justin R. Miller

abstract annotation ordering & correct when adding new annotations

... ... @@ -81,6 +81,7 @@
- (void)correctPositionOfAllAnnotations;
- (void)correctPositionOfAllAnnotationsIncludingInvisibles:(BOOL)correctAllLayers animated:(BOOL)animated;
- (void)correctOrderingOfAllAnnotations;
- (void)correctMinZoomScaleForBoundingMask;
... ... @@ -2726,6 +2727,18 @@
}
}
[self correctOrderingOfAllAnnotations];
[CATransaction commit];
}
- (void)correctPositionOfAllAnnotations
{
[self correctPositionOfAllAnnotationsIncludingInvisibles:YES animated:NO];
}
- (void)correctOrderingOfAllAnnotations
{
// sort annotation layer z-indexes so that they overlap properly
//
NSMutableArray *sortedAnnotations = [NSMutableArray arrayWithArray:[_visibleAnnotations allObjects]];
... ... @@ -2774,13 +2787,6 @@
//
if (_currentAnnotation)
_currentAnnotation.layer.zPosition = _currentCallout.layer.zPosition = MAXFLOAT;
[CATransaction commit];
}
- (void)correctPositionOfAllAnnotations
{
[self correctPositionOfAllAnnotationsIncludingInvisibles:YES animated:NO];
}
- (NSArray *)annotations
... ... @@ -2817,6 +2823,8 @@
[_overlayView addSublayer:annotation.layer];
[_visibleAnnotations addObject:annotation];
}
[self correctOrderingOfAllAnnotations];
}
}
... ...