iOS高德地图SDK(3D)  V7.5.0
MAMapView(Annotation) Category Reference

#import <MAMapView.h>

Instance Methods

(BOOL allowsAnnotationViewSorting) - __attribute
 是否允许对annotationView根据zIndex进行排序,默认为NO 注意:如果设置为YES,慎重重载MAAnnoationView的willMoveToSuperview:,内部排序时会调用removeFromSuperView. 注:从5.3.0版本开启此属性废弃,如果添加的annotationView有zIndex不为0的,则自动开启为YES,否则为NO。删除所有annotation后会重置。zIndex属性只有在viewForAnnotation或者didAddAnnotationViews回调中设置有效。 More...
 
(void) - addAnnotation:
 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View More...
 
(void) - addAnnotations:
 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View More...
 
(void) - removeAnnotation:
 移除标注 More...
 
(void) - removeAnnotations:
 移除一组标注 More...
 
(NSSet *) - annotationsInMapRect:
 获取指定投影矩形范围内的标注 More...
 
(MAAnnotationView *) - viewForAnnotation:
 根据标注数据获取标注view More...
 
(MAAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 从复用内存池中获取制定复用标识的annotation view More...
 
(void) - selectAnnotation:animated:
 选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。 More...
 
(void) - deselectAnnotation:animated:
 取消选中标注数据对应的view More...
 
(void) - showAnnotations:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 More...
 
(void) - showAnnotations:edgePadding:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 More...
 

Properties

NSArray * annotations
 所有添加的标注, 注意从5.3.0开始返回数组内不再包含定位蓝点userLocation More...
 
NSArray * selectedAnnotations
 处于选中状态的标注数据数据(其count == 0 或 1) More...
 
CGRect annotationVisibleRect
 annotation 可见区域 More...
 

Method Documentation

◆ __attribute()

- (BOOL allowsAnnotationViewSorting) __attribute ((deprecated("已废弃 since 5.3.0"))) 

是否允许对annotationView根据zIndex进行排序,默认为NO 注意:如果设置为YES,慎重重载MAAnnoationView的willMoveToSuperview:,内部排序时会调用removeFromSuperView. 注:从5.3.0版本开启此属性废弃,如果添加的annotationView有zIndex不为0的,则自动开启为YES,否则为NO。删除所有annotation后会重置。zIndex属性只有在viewForAnnotation或者didAddAnnotationViews回调中设置有效。

Extends class MAMapView.

◆ addAnnotation:()

- (void) addAnnotation: (id< MAAnnotation >)  annotation

向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View

Parameters
annotation要添加的标注

Extends class MAMapView.

◆ addAnnotations:()

- (void) addAnnotations: (NSArray *)  annotations

向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View

Parameters
annotations要添加的标注数组

Extends class MAMapView.

◆ annotationsInMapRect:()

- (NSSet *) annotationsInMapRect: (MAMapRect mapRect

获取指定投影矩形范围内的标注

Parameters
mapRect投影矩形范围
Returns
标注集合

Extends class MAMapView.

◆ dequeueReusableAnnotationViewWithIdentifier:()

- (MAAnnotationView *) dequeueReusableAnnotationViewWithIdentifier: (NSString *)  identifier

从复用内存池中获取制定复用标识的annotation view

Parameters
identifier复用标识
Returns
annotation view

Extends class MAMapView.

◆ deselectAnnotation:animated:()

- (void) deselectAnnotation: (id< MAAnnotation >)  annotation
animated: (BOOL)  animated 

取消选中标注数据对应的view

Parameters
annotation标注数据
animated是否有动画效果

Extends class MAMapView.

◆ removeAnnotation:()

- (void) removeAnnotation: (id< MAAnnotation >)  annotation

移除标注

Parameters
annotation要移除的标注

Extends class MAMapView.

◆ removeAnnotations:()

- (void) removeAnnotations: (NSArray *)  annotations

移除一组标注

Parameters
annotations要移除的标注数组

Extends class MAMapView.

◆ selectAnnotation:animated:()

- (void) selectAnnotation: (id< MAAnnotation >)  annotation
animated: (BOOL)  animated 

选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。

Parameters
annotation标注数据
animated是否有动画效果

Extends class MAMapView.

◆ showAnnotations:animated:()

- (void) showAnnotations: (NSArray *)  annotations
animated: (BOOL)  animated 

设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。

Parameters
annotations需要显示的annotation
animated是否执行动画

Extends class MAMapView.

◆ showAnnotations:edgePadding:animated:()

- (void) showAnnotations: (NSArray *)  annotations
edgePadding: (UIEdgeInsets)  insets
animated: (BOOL)  animated 

设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。

Parameters
annotations需要显示的annotation
insetsinsets 嵌入边界
animated是否执行动画

Extends class MAMapView.

◆ viewForAnnotation:()

- (MAAnnotationView *) viewForAnnotation: (id< MAAnnotation >)  annotation

根据标注数据获取标注view

Parameters
annotation标注数据
Returns
对应的标注view

Extends class MAMapView.

Property Documentation

◆ annotations

- (NSArray*) annotations
readnonatomicassign

所有添加的标注, 注意从5.3.0开始返回数组内不再包含定位蓝点userLocation

Extends class MAMapView.

◆ annotationVisibleRect

- (CGRect) annotationVisibleRect
readnonatomicassign

annotation 可见区域

Extends class MAMapView.

◆ selectedAnnotations

- (NSArray*) selectedAnnotations
readwritenonatomiccopy

处于选中状态的标注数据数据(其count == 0 或 1)

Extends class MAMapView.


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