百度地图SDK for iOS v3.4.4 类参考
构造函数 | 属性 | 所有成员列表
BMKAnnotationView类 参考

标注view 更多...

#import <BMKAnnotationView.h>

类 BMKAnnotationView 继承关系图:
BMKPinAnnotationView

构造函数

(id) - initWithAnnotation:reuseIdentifier:
 
(void) - prepareForReuse
 
(void) - setSelected:animated:
 
(BOOL draggable) - __OSX_AVAILABLE_STARTING
 当设为YES并实现了setCoordinate:方法时,支持将view在地图上拖动, ios 3.2以后支持
 
(BMKAnnotationViewDragState dragState) - __OSX_AVAILABLE_STARTING
 当前view的拖动状态, ios 3.2以后支持
 

属性

NSString * reuseIdentifier
 复用标志
 
BMKActionPaopaoViewpaopaoView
 paopaoView
 
id< BMKAnnotation > annotation
 关联的annotation
 
UIImage * image
 annotation view显示的图像
 
CGPoint centerOffset
 默认情况下, annotation view的中心位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
 
CGPoint calloutOffset
 默认情况下, 弹出的气泡位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
 
BOOL enabled3D
 默认情况下,标注没有3D效果,可以设置enabled3D改变使用3D效果,使得标注在地图旋转和俯视时跟随旋转、俯视
 
BOOL enabled
 默认为YES,当为NO时view忽略触摸事件
 
BOOL selected
 默认为NO,当view被点中时被设为YES,用户不要直接设置这个属性.若设置,需要在设置后调用BMKMapView的- (void)mapForceRefresh; 方法刷新地图
 
BOOL canShowCallout
 当为YES时,view被选中时会弹出气泡,annotation必须实现了title这个方法
 
UIView * leftCalloutAccessoryView
 显示在气泡左侧的view(使用默认气泡时,view的width最大值为32,height最大值为41,大于则使用最大值)
 
UIView * rightCalloutAccessoryView
 显示在气泡右侧的view(使用默认气泡时,view的width最大值为32,height最大值为41,大于则使用最大值)
 

详细描述

标注view

函数文档

◆ initWithAnnotation:reuseIdentifier:()

- (id) initWithAnnotation: (id< BMKAnnotation >)  annotation
reuseIdentifier: (NSString *)  reuseIdentifier 

初始化并返回一个annotation view

参数
annotation关联的annotation对象
reuseIdentifier如果要重用view,传入一个字符串,否则设为nil,建议重用view
返回
初始化成功则返回annotation view,否则返回nil

◆ prepareForReuse()

- (void) prepareForReuse

当view从reuse队列里取出时被调用 默认不做任何事

◆ setSelected:animated:()

- (void) setSelected: (BOOL)  selected
animated: (BOOL)  animated 

设定view的选中状态 该方法被BMKMapView调用

参数
selected如果view需要显示为选中状态,该值为YES
animated如果需要动画效果,该值为YES,暂不支持

该类的文档由以下文件生成: