如何更改用户位置注释的接近度
How to change proximity of user location annotation
如何更改 userLocation annotation
生成的邻近度。
我说的是 userLocation annotation
围绕它创建的褪色蓝色圆圈。我怎样才能改变它的半径?
看看:https://github.com/TransitApp/SVPulsingAnnotationView
从库中添加以下文件:
SVAnnotation.h
SVAnnotation.m
SVPulsingAnnotationView.h
SVPulsingAnnotationView.m
导入:
#import "SVAnnotation.h"
#import "SVPulsingAnnotationView.h"
使用 SVPulsingAnnotationView
你可以设置 pulseScaleFactor
属性 来改变半径,当你找到 UserLocation:
时在 viewForAnnotation
方法中使用下面的代码
static NSString *identifier = @"currentLocation";
SVPulsingAnnotationView *pulsingView = (SVPulsingAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if(pulsingView == nil) {
pulsingView = [[SVPulsingAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
pulsingView.annotationColor = [UIColor colorWithRed:0.678431 green:0 blue:0 alpha:1];
pulsingView.pulseScaleFactor=7.0;//Change pulseScaleFactor as required
pulsingView.canShowCallout = YES;
}
return pulsingView;
如何更改 userLocation annotation
生成的邻近度。
我说的是 userLocation annotation
围绕它创建的褪色蓝色圆圈。我怎样才能改变它的半径?
看看:https://github.com/TransitApp/SVPulsingAnnotationView
从库中添加以下文件:
SVAnnotation.h
SVAnnotation.m
SVPulsingAnnotationView.h
SVPulsingAnnotationView.m
导入:
#import "SVAnnotation.h"
#import "SVPulsingAnnotationView.h"
使用 SVPulsingAnnotationView
你可以设置 pulseScaleFactor
属性 来改变半径,当你找到 UserLocation:
viewForAnnotation
方法中使用下面的代码
static NSString *identifier = @"currentLocation";
SVPulsingAnnotationView *pulsingView = (SVPulsingAnnotationView *)[self.mapView dequeueReusableAnnotationViewWithIdentifier:identifier];
if(pulsingView == nil) {
pulsingView = [[SVPulsingAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier];
pulsingView.annotationColor = [UIColor colorWithRed:0.678431 green:0 blue:0 alpha:1];
pulsingView.pulseScaleFactor=7.0;//Change pulseScaleFactor as required
pulsingView.canShowCallout = YES;
}
return pulsingView;