Authored by Justin R. Miller

auto-change tint color on point annotations

@@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
36 #import "RMShape.h" 36 #import "RMShape.h"
37 #import "RMAnnotation.h" 37 #import "RMAnnotation.h"
38 #import "RMQuadTree.h" 38 #import "RMQuadTree.h"
  39 +#import "RMPointAnnotation.h"
39 40
40 #import "RMFractalTileProjection.h" 41 #import "RMFractalTileProjection.h"
41 42
@@ -2669,6 +2670,18 @@ @@ -2669,6 +2670,18 @@
2669 } 2670 }
2670 } 2671 }
2671 2672
  2673 + for (RMAnnotation *annotation in self.annotations)
  2674 + {
  2675 + if ([annotation isKindOfClass:[RMPointAnnotation class]] && annotation.isAnnotationVisibleOnScreen)
  2676 + {
  2677 + [annotation.layer removeFromSuperlayer];
  2678 + annotation.layer = nil;
  2679 + [_overlayView addSublayer:annotation.layer];
  2680 + }
  2681 + }
  2682 +
  2683 + [self correctPositionOfAllAnnotations];
  2684 +
2672 if (_currentCallout) 2685 if (_currentCallout)
2673 _currentCallout.tintColor = self.tintColor; 2686 _currentCallout.tintColor = self.tintColor;
2674 } 2687 }
@@ -29,6 +29,7 @@ @@ -29,6 +29,7 @@
29 #import "RMPointAnnotation.h" 29 #import "RMPointAnnotation.h"
30 30
31 #import "RMMarker.h" 31 #import "RMMarker.h"
  32 +#import "RMMapView.h"
32 33
33 @implementation RMPointAnnotation 34 @implementation RMPointAnnotation
34 35
@@ -44,7 +45,7 @@ @@ -44,7 +45,7 @@
44 { 45 {
45 if ( ! [super layer]) 46 if ( ! [super layer])
46 { 47 {
47 - RMMarker *marker = [[RMMarker alloc] initWithMapBoxMarkerImage]; 48 + RMMarker *marker = [[RMMarker alloc] initWithMapBoxMarkerImage:nil tintColor:(RMPostVersion7 ? self.mapView.tintColor : nil)];
48 49
49 marker.canShowCallout = YES; 50 marker.canShowCallout = YES;
50 51