高德地图SDK(导航) V11.2.0501
Loading...
Searching...
No Matches
MAMapView(Annotation) Category Reference

#include <MAMapView.h>

Instance Methods

(void) - addAnnotation:
 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View To add annotations to the map window, you need to implement the -mapView:viewForAnnotation: function of MAMapViewDelegate to generate the corresponding view for the annotation
 
(void) - addAnnotations:
 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View To add a set of annotations to the map window, you need to implement the -mapView:viewForAnnotation: function of MAMapViewDelegate to generate the corresponding view for the annotation
 
(void) - removeAnnotation:
 移除标注 Remove annotation
 
(void) - removeAnnotations:
 移除一组标注 Remove a group of annotations
 
(NSSet *) - annotationsInMapRect:
 获取指定投影矩形范围内的标注 Get annotations within the specified projected rectangle
 
(MAAnnotationView *) - viewForAnnotation:
 根据标注数据获取标注view Get annotation view from annotation data
 
(MAAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 从复用内存池中获取制定复用标识的annotation view Retrieve annotation view with specified reuse identifier from reuse memory pool
 
(void) - selectAnnotation:animated:
 选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。 Select the view corresponding to the annotation data. Note: If the annotationView corresponding to the annotation is moved into the reuse pool because it is not within the screen range,To complete the selection operation, the corresponding annotationView will be added to the map, and the center point of the map will be moved to the position of annotation.coordinate.
 
(void) - deselectAnnotation:animated:
 取消选中标注数据对应的view Deselect the view corresponding to the annotation data
 
(void) - showAnnotations:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 Configure the map to display all annotations in the array. If there is only one annotation in the array, directly set the map center to the location of the annotation.
 
(void) - showAnnotations:edgePadding:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 Configure the map to display all annotations in the array. If there is only one annotation in the array, directly set the map center to the location of the annotation.
 

Properties

NSArray * annotations
 
NSArray * selectedAnnotations
 
CGRect annotationVisibleRect
 

Method Documentation

◆ addAnnotation:

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

向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View To add annotations to the map window, you need to implement the -mapView:viewForAnnotation: function of MAMapViewDelegate to generate the corresponding view for the annotation

Parameters
annotation要添加的标注 Annotation to be added

◆ addAnnotations:

- (void) addAnnotations: (NSArray *)  annotations

向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View To add a set of annotations to the map window, you need to implement the -mapView:viewForAnnotation: function of MAMapViewDelegate to generate the corresponding view for the annotation

Parameters
annotations要添加的标注数组 Array of annotations to add

◆ annotationsInMapRect:

- (NSSet *) annotationsInMapRect: (MAMapRect mapRect

获取指定投影矩形范围内的标注 Get annotations within the specified projected rectangle

Parameters
mapRect投影矩形范围 Projected rectangle bounds
Returns
标注集合 Annotation collection

◆ dequeueReusableAnnotationViewWithIdentifier:

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

从复用内存池中获取制定复用标识的annotation view Retrieve annotation view with specified reuse identifier from reuse memory pool

Parameters
identifier复用标识 Reuse identifier
Returns
annotation view annotation view

◆ deselectAnnotation:animated:

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

取消选中标注数据对应的view Deselect the view corresponding to the annotation data

Parameters
annotation标注数据 Annotation data
animated是否有动画效果 Whether there is an animation effect

◆ removeAnnotation:

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

移除标注 Remove annotation

Parameters
annotation要移除的标注 Annotation to remove

◆ removeAnnotations:

- (void) removeAnnotations: (NSArray *)  annotations

移除一组标注 Remove a group of annotations

Parameters
annotations要移除的标注数组 Array of annotations to remove

◆ selectAnnotation:animated:

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

选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。 Select the view corresponding to the annotation data. Note: If the annotationView corresponding to the annotation is moved into the reuse pool because it is not within the screen range,To complete the selection operation, the corresponding annotationView will be added to the map, and the center point of the map will be moved to the position of annotation.coordinate.

Parameters
annotation标注数据 Annotation data
animated是否有动画效果 Whether there is an animation effect

◆ showAnnotations:animated:

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

设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 Configure the map to display all annotations in the array. If there is only one annotation in the array, directly set the map center to the location of the annotation.

Parameters
annotations需要显示的annotation Annotation to be displayed
animated是否执行动画 Whether to execute the animation

◆ showAnnotations:edgePadding:animated:

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

设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。 Configure the map to display all annotations in the array. If there is only one annotation in the array, directly set the map center to the location of the annotation.

Parameters
annotations需要显示的annotation Annotation to be displayed
insetsinsets 嵌入边界 insets embedded boundary
animated是否执行动画 Whether to execute the animation

◆ viewForAnnotation:

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

根据标注数据获取标注view Get annotation view from annotation data

Parameters
annotation标注数据 Annotation data
Returns
对应的标注view Corresponding annotation view

Property Documentation

◆ annotations

- (NSArray*) annotations
readnonatomicassign

所有添加的标注, 注意从5.3.0开始返回数组内不再包含定位蓝点userLocation All added annotations, note that from version 5.3.0 the returned array no longer includes the location blue dot userLocation

◆ annotationVisibleRect

- (CGRect) annotationVisibleRect
readnonatomicassign

annotation 可见区域 annotation visible area

◆ selectedAnnotations

- (NSArray*) selectedAnnotations
readwritenonatomiccopy

处于选中状态的标注数据数据(其count == 0 或 1) Annotation data in selected state (where count == 0 or 1)


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