TencentMapSDK_iOS_3D_v5.7.0
QMapView(Annotation)分类 参考

地图view的点覆盖物相关的API 更多...

#import <QMapView.h>

构造函数

(NSSet< id< QAnnotation >> *) - annotationsInMapRect:
 获取指定投影矩形范围内的标注 更多...
 
(void) - addAnnotation:
 向地图窗口添加标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View 更多...
 
(void) - addAnnotations:
 向地图窗口添加一组标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View 更多...
 
(void) - removeAnnotation:
 移除标注 更多...
 
(void) - removeAnnotations:
 移除一组标注 更多...
 
(QAnnotationView *) - viewForAnnotation:
 查找指定标注对应的View,如果该标注尚未显示,返回nil 更多...
 
(QAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 根据指定标识查找一个可被复用的标注View,一般在delegate中使用,用此函数来代替新申请一个View 更多...
 
(void) - bringAnnotationToFront:
 将制定的annotation放在最上层渲染. 更多...
 
(void) - selectAnnotation:animated:
 选中指定的标注 更多...
 
(void) - deselectAnnotation:animated:
 取消指定的标注的选中状态 更多...
 
(void) - showAnnotations:edgePadding:animated:
 设置地图使其可以显示数组中所有的annotation, 当只有一个时,则将其作为地图的中心点. 更多...
 

属性

NSArray * annotations
 当前地图View的已经添加的标注数组
 
NSArray< id< QAnnotation > > * selectedAnnotations
 当前选中的annotations get: 处于选中的标注数组,其count == 0 或者 1 set: 数组中的第一个annotation会被选中 (index = 0),其他则忽略. 若数组为空则取消当前选中的annotation.
 

详细描述

地图view的点覆盖物相关的API

函数文档

◆ addAnnotation:

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

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

参数
annotation要添加的标注

扩展类 QMapView.

◆ addAnnotations:

- (void) addAnnotations: (NSArray *)  annotations

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

参数
annotations要添加的标注数组

扩展类 QMapView.

◆ annotationsInMapRect:

- (NSSet<id <QAnnotation>> *) annotationsInMapRect: (QMapRect mapRect

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

参数
mapRect投影矩形范围,当mapRect 为空时(QMapRectIsEmpty) 会返回 nil.
返回
标注集合

扩展类 QMapView.

◆ bringAnnotationToFront:

- (void) bringAnnotationToFront: (id< QAnnotation >)  DEPRECATED_ATTRIBUTE

将制定的annotation放在最上层渲染.

参数
annotation指定的annotation
注解
Deprecated 请使用QAnnotationView.zIndex管理顺序(默认会将本annotationView.zIndex设置为当前顶部的zIndex+1)

扩展类 QMapView.

◆ dequeueReusableAnnotationViewWithIdentifier:

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

根据指定标识查找一个可被复用的标注View,一般在delegate中使用,用此函数来代替新申请一个View

参数
identifier指定标识
返回
返回可被复用的标注View

扩展类 QMapView.

◆ deselectAnnotation:animated:

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

取消指定的标注的选中状态

参数
annotation指定的标注
animated是否支持动画

扩展类 QMapView.

◆ removeAnnotation:

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

移除标注

参数
annotation要移除的标注

扩展类 QMapView.

◆ removeAnnotations:

- (void) removeAnnotations: (NSArray *)  annotations

移除一组标注

参数
annotations要移除的标注数组

扩展类 QMapView.

◆ selectAnnotation:animated:

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

选中指定的标注

参数
annotation指定的标注
animated是否支持动画

扩展类 QMapView.

◆ showAnnotations:edgePadding:animated:

- (void) showAnnotations: (NSArray< id< QAnnotation >> *)  annotations
edgePadding: (UIEdgeInsets)  insets
animated: (BOOL)  animated 

设置地图使其可以显示数组中所有的annotation, 当只有一个时,则将其作为地图的中心点.

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

扩展类 QMapView.

◆ viewForAnnotation:

- (QAnnotationView *) viewForAnnotation: (id< QAnnotation >)  annotation

查找指定标注对应的View,如果该标注尚未显示,返回nil

参数
annotation指定的标注
返回
指定标注对应的View

扩展类 QMapView.


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