TencentMapSDK_iOS_3D_v1.3.3
QMapView类 参考

地图view 更多...

#import <QMapView.h>

类 QMapView 继承关系图:

构造函数

(void) - setCenterCoordinate:animated:
 设定地图中心点经纬度 更多...
 
(id) - initWithFrame:
 初始化场景地图 更多...
 
(void) - setRegion:animated:
 设定当前地图的region 更多...
 
(void) - setVisibleMapRect:animated:
 设置当前地图可见范围的mapRect 更多...
 
(void) - setVisibleMapRect:edgePadding:animated:
 设置当前地图可见范围的mapRect 更多...
 
(QCoordinateRegion- regionThatFits:
 根据当前地图视图frame的大小调整region范围,返回适合当前地图frame的region,调整过程中当前地图的中心点不会改变 更多...
 
(QMapRect- mapRectThatFits:
 调整mapRect使其适合地图窗口显示的范围 更多...
 
(QMapRect- mapRectThatFits:edgePadding:
 调整mapRect使其适合地图窗口显示的范围 更多...
 
(void) - setDisplayLauguage:
 指定底图文字显示的首选语言 更多...
 
(void) - setZoomLevel:animated:
 设置当前地图缩放级别 更多...
 
(void) - setCenterCoordinate:zoomLevel:animated:
 同时设置中心点与缩放级别 更多...
 
(CGPoint) - convertCoordinate:toPointToView:
 将经纬度坐标转化为相对于指定view的坐标 更多...
 
(CLLocationCoordinate2D) - convertPoint:toCoordinateFromView:
 将相对于view的坐标转化为经纬度坐标 更多...
 
(CGRect) - convertRegion:toRectToView:
 将地图上的region转化为相对于view的rectangle 更多...
 
(QCoordinateRegion- convertRect:toRegionFromView:
 将相对于view的rectangle转化为region 更多...
 
(void) - addAnnotation:
 向地图窗口添加标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View 更多...
 
(void) - addAnnotations:
 向地图窗口添加一组标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View 更多...
 
(void) - removeAnnotation:
 移除标注 更多...
 
(void) - removeAnnotations:
 移除一组标注 更多...
 
(QAnnotationView *) - viewForAnnotation:
 获取指定标注的view 更多...
 
(NSSet *) - annotationsInMapRect:
 获取指定投影矩形范围内的标注 更多...
 
(QAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 从复用内存池中获取制定复用标识的annotationView 更多...
 
(void) - selectAnnotation:animated:
 选中标注对应的view 更多...
 
(void) - deselectAnnotation:animated:
 取消选中标注对应的view 更多...
 
(void) - showAnnotations:animated:
 设置地图使其可以显示数组中所有的标注 更多...
 
(void) - setUserTrackingMode:animated:
 设置追踪用户位置的模式 更多...
 
(void) - addOverlay:
 向地图窗口添加overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的view 更多...
 
(void) - addOverlays:
 向地图窗口添加一组overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的view 更多...
 
(void) - removeOverlay:
 移除overlay 更多...
 
(void) - removeOverlays:
 移除一组overlay 更多...
 
(void) - insertOverlay:atIndex:
 在指定的索引出添加一个overlay 更多...
 
(void) - exchangeOverlayAtIndex:withOverlayAtIndex:
 交换指定索引处的overlay 更多...
 
(void) - insertOverlay:aboveOverlay:
 在指定的overlay之上插入一个overlay 更多...
 
(void) - insertOverlay:belowOverlay:
 在指定的overlay之下插入一个overlay 更多...
 
(QOverlayView *) - viewForOverlay:
 查找指定overlay对应的View,如果该view尚未创建,返回nil 更多...
 
(UIImage *) - takeSnapshotInRect:
 在指定区域内截图 更多...
 
(void) - takeSnapshotInRect:withCompletionBlock:
 在指定区域内截图(异步) 更多...
 

属性

id< QMapViewDelegate > delegate
 地图view的delegate
 
QMapType mapType
 地图类型
 
BOOL showTraffic
 是否显示交通, 默认为NO
 
BOOL scrollEnabled
 是否支持平移, 默认为YES
 
BOOL zoomEnabled
 是否支持缩放, 默认为YES
 
BOOL keepCenterEnabled
 pinch时保持中心点, 默认为NO
 
BOOL showsScale
 是否显示比例尺,默认为YES
 
CLLocationCoordinate2D centerCoordinate
 当前地图的中心点经纬度坐标,改变该值时,地图缩放级别不会发生变化
 
QCoordinateRegion region
 当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围
 
QMapRect visibleMapRect
 当前地图可见范围的mapRect
 
double zoomLevel
 地图缩放级别
 
double minZoomLevel
 最小缩放级别
 
double maxZoomLevel
 最大缩放级别
 
NSArray * annotations
 当前地图上的标注数组
 
CGRect annotationVisibleRect
 标注的可见区域
 
NSArray * selectedAnnotations
 处于选中状态的标注数据数据(其count == 0 或 1)
 
BOOL showsUserLocation
 是否显示用户位置
 
CLLocationDistance distanceFilter
 最小移动距离(单位是米), 当大于该值时定位回调才触发, 默认为kCLDistanceFilterNone
 
QUserLocationuserLocation
 当前用户位置数据
 
BOOL forceUpdatingHeading
 是否强制开启heading 更新, 默认为NO.
 
QUserTrackingMode userTrackingMode
 定位用户位置的模式
 
BOOL userLocationVisible
 当前位置在地图中是否可见
 
NSArray * overlays
 当前地图上的overlay数组
 

详细描述

地图view

函数文档

◆ addAnnotation:()

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

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

参数
annotation要添加的标注

◆ addAnnotations:()

- (void) addAnnotations: (NSArray *)  annotations

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

参数
annotations要添加的标注数组

◆ addOverlay:()

- (void) addOverlay: (id< QOverlay >)  overlay

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

参数
overlay要添加的overlay

由 category QMapView(OverlaysAPI) 提供.

◆ addOverlays:()

- (void) addOverlays: (NSArray *)  overlays

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

参数
overlays要添加的overlay数组

由 category QMapView(OverlaysAPI) 提供.

◆ annotationsInMapRect:()

- (NSSet *) annotationsInMapRect: (QMapRect mapRect

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

参数
mapRect投影矩形范围
返回
标注集合

◆ convertCoordinate:toPointToView:()

- (CGPoint) convertCoordinate: (CLLocationCoordinate2D)  coordinate
toPointToView: (UIView *)  view 

将经纬度坐标转化为相对于指定view的坐标

参数
coordinate要转化的经纬度坐标
viewpoint所基于的view
返回
源经纬度在目标view上的坐标

◆ convertPoint:toCoordinateFromView:()

- (CLLocationCoordinate2D) convertPoint: (CGPoint)  point
toCoordinateFromView: (UIView *)  view 

将相对于view的坐标转化为经纬度坐标

参数
point要转化的坐标
viewpoint所基于的view
返回
源point转化后的经纬度

◆ convertRect:toRegionFromView:()

- (QCoordinateRegion) convertRect: (CGRect)  rect
toRegionFromView: (UIView *)  view 

将相对于view的rectangle转化为region

参数
rect要转化的rectangle
viewrectangle所基于的view
返回
转化后的region

◆ convertRegion:toRectToView:()

- (CGRect) convertRegion: (QCoordinateRegion region
toRectToView: (UIView *)  view 

将地图上的region转化为相对于view的rectangle

参数
region要转化的region
viewrectangle所基于的view
返回
转化后的rectangle

◆ dequeueReusableAnnotationViewWithIdentifier:()

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

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

参数
identifier复用标识
返回
一个标注view

◆ deselectAnnotation:animated:()

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

取消选中标注对应的view

参数
annotation选择的标注
animated是否采用动画

◆ exchangeOverlayAtIndex:withOverlayAtIndex:()

- (void) exchangeOverlayAtIndex: (NSUInteger)  index1
withOverlayAtIndex: (NSUInteger)  index2 

交换指定索引处的overlay

参数
index1索引1
index2索引2

由 category QMapView(OverlaysAPI) 提供.

◆ initWithFrame:()

- (id) initWithFrame: (CGRect)  frame

初始化场景地图

参数
frame设定的地图view框

◆ insertOverlay:aboveOverlay:()

- (void) insertOverlay: (id< QOverlay >)  overlay
aboveOverlay: (id< QOverlay >)  sibling 

在指定的overlay之上插入一个overlay

参数
overlay待添加的overlay
sibling用于指定位置的overlay

由 category QMapView(OverlaysAPI) 提供.

◆ insertOverlay:atIndex:()

- (void) insertOverlay: (id< QOverlay >)  overlay
atIndex: (NSUInteger)  index 

在指定的索引出添加一个overlay

参数
overlay要添加的overlay
index指定的索引

由 category QMapView(OverlaysAPI) 提供.

◆ insertOverlay:belowOverlay:()

- (void) insertOverlay: (id< QOverlay >)  overlay
belowOverlay: (id< QOverlay >)  sibling 

在指定的overlay之下插入一个overlay

参数
overlay待添加的overlay
sibling用于指定位置的overlay

由 category QMapView(OverlaysAPI) 提供.

◆ mapRectThatFits:()

- (QMapRect) mapRectThatFits: (QMapRect mapRect

调整mapRect使其适合地图窗口显示的范围

参数
mapRect需要调整的mapRect
返回
调整后的mapRect

◆ mapRectThatFits:edgePadding:()

- (QMapRect) mapRectThatFits: (QMapRect mapRect
edgePadding: (UIEdgeInsets)  insets 

调整mapRect使其适合地图窗口显示的范围

参数
mapRect需要调整的mapRect
insets要嵌入的边界
返回
调整后的mapRect

◆ regionThatFits:()

- (QCoordinateRegion) regionThatFits: (QCoordinateRegion region

根据当前地图视图frame的大小调整region范围,返回适合当前地图frame的region,调整过程中当前地图的中心点不会改变

参数
region需要调整的region
返回
调整后的region

◆ removeAnnotation:()

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

移除标注

参数
annotation要移除的标注

◆ removeAnnotations:()

- (void) removeAnnotations: (NSArray *)  annotations

移除一组标注

参数
annotations要移除的标注数组

◆ removeOverlay:()

- (void) removeOverlay: (id< QOverlay >)  overlay

移除overlay

参数
overlay要移除的overlay

由 category QMapView(OverlaysAPI) 提供.

◆ removeOverlays:()

- (void) removeOverlays: (NSArray *)  overlays

移除一组overlay

参数
overlays要移除的overlay数组

由 category QMapView(OverlaysAPI) 提供.

◆ selectAnnotation:animated:()

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

选中标注对应的view

参数
annotation选择的标注
animated是否采用动画

◆ setCenterCoordinate:animated:()

- (void) setCenterCoordinate: (CLLocationCoordinate2D)  coordinate
animated: (BOOL)  animated 

设定地图中心点经纬度

参数
coordinate要设定的地图中心点经纬度
animated是否采用动画

◆ setCenterCoordinate:zoomLevel:animated:()

- (void) setCenterCoordinate: (CLLocationCoordinate2D)  coordinate
zoomLevel: (double)  newZoomLevel
animated: (BOOL)  animated 

同时设置中心点与缩放级别

参数
coordinate要设定的地图中心点经纬度
newZoomLevel目标缩放级别
animated是否采用动画

◆ setDisplayLauguage:()

- (void) setDisplayLauguage: (QMapLanguage)  language

指定底图文字显示的首选语言

指定后底图会尽量用指定语言显示底图标注的文字,默认采用英语

参数
lauguage指定的语言
参见
QMapLanguage

◆ setRegion:animated:()

- (void) setRegion: (QCoordinateRegion region
animated: (BOOL)  animated 

设定当前地图的region

参数
region要设定的地图范围,用经纬度的方式表示
animated是否采用动画

◆ setUserTrackingMode:animated:()

- (void) setUserTrackingMode: (QUserTrackingMode)  mode
animated: (BOOL)  animated 

设置追踪用户位置的模式

参数
mode要使用的模式
animated是否采用动画

◆ setVisibleMapRect:animated:()

- (void) setVisibleMapRect: (QMapRect mapRect
animated: (BOOL)  animated 

设置当前地图可见范围的mapRect

参数
mapRect目标mapRect
animated是否采用动画

◆ setVisibleMapRect:edgePadding:animated:()

- (void) setVisibleMapRect: (QMapRect mapRect
edgePadding: (UIEdgeInsets)  insets
animated: (BOOL)  animated 

设置当前地图可见范围的mapRect

参数
mapRect目标mapRect
insets要嵌入的边界
animated是否采用动画

◆ setZoomLevel:animated:()

- (void) setZoomLevel: (double)  newZoomLevel
animated: (BOOL)  animated 

设置当前地图缩放级别

参数
newZoomLevel目标缩放级别
animated是否采用动画

◆ showAnnotations:animated:()

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

设置地图使其可以显示数组中所有的标注

参数
annotations需要显示的标注数组
animated是否采用动画

◆ takeSnapshotInRect:()

- (UIImage *) takeSnapshotInRect: (CGRect)  rect

在指定区域内截图

参数
rect基于mapView的坐标系
返回
截图image

由 category QMapView(Snapshot) 提供.

◆ takeSnapshotInRect:withCompletionBlock:()

- (void) takeSnapshotInRect: (CGRect)  rect
withCompletionBlock: (void(^)(UIImage *resultImage, CGRect rect))  block 

在指定区域内截图(异步)

参数
rect基于mapView的坐标系
返回
截图image

由 category QMapView(Snapshot) 提供.

◆ viewForAnnotation:()

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

获取指定标注的view

参数
annotation指定的标注
返回
该标注的view

◆ viewForOverlay:()

- (QOverlayView *) viewForOverlay: (id< QOverlay >)  overlay

查找指定overlay对应的View,如果该view尚未创建,返回nil

参数
overlay指定的overlay
返回
指定overlay的view

由 category QMapView(OverlaysAPI) 提供.


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