...
|
...
|
@@ -98,6 +98,8 @@ |
|
|
@property (nonatomic, retain) CLHeading *heading;
|
|
|
@property (nonatomic, assign) BOOL hasCustomLayer;
|
|
|
|
|
|
- (void)updateTintColor;
|
|
|
|
|
|
@end
|
|
|
|
|
|
#pragma mark -
|
...
|
...
|
@@ -2474,6 +2476,24 @@ |
|
|
_showLogoBug = showLogoBug;
|
|
|
}
|
|
|
|
|
|
- (void)tintColorDidChange
|
|
|
{
|
|
|
// update user dot
|
|
|
//
|
|
|
[self.userLocation updateTintColor];
|
|
|
|
|
|
// update user halo
|
|
|
//
|
|
|
UIImage *haloImage = [self tintedTrackingDotHaloImage];
|
|
|
_userHaloTrackingView.image = haloImage;
|
|
|
[(RMMarker *)_trackingHaloAnnotation.layer replaceUIImage:haloImage];
|
|
|
|
|
|
// update accuracy circle
|
|
|
//
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = self.tintColor;
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.15];
|
|
|
}
|
|
|
|
|
|
#pragma mark -
|
|
|
#pragma mark LatLng/Pixel translation functions
|
|
|
|
...
|
...
|
@@ -3167,7 +3187,7 @@ |
|
|
|
|
|
self.userLocation.layer.hidden = YES;
|
|
|
|
|
|
_userHaloTrackingView = [[UIImageView alloc] initWithImage:[RMMapView resourceImageNamed:@"TrackingDotHalo.png"]];
|
|
|
_userHaloTrackingView = [[UIImageView alloc] initWithImage:[self tintedTrackingDotHaloImage]];
|
|
|
|
|
|
_userHaloTrackingView.center = CGPointMake(round([self bounds].size.width / 2),
|
|
|
round([self bounds].size.height / 2));
|
...
|
...
|
@@ -3298,8 +3318,8 @@ |
|
|
_accuracyCircleAnnotation.layer.zPosition = -MAXFLOAT;
|
|
|
_accuracyCircleAnnotation.isUserLocationAnnotation = YES;
|
|
|
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.7];
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.15];
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = self.tintColor;
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.15];
|
|
|
|
|
|
((RMCircle *)_accuracyCircleAnnotation.layer).lineWidthInPixels = 2.0;
|
|
|
|
...
|
...
|
@@ -3345,7 +3365,7 @@ |
|
|
|
|
|
// create image marker
|
|
|
//
|
|
|
_trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[RMMapView resourceImageNamed:@"TrackingDotHalo.png"]];
|
|
|
_trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[self tintedTrackingDotHaloImage]];
|
|
|
_trackingHaloAnnotation.layer.zPosition = -MAXFLOAT + 1;
|
|
|
_trackingHaloAnnotation.isUserLocationAnnotation = YES;
|
|
|
|
...
|
...
|
@@ -3526,6 +3546,58 @@ |
|
|
self.userTrackingMode = RMUserTrackingModeFollow;
|
|
|
}
|
|
|
|
|
|
- (UIImage *)tintedTrackingDotHaloImage
|
|
|
{
|
|
|
UIImage *templateImage = [RMMapView resourceImageNamed:@"TrackingDotHalo.png"];
|
|
|
|
|
|
CGRect rect = CGRectMake(0, 0, templateImage.size.width * templateImage.scale, templateImage.size.height * templateImage.scale);
|
|
|
|
|
|
CIContext *context = [CIContext contextWithOptions:nil];
|
|
|
CIImage *image = [CIImage imageWithCGImage:templateImage.CGImage];
|
|
|
CIImage *result = nil;
|
|
|
|
|
|
CIFilter *whitePointAdjust = [CIFilter filterWithName:@"CIWhitePointAdjust"];
|
|
|
CIFilter *maximumComponent = [CIFilter filterWithName:@"CIMaximumComponent"];
|
|
|
CIFilter *maskToAlpha = [CIFilter filterWithName:@"CIMaskToAlpha"];
|
|
|
|
|
|
[maskToAlpha setValue:image forKey:kCIInputImageKey];
|
|
|
result = [maskToAlpha valueForKey:kCIOutputImageKey];
|
|
|
|
|
|
[whitePointAdjust setValue:result forKey:kCIInputImageKey];
|
|
|
[whitePointAdjust setValue:[CIColor colorWithCGColor:self.tintColor.CGColor] forKey:kCIInputColorKey];
|
|
|
result = [whitePointAdjust valueForKey:kCIOutputImageKey];
|
|
|
|
|
|
CGImageRef haloImage = [context createCGImage:result fromRect:result.extent];
|
|
|
|
|
|
[whitePointAdjust setValue:image forKey:kCIInputImageKey];
|
|
|
[whitePointAdjust setValue:[CIColor colorWithRed:1 green:0 blue:0] forKey:kCIInputColorKey];
|
|
|
result = [whitePointAdjust valueForKey:kCIOutputImageKey];
|
|
|
|
|
|
[maximumComponent setValue:result forKey:kCIInputImageKey];
|
|
|
result = [maximumComponent valueForKey:kCIOutputImageKey];
|
|
|
|
|
|
[maskToAlpha setValue:result forKey:kCIInputImageKey];
|
|
|
result = [maskToAlpha valueForKey:kCIOutputImageKey];
|
|
|
|
|
|
CGImageRef ringImage = [context createCGImage:result fromRect:result.extent];
|
|
|
|
|
|
rect = CGRectMake(0, 0, rect.size.width / templateImage.scale, rect.size.height / templateImage.scale);
|
|
|
|
|
|
UIGraphicsBeginImageContextWithOptions(rect.size, NO, [[UIScreen mainScreen] scale]);
|
|
|
|
|
|
CGContextRef c = UIGraphicsGetCurrentContext();
|
|
|
|
|
|
CGContextDrawImage(c, rect, haloImage);
|
|
|
CGContextDrawImage(c, rect, ringImage);
|
|
|
|
|
|
UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
|
|
|
UIGraphicsEndImageContext();
|
|
|
|
|
|
return finalImage;
|
|
|
}
|
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
#pragma mark Attribution
|
|
|
|
...
|
...
|
|