|
@@ -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];
|
3373
|
- [CATransaction setAnimationDuration:2.5];
|
|
|
3374
|
- [CATransaction setAnimationTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
|
3372
|
+
|
|
|
3373
|
+ if (RMPreVersion7)
|
|
|
3374
|
+ {
|
|
|
3375
|
+ [CATransaction setAnimationDuration:2.5];
|
|
|
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
|
-
|
|
|
3593
|
- UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
3594
|
-
|
|
|
3595
|
- UIGraphicsEndImageContext();
|
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));
|
|
|
3568
|
+ UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext();
|
|
|
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
|
|