Authored by Justin R. Miller

user location updates for latest iOS 7 beta look

@@ -2484,14 +2484,13 @@ @@ -2484,14 +2484,13 @@
2484 2484
2485 // update user halo 2485 // update user halo
2486 // 2486 //
2487 - UIImage *haloImage = [self tintedTrackingDotHaloImage]; 2487 + UIImage *haloImage = [self trackingDotHaloImage];
2488 _userHaloTrackingView.image = haloImage; 2488 _userHaloTrackingView.image = haloImage;
2489 [(RMMarker *)_trackingHaloAnnotation.layer replaceUIImage:haloImage]; 2489 [(RMMarker *)_trackingHaloAnnotation.layer replaceUIImage:haloImage];
2490 2490
2491 // update accuracy circle 2491 // update accuracy circle
2492 // 2492 //
2493 - ((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = self.tintColor;  
2494 - ((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.15]; 2493 + ((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.1];
2495 } 2494 }
2496 2495
2497 #pragma mark - 2496 #pragma mark -
@@ -3187,7 +3186,7 @@ @@ -3187,7 +3186,7 @@
3187 3186
3188 self.userLocation.layer.hidden = YES; 3187 self.userLocation.layer.hidden = YES;
3189 3188
3190 - _userHaloTrackingView = [[UIImageView alloc] initWithImage:[self tintedTrackingDotHaloImage]]; 3189 + _userHaloTrackingView = [[UIImageView alloc] initWithImage:[self trackingDotHaloImage]];
3191 3190
3192 _userHaloTrackingView.center = CGPointMake(round([self bounds].size.width / 2), 3191 _userHaloTrackingView.center = CGPointMake(round([self bounds].size.width / 2),
3193 round([self bounds].size.height / 2)); 3192 round([self bounds].size.height / 2));
@@ -3318,8 +3317,8 @@ @@ -3318,8 +3317,8 @@
3318 _accuracyCircleAnnotation.layer.zPosition = -MAXFLOAT; 3317 _accuracyCircleAnnotation.layer.zPosition = -MAXFLOAT;
3319 _accuracyCircleAnnotation.isUserLocationAnnotation = YES; 3318 _accuracyCircleAnnotation.isUserLocationAnnotation = YES;
3320 3319
3321 - ((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = self.tintColor;  
3322 - ((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = [self.tintColor colorWithAlphaComponent:0.15]; 3320 + ((RMCircle *)_accuracyCircleAnnotation.layer).lineColor = (RMPreVersion7 ? [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.7] : [UIColor clearColor]);
  3321 + ((RMCircle *)_accuracyCircleAnnotation.layer).fillColor = (RMPreVersion7 ? [UIColor colorWithRed:0.378 green:0.552 blue:0.827 alpha:0.15] : [self.tintColor colorWithAlphaComponent:0.1]);
3323 3322
3324 ((RMCircle *)_accuracyCircleAnnotation.layer).lineWidthInPixels = 2.0; 3323 ((RMCircle *)_accuracyCircleAnnotation.layer).lineWidthInPixels = 2.0;
3325 3324
@@ -3365,13 +3364,22 @@ @@ -3365,13 +3364,22 @@
3365 3364
3366 // create image marker 3365 // create image marker
3367 // 3366 //
3368 - _trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[self tintedTrackingDotHaloImage]]; 3367 + _trackingHaloAnnotation.layer = [[RMMarker alloc] initWithUIImage:[self trackingDotHaloImage]];
3369 _trackingHaloAnnotation.layer.zPosition = -MAXFLOAT + 1; 3368 _trackingHaloAnnotation.layer.zPosition = -MAXFLOAT + 1;
3370 _trackingHaloAnnotation.isUserLocationAnnotation = YES; 3369 _trackingHaloAnnotation.isUserLocationAnnotation = YES;
3371 3370
3372 [CATransaction begin]; 3371 [CATransaction begin];
  3372 +
  3373 + if (RMPreVersion7)
  3374 + {
3373 [CATransaction setAnimationDuration:2.5]; 3375 [CATransaction setAnimationDuration:2.5];
3374 [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 3376 [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
  3377 + }
  3378 + else
  3379 + {
  3380 + [CATransaction setAnimationDuration:3.5];
  3381 + [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
  3382 + }
3375 3383
3376 // scale out radially 3384 // scale out radially
3377 // 3385 //
@@ -3546,58 +3554,24 @@ @@ -3546,58 +3554,24 @@
3546 self.userTrackingMode = RMUserTrackingModeFollow; 3554 self.userTrackingMode = RMUserTrackingModeFollow;
3547 } 3555 }
3548 3556
3549 -- (UIImage *)tintedTrackingDotHaloImage 3557 +- (UIImage *)trackingDotHaloImage
3550 { 3558 {
3551 - UIImage *templateImage = [RMMapView resourceImageNamed:@"TrackingDotHalo.png"];  
3552 -  
3553 - CGRect rect = CGRectMake(0, 0, templateImage.size.width * templateImage.scale, templateImage.size.height * templateImage.scale);  
3554 -  
3555 - CIContext *context = [CIContext contextWithOptions:nil];  
3556 - CIImage *image = [CIImage imageWithCGImage:templateImage.CGImage];  
3557 - CIImage *result = nil;  
3558 -  
3559 - CIFilter *whitePointAdjust = [CIFilter filterWithName:@"CIWhitePointAdjust"];  
3560 - CIFilter *maximumComponent = [CIFilter filterWithName:@"CIMaximumComponent"];  
3561 - CIFilter *maskToAlpha = [CIFilter filterWithName:@"CIMaskToAlpha"];  
3562 -  
3563 - [maskToAlpha setValue:image forKey:kCIInputImageKey];  
3564 - result = [maskToAlpha valueForKey:kCIOutputImageKey];  
3565 -  
3566 - [whitePointAdjust setValue:result forKey:kCIInputImageKey];  
3567 - [whitePointAdjust setValue:[CIColor colorWithCGColor:self.tintColor.CGColor] forKey:kCIInputColorKey];  
3568 - result = [whitePointAdjust valueForKey:kCIOutputImageKey];  
3569 -  
3570 - CGImageRef haloImage = [context createCGImage:result fromRect:result.extent];  
3571 -  
3572 - [whitePointAdjust setValue:image forKey:kCIInputImageKey];  
3573 - [whitePointAdjust setValue:[CIColor colorWithRed:1 green:0 blue:0] forKey:kCIInputColorKey];  
3574 - result = [whitePointAdjust valueForKey:kCIOutputImageKey];  
3575 -  
3576 - [maximumComponent setValue:result forKey:kCIInputImageKey];  
3577 - result = [maximumComponent valueForKey:kCIOutputImageKey];  
3578 -  
3579 - [maskToAlpha setValue:result forKey:kCIInputImageKey];  
3580 - result = [maskToAlpha valueForKey:kCIOutputImageKey];  
3581 -  
3582 - CGImageRef ringImage = [context createCGImage:result fromRect:result.extent];  
3583 -  
3584 - rect = CGRectMake(0, 0, rect.size.width / templateImage.scale, rect.size.height / templateImage.scale);  
3585 -  
3586 - UIGraphicsBeginImageContextWithOptions(rect.size, NO, [[UIScreen mainScreen] scale]);  
3587 -  
3588 - CGContextRef c = UIGraphicsGetCurrentContext();  
3589 -  
3590 - CGContextDrawImage(c, rect, haloImage);  
3591 - CGContextDrawImage(c, rect, ringImage);  
3592 - 3559 + if (RMPreVersion7)
  3560 + {
  3561 + return [RMMapView resourceImageNamed:@"TrackingDotHalo.png"];
  3562 + }
  3563 + else
  3564 + {
  3565 + UIGraphicsBeginImageContextWithOptions(CGSizeMake(100, 100), NO, [[UIScreen mainScreen] scale]);
  3566 + CGContextSetFillColorWithColor(UIGraphicsGetCurrentContext(), [[self.tintColor colorWithAlphaComponent:0.75] CGColor]);
  3567 + CGContextFillEllipseInRect(UIGraphicsGetCurrentContext(), CGRectMake(0, 0, 100, 100));
3593 UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext(); 3568 UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
3594 -  
3595 UIGraphicsEndImageContext(); 3569 UIGraphicsEndImageContext();
3596 3570
3597 return finalImage; 3571 return finalImage;
  3572 + }
3598 } 3573 }
3599 3574
3600 -  
3601 #pragma mark - 3575 #pragma mark -
3602 #pragma mark Attribution 3576 #pragma mark Attribution
3603 3577

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 @@ @@ -114,7 +114,6 @@
114 DD5FA1EC15E2B020004EB6C5 /* RMLoadingTileView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD5FA1EA15E2B020004EB6C5 /* RMLoadingTileView.m */; }; 114 DD5FA1EC15E2B020004EB6C5 /* RMLoadingTileView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD5FA1EA15E2B020004EB6C5 /* RMLoadingTileView.m */; };
115 DD7C7E38164C894F0021CCA5 /* RMStaticMapView.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */; settings = {ATTRIBUTES = (Public, ); }; }; 115 DD7C7E38164C894F0021CCA5 /* RMStaticMapView.h in Headers */ = {isa = PBXBuildFile; fileRef = DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */; settings = {ATTRIBUTES = (Public, ); }; };
116 DD7C7E39164C894F0021CCA5 /* RMStaticMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */; }; 116 DD7C7E39164C894F0021CCA5 /* RMStaticMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */; };
117 - DD7ED619179DC1780022E1E1 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD7ED618179DC1780022E1E1 /* CoreImage.framework */; };  
118 DD8CDB4A14E0507100B73EB9 /* RMMapQuestOSMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */; settings = {ATTRIBUTES = (Private, ); }; }; 117 DD8CDB4A14E0507100B73EB9 /* RMMapQuestOSMSource.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */; settings = {ATTRIBUTES = (Private, ); }; };
119 DD8CDB4B14E0507100B73EB9 /* RMMapQuestOSMSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */; }; 118 DD8CDB4B14E0507100B73EB9 /* RMMapQuestOSMSource.m in Sources */ = {isa = PBXBuildFile; fileRef = DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */; };
120 DD8FD7541559E4A40044D96F /* RMUserLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8FD7521559E4A40044D96F /* RMUserLocation.h */; settings = {ATTRIBUTES = (Public, ); }; }; 119 DD8FD7541559E4A40044D96F /* RMUserLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = DD8FD7521559E4A40044D96F /* RMUserLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -287,7 +286,6 @@ @@ -287,7 +286,6 @@
287 DD6A83751644A20C0097F31F /* MapBox.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MapBox.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 286 DD6A83751644A20C0097F31F /* MapBox.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = MapBox.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
288 DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMStaticMapView.h; sourceTree = "<group>"; }; 287 DD7C7E36164C894F0021CCA5 /* RMStaticMapView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMStaticMapView.h; sourceTree = "<group>"; };
289 DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMStaticMapView.m; sourceTree = "<group>"; }; 288 DD7C7E37164C894F0021CCA5 /* RMStaticMapView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMStaticMapView.m; sourceTree = "<group>"; };
290 - DD7ED618179DC1780022E1E1 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; };  
291 DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapQuestOSMSource.h; sourceTree = "<group>"; }; 289 DD8CDB4814E0507100B73EB9 /* RMMapQuestOSMSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMMapQuestOSMSource.h; sourceTree = "<group>"; };
292 DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMMapQuestOSMSource.m; sourceTree = "<group>"; }; 290 DD8CDB4914E0507100B73EB9 /* RMMapQuestOSMSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RMMapQuestOSMSource.m; sourceTree = "<group>"; };
293 DD8FD7521559E4A40044D96F /* RMUserLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMUserLocation.h; sourceTree = "<group>"; }; 291 DD8FD7521559E4A40044D96F /* RMUserLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RMUserLocation.h; sourceTree = "<group>"; };
@@ -345,7 +343,6 @@ @@ -345,7 +343,6 @@
345 files = ( 343 files = (
346 B8C974500E8A19B2007D16AD /* CoreFoundation.framework in Frameworks */, 344 B8C974500E8A19B2007D16AD /* CoreFoundation.framework in Frameworks */,
347 B8C974510E8A19B2007D16AD /* CoreGraphics.framework in Frameworks */, 345 B8C974510E8A19B2007D16AD /* CoreGraphics.framework in Frameworks */,
348 - DD7ED619179DC1780022E1E1 /* CoreImage.framework in Frameworks */,  
349 B8C974520E8A19B2007D16AD /* CoreLocation.framework in Frameworks */, 346 B8C974520E8A19B2007D16AD /* CoreLocation.framework in Frameworks */,
350 B8C974530E8A19B2007D16AD /* UIKit.framework in Frameworks */, 347 B8C974530E8A19B2007D16AD /* UIKit.framework in Frameworks */,
351 B8C974540E8A19B2007D16AD /* QuartzCore.framework in Frameworks */, 348 B8C974540E8A19B2007D16AD /* QuartzCore.framework in Frameworks */,
@@ -427,7 +424,6 @@ @@ -427,7 +424,6 @@
427 children = ( 424 children = (
428 B83E65590E80E7EB001663B6 /* CoreFoundation.framework */, 425 B83E65590E80E7EB001663B6 /* CoreFoundation.framework */,
429 288765A40DF7441C002DB57D /* CoreGraphics.framework */, 426 288765A40DF7441C002DB57D /* CoreGraphics.framework */,
430 - DD7ED618179DC1780022E1E1 /* CoreImage.framework */,  
431 B83E65630E80E81C001663B6 /* CoreLocation.framework */, 427 B83E65630E80E81C001663B6 /* CoreLocation.framework */,
432 1D30AB110D05D00D00671497 /* Foundation.framework */, 428 1D30AB110D05D00D00671497 /* Foundation.framework */,
433 B83E65680E80E830001663B6 /* QuartzCore.framework */, 429 B83E65680E80E830001663B6 /* QuartzCore.framework */,