iOS中设置百度地图自定义标注图片,自定义泡泡
来源:互联网 发布:怎样安装税控盘软件 编辑:程序博客网 时间:2024/05/02 00:54
#pragma mark - BMKMapViewDelegate// 根据anntation生成对应的View- (BMKAnnotationView *)mapView:(BMKMapView *)mapView viewForAnnotation:(id <BMKAnnotation>)annotation{ //普通annotation NSString *AnnotationViewID = @"ClusterMark"; ClusterAnnotation *cluster = (ClusterAnnotation*)annotation; ClusterAnnotationView *annotationView = [[ClusterAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:AnnotationViewID]; annotationView.size = cluster.size; annotationView.canShowCallout = NO;//在点击大头针的时候会弹出那个黑框框 annotationView.draggable = NO;//禁止标注在地图上拖动 annotationView.annotation = cluster;// annotationView.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:annotation.subtitle]]]; annotationView.centerOffset=CGPointMake(0,0); UIView *viewForImage=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 110, 110)]; UIImageView *imageview=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 110, 110)]; [imageview setImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:annotation.subtitle]]]]; imageview.layer.masksToBounds=YES; imageview.layer.cornerRadius = 10; [viewForImage addSubview:imageview]; annotationView.image=[self getImageFromView:viewForImage]; return annotationView;}-(UIImage *)getImageFromView:(UIView *)view{ UIGraphicsBeginImageContext(view.bounds.size); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return image;}//气泡框左侧显示的View,可自定义annotationView.leftCalloutAccessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_location.png"]];//气泡框右侧显示的View 可自定义annotationView.rightCalloutAccessoryView =selectButton;//让标注在进入界面时就处于弹出气泡框的状态[annotationView setSelected:YES animated:YES];
0 0
- iOS中设置百度地图自定义标注图片,自定义泡泡
- 百度地图自定义泡泡视图
- iOS 自定义百度地图标注气泡
- iOS-百度地图添加标注自定义气泡
- 百度地图IOS平台开发--自定义大头钉以及泡泡
- ios 地图 自定义标注
- 百度地图自定义标注标记
- iOS百度地图比例,及自定义popview图片偏移设置
- 百度地图自定义大头针图片和添加标注
- 百度地图API,自定义地图标注
- 百度地图API,自定义地图标注
- 百度地图API 自定义标注图标
- 百度地图上自定义添加一个标注
- 百度地图自定义标注物+自动定位
- 百度地图使用 自定义标注的图标
- 百度地图使用 自定义标注的图标
- iOS百度地图自定义
- 百度地图不点击自动弹出泡泡(paopao)【自定义】
- leetcode 25. Reverse Nodes in k-Group
- iOS —— 数据解析Null处理
- Intersection of Two Linked Lists
- MD5加盐算法(JAVA)
- Unity中网格合并示例研究。针对合并子网格列表后再合并网格
- iOS中设置百度地图自定义标注图片,自定义泡泡
- 2016年度最受欢迎的100个 Java 库
- 柴俊理金:耶伦暗示加息谨慎,原油小涨黄金承压
- hihocoder 1079离散化 java实现
- 界面延迟刷新
- Django1.96使用mysql数据库
- 多线程编程题
- Java 中 int与Integer的区别
- plupload