Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
also sort circles with shapes in z-ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Jan 31, 2013
1 parent 8ea867d commit f03045d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MapView/Map/RMMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -2842,10 +2842,10 @@ - (void)correctOrderingOfAllAnnotations

// markers above shapes
//
if ( [annotation1.layer isKindOfClass:[RMMarker class]] && [annotation2.layer isKindOfClass:[RMShape class]])
if ( [annotation1.layer isKindOfClass:[RMMarker class]] && [@[[RMShape class], [RMCircle class]] containsObject:[annotation2.layer class]])
return NSOrderedDescending;

if ( [annotation1.layer isKindOfClass:[RMShape class]] && [annotation2.layer isKindOfClass:[RMMarker class]])
if ( [@[[RMShape class], [RMCircle class]] containsObject:[annotation1.layer class]] && [annotation2.layer isKindOfClass:[RMMarker class]])
return NSOrderedAscending;

// the rest in increasing y-position
Expand Down

4 comments on commit f03045d

@kylecrum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't appear to order things correctly if you subclass RMShape or RMCircle.

@incanus
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point. Will fix.

@incanus
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, this is fixed in 83fb3f0. Also take note of future feature #160.

@kylecrum
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, thanks.

That future feature would definitely be awesome. Maybe something like this?

- (CGFloat)mapView:(RMMapView *)mapView zPositionForAnnotation:(RMAnnotation *)annotation

Please sign in to comment.