iOS高德地图SDK(3D) V10.0.600
Loading...
Searching...
No Matches
MAMapView(Annotation) Category Reference

#import <MAMapView.h>

Instance Methods

(void) - addAnnotation:
 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
 
(void) - addAnnotations:
 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
 
(void) - removeAnnotation:
 移除标注
 
(void) - removeAnnotations:
 移除一组标注
 
(NSSet *) - annotationsInMapRect:
 获取指定投影矩形范围内的标注
 
(MAAnnotationView *) - viewForAnnotation:
 根据标注数据获取标注view
 
(MAAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 从复用内存池中获取制定复用标识的annotation view
 
(void) - selectAnnotation:animated:
 选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。
 
(void) - deselectAnnotation:animated:
 取消选中标注数据对应的view
 
(void) - showAnnotations:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
 
(void) - showAnnotations:edgePadding:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
 

Properties

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

Method Documentation

◆ addAnnotation:

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

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

Parameters
annotation要添加的标注

◆ addAnnotations:

- (void) addAnnotations: (NSArray *)  annotations

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

Parameters
annotations要添加的标注数组

◆ annotationsInMapRect:

- (NSSet *) annotationsInMapRect: (MAMapRect mapRect

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

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

◆ dequeueReusableAnnotationViewWithIdentifier:

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

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

Parameters
identifier复用标识
Returns
annotation view

◆ deselectAnnotation:animated:

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

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

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

◆ removeAnnotation:

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

移除标注

Parameters
annotation要移除的标注

◆ removeAnnotations:

- (void) removeAnnotations: (NSArray *)  annotations

移除一组标注

Parameters
annotations要移除的标注数组

◆ selectAnnotation:animated:

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

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

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

◆ showAnnotations:animated:

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

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

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

◆ showAnnotations:edgePadding:animated:

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

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

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

◆ viewForAnnotation:

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

根据标注数据获取标注view

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

Property Documentation

◆ annotations

- (NSArray*) annotations
readnonatomicassign

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

◆ annotationVisibleRect

- (CGRect) annotationVisibleRect
readnonatomicassign

annotation 可见区域

◆ selectedAnnotations

- (NSArray*) selectedAnnotations
readwritenonatomiccopy

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


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