iOS 百度地图改变popview 及改变定位图标

///定位图标名称,需要将该图片放到 mapapi.bundle/images 目录下

@property (nonatomic, strong) NSString* locationViewImgName;


  1. BMKLocationViewDisplayParam* testParam = [[BMKLocationViewDisplayParam alloc] init];
  2. testParam.isRotateAngleValid = true;// 跟随态旋转角度是否生效 testParam.isAccuracyCircleShow = true;// 精度圈是否显示 testParam.locationViewImgName = @"icon_compass";// 定位图标名称 testParam.locationViewOffsetX = 0;//定位图标偏移量(经度) testParam.locationViewOffsetY = 0;// 定位图标偏移量(纬度)
  3. [_mapView updateLocationViewWithParam:testParam]; //调用此方法后自定义定位图层生效 [testParam release];


popview的改变

- (BMKAnnotationView *)mapView:(BMKMapView *)view viewForAnnotation:(id <BMKAnnotation>)annotation

{

    NSString *AnnotationViewID = @"renameMark";

    BMKPinAnnotationView *annotationView = (BMKPinAnnotationView *)[_mapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID];

    if (annotationView == nil) {

        annotationView = [[BMKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID];

        // 设置颜色

        annotationView.pinColor = BMKPinAnnotationColorPurple;

        // 从天上掉下效果

        annotationView.animatesDrop = NO;

        // 设置可拖拽

        annotationView.draggable = YES;

        UIImageView *imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];

        imageV.backgroundColor = [UIColor redColor];

        BMKActionPaopaoView* paopao = [[BMKActionPaopaoView alloc] initWithCustomView:imageV];

        annotationView.paopaoView = paopao;

}

    annotationView.centerOffset = CGPointMake(0, -(annotationView.frame.size.height *     0.5));

    annotationView.annotation = annotation;

    annotationView.canShowCallout = TRUE;

        

    //}

    return annotationView;


}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值