///定位图标名称,需要将该图片放到 mapapi.bundle/images 目录下
@property (nonatomic, strong) NSString* locationViewImgName;
- BMKLocationViewDisplayParam* testParam = [[BMKLocationViewDisplayParam alloc] init];
- testParam.isRotateAngleValid = true;// 跟随态旋转角度是否生效 testParam.isAccuracyCircleShow = true;// 精度圈是否显示 testParam.locationViewImgName = @"icon_compass";// 定位图标名称 testParam.locationViewOffsetX = 0;//定位图标偏移量(经度) testParam.locationViewOffsetY = 0;// 定位图标偏移量(纬度)
- [_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;
}