地图位置点的圆圈放大效果是怎样弄上去的?

iOS 码拜 9年前 (2015-05-06) 1785次浏览 0个评论
 
- (MKAnnotationView *)mapView:(MKMapView *)aMapView viewForAnnotation:(id <MKAnnotation>)annotation
{
    if(![annotation isKindOfClass:[MyAnnotation class]]) // Don""t mess user location
        return nil;

    MKAnnotationView *annotationView = [aMapView dequeueReusableAnnotationViewWithIdentifier:@"spot"];
    if(!annotationView)
    {
        annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"spot"];
        annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
        [(UIButton *)annotationView.rightCalloutAccessoryView addTarget:self action:@selector(openSpot:) forControlEvents:UIControlEventTouchUpInside];
        annotationView.enabled = YES;
        annotationView.canShowCallout = YES;
        annotationView.centerOffset = CGPointMake(7,-15);
        annotationView.calloutOffset = CGPointMake(-8,0);
    }

    // Setup annotation view
    annotationView.image = [UIImage imageNamed:@"pinYellow.png"]; // Or whatever

    return annotationView;
}

20分
http://www.cocoachina.com/bbs/read.php?tid-30567-keyword-%B7%C5%B4%F3%BE%B5.html
取坐标区域,放大这个区域,放在一个View上显示在最上层。OK了
不是放大镜。一个蓝色的位置点。一个圆圈的样子
10分
楼主想说地图上有一个蓝点,有淡蓝色光圈的那个效果吗?如果是那个的话,可以在ib中将你的mkmapview控件中的shows user location勾选,或者在你定义的mkmapview对象中:你的地图对象.showsUserLocation = YES;
5分
楼上正解 地图对象.showsUserLocation = YES;
showsUserLocation = YES;没效果。已经add Annotation
5分
虚拟机好像默认是显示在欧洲还是美国的某个地方,不过真机可以显示你当前的位置

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明地图位置点的圆圈放大效果是怎样弄上去的?
喜欢 (0)
[1034331897@qq.com]
分享 (0)

文章评论已关闭!