Authored by Justin R. Miller

user location updates for latest iOS 7 beta look

... ... @@ -2484,14 +2484,13 @@
// update user halo
//
UIImage *haloImage = [self tintedTrackingDotHaloImage];
UIImage *haloImage = [self trackingDotHaloImage];
_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];
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.1];
}
#pragma mark -
... ... @@ -3187,7 +3186,7 @@
self.userLocation.layer.hidden = YES;
_userHaloTrackingView = [[UIImageView alloc] initWithImage:[self tintedTrackingDotHaloImage]];
_userHaloTrackingView = [[UIImageView alloc] initWithImage:[self trackingDotHaloImage]];
_userHaloTrackingView.center = CGPointMake(round([self bounds].size.width / 2),
round([self bounds].size.height / 2));
... ... @@ -3318,8 +3317,8 @@
_accuracyCircleAnnotation.layer.zPosition = -MAXFLOAT;
_accuracyCircleAnnotation.isUserLocationAnnotation = YES;
((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = self.tintColor;
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.15];
((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = (RMPreVersion7 ? [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.7] : [UIColor clearColor]);
((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = (RMPreVersion7 ? [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.15] : [self.tintColor colorWithAlphaComponent:0.1]);
((RMCircle *)_accuracyCircleAnnotation.layer).lineWidthInPixels = 2.0;
... ... @@ -3365,13 +3364,22 @@
// create image marker
//
_trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[self tintedTrackingDotHaloImage]];
_trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[self trackingDotHaloImage]];
_trackingHaloAnnotation.layer.zPosition = -MAXFLOAT + 1;
_trackingHaloAnnotation.isUserLocationAnnotation = YES;
[CATransaction begin];
[CATransaction setAnimationDuration:2.5];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
if (RMPreVersion7)
{
[CATransaction setAnimationDuration:2.5];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
}
else
{
[CATransaction setAnimationDuration:3.5];
[CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
}
// scale out radially
//
... ... @@ -3546,58 +3554,24 @@
self.userTrackingMode = RMUserTrackingModeFollow;
}
- (UIImage *)tintedTrackingDotHaloImage
- (UIImage *)trackingDotHaloImage
{
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();
if (RMPreVersion7)
{
return [RMMapView resourceImageNamed:@"TrackingDotHalo.png"];
}
else
{
UIGraphicsBeginImageContextWithOptions(CGSizeMake(100, 100), NO, [[UIScreen mainScreen] scale]);
CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), [[self.tintColor colorWithAlphaComponent:0.75] CGColor]);
CGContextFillEllipseInRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, 100, 100));
UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return finalImage;
return finalImage;
}
}
#pragma mark -
#pragma mark Attribution
... ...

9.07 KB | W: | H:

11.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

31.4 KB | W: | H:

26.4 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -114,7 +114,6 @@
DD5FA1EC15E2B020004EB6C5 /* RMLoadingTileView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD5FA1EA15E2B020004EB6C5 /* RMLoadingTileView.m */; };
DD7C7E38164C894F0021CCA5 /* RMStaticMapView.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */; settings = {ATTRIBUTES = (Public, ); }; };
DD7C7E39164C894F0021CCA5 /* RMStaticMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */; };
DD7ED619179DC1780022E1E1 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD7ED618179DC1780022E1E1 /* CoreImage.framework */; };
DD8CDB4A14E0507100B73EB9 /* RMMapQuestOSMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
DD8CDB4B14E0507100B73EB9 /* RMMapQuestOSMSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */; };
DD8FD7541559E4A40044D96F /* RMUserLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8FD7521559E4A40044D96F /* RMUserLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
... ... @@ -287,7 +286,6 @@
DD6A83751644A20C0097F31F /* MapBox.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MapBox.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMStaticMapView.h; sourceTree = "<group>"; };
DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMStaticMapView.m; sourceTree = "<group>"; };
DD7ED618179DC1780022E1E1 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; };
DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapQuestOSMSource.h; sourceTree = "<group>"; };
DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMMapQuestOSMSource.m; sourceTree = "<group>"; };
DD8FD7521559E4A40044D96F /* RMUserLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMUserLocation.h; sourceTree = "<group>"; };
... ... @@ -345,7 +343,6 @@
files = (
B8C974500E8A19B2007D16AD /* CoreFoundation.framework in Frameworks */,
B8C974510E8A19B2007D16AD /* CoreGraphics.framework in Frameworks */,
DD7ED619179DC1780022E1E1 /* CoreImage.framework in Frameworks */,
B8C974520E8A19B2007D16AD /* CoreLocation.framework in Frameworks */,
B8C974530E8A19B2007D16AD /* UIKit.framework in Frameworks */,
B8C974540E8A19B2007D16AD /* QuartzCore.framework in Frameworks */,
... ... @@ -427,7 +424,6 @@
children = (
B83E65590E80E7EB001663B6 /* CoreFoundation.framework */,
288765A40DF7441C002DB57D /* CoreGraphics.framework */,
DD7ED618179DC1780022E1E1 /* CoreImage.framework */,
B83E65630E80E81C001663B6 /* CoreLocation.framework */,
1D30AB110D05D00D00671497 /* Foundation.framework */,
B83E65680E80E830001663B6 /* QuartzCore.framework */,
... ...