iOS高德地图SDK(3D) V10.0.600
Loading...
Searching...
No Matches
MAAnnotationView Class Reference

标注view More...

#import <MAAnnotationView.h>

Inheritance diagram for MAAnnotationView:
MAPinAnnotationView

Instance Methods

(void) - setSelected:animated:
 设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法
 
(id) - initWithAnnotation:reuseIdentifier:
 初始化并返回一个annotation view
 
(void) - prepareForReuse
 当从reuse队列里取出时被调用, 子类重新必须调用super
 
(void) - setDragState:animated:
 设置view的拖动状态
 

Properties

NSString * reuseIdentifier
 复用标识
 
NSInteger zIndex
 z值,大值在上,默认为0。类似CALayer的zPosition。zIndex属性只有在viewForAnnotation或者didAddAnnotationViews回调中设置有效。
 
id< MAAnnotationannotation
 关联的annotation
 
UIImage * image
 显示的image
 
UIImageView * imageView
 image所对应的UIImageView since 5.0.0
 
MACustomCalloutViewcustomCalloutView
 自定制弹出框view, 用于替换默认弹出框. 注意:此弹出框不会触发-(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0
 
CGPoint centerOffset
 annotationView的中心默认位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标
 
CGPoint calloutOffset
 弹出框默认位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标
 
BOOL enabled
 默认为YES,当为NO时view忽略触摸事件
 
BOOL highlighted
 是否高亮
 
BOOL selected
 设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法
 
BOOL canShowCallout
 是否允许弹出callout
 
UIView * leftCalloutAccessoryView
 显示在默认弹出框左侧的view
 
UIView * rightCalloutAccessoryView
 显示在默认弹出框右侧的view
 
BOOL draggable
 是否支持拖动
 
MAAnnotationViewDragState dragState
 当前view的拖动状态
 
BOOL canAdjustPositon
 弹出默认弹出框时,是否允许地图调整到合适位置来显示弹出框,默认为YES
 

Detailed Description

标注view

Method Documentation

◆ initWithAnnotation:reuseIdentifier:

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

初始化并返回一个annotation view

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

◆ prepareForReuse

- (void) prepareForReuse

当从reuse队列里取出时被调用, 子类重新必须调用super

◆ setDragState:animated:

- (void) setDragState: (MAAnnotationViewDragState newDragState
animated: (BOOL)  animated 

设置view的拖动状态

Parameters
newDragState新的拖动状态
animated是否使用动画动画

◆ setSelected:animated:

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

设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法

Parameters
selected是否选中
animated是否使用动画效果

Property Documentation

◆ annotation

- (id<MAAnnotation>) annotation
readwritenonatomicstrong

关联的annotation

◆ calloutOffset

- (CGPoint) calloutOffset
readwritenonatomicassign

弹出框默认位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标

◆ canAdjustPositon

- (BOOL) canAdjustPositon
readwritenonatomicassign

弹出默认弹出框时,是否允许地图调整到合适位置来显示弹出框,默认为YES

◆ canShowCallout

- (BOOL) canShowCallout
readwritenonatomicassign

是否允许弹出callout

◆ centerOffset

- (CGPoint) centerOffset
readwritenonatomicassign

annotationView的中心默认位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是屏幕坐标

◆ customCalloutView

- (MACustomCalloutView*) customCalloutView
readwritenonatomicstrong

自定制弹出框view, 用于替换默认弹出框. 注意:此弹出框不会触发-(void)mapView: didAnnotationViewCalloutTapped: since 5.0.0

◆ draggable

- (BOOL) draggable
readwritenonatomicassign

是否支持拖动

◆ dragState

- (MAAnnotationViewDragState) dragState
readwritenonatomicassign

当前view的拖动状态

◆ enabled

- (BOOL) enabled
readwritenonatomicassign

默认为YES,当为NO时view忽略触摸事件

◆ highlighted

- (BOOL) highlighted
readwritenonatomicassign

是否高亮

◆ image

- (UIImage*) image
readwritenonatomicstrong

显示的image

◆ imageView

- (UIImageView*) imageView
readnonatomicstrong

image所对应的UIImageView since 5.0.0

◆ leftCalloutAccessoryView

- (UIView*) leftCalloutAccessoryView
readwritenonatomicstrong

显示在默认弹出框左侧的view

◆ reuseIdentifier

- (NSString*) reuseIdentifier
readnonatomiccopy

复用标识

◆ rightCalloutAccessoryView

- (UIView*) rightCalloutAccessoryView
readwritenonatomicstrong

显示在默认弹出框右侧的view

◆ selected

- (BOOL) selected
readwritenonatomicassign

设置是否处于选中状态, 外部如果要选中请使用mapView的selectAnnotation方法

◆ zIndex

- (NSInteger) zIndex
readwritenonatomicassign

z值,大值在上,默认为0。类似CALayer的zPosition。zIndex属性只有在viewForAnnotation或者didAddAnnotationViews回调中设置有效。


The documentation for this class was generated from the following file:
© 2017 高德信息技术有限公司 版权所有,保留所有权利。