TencentMapSDK_iOS_3D_v5.7.0
|
地图view的核心类 更多...
#import <QMapView.h>
构造函数 | |
(void) | - setStyleType: |
设置底图样式,默认为标准样式. 更多... | |
(void) | - setMapStyle: |
改变底图样式 更多... | |
(void) | - setCompassOffset: |
设置指南针基于默认位置的偏移. 右下为正 | |
(void) | - setForeignLanguage: |
指定海外图文字的首选语言 更多... | |
(void) | - setWorldMapEnable: |
是否打开世界图 | |
(void) | - setCenterOffsetY: |
设置中心点偏移,向下为正. 单位:比例值(-0.25 ~ 0.25)默认为0 | |
(void) | - setCenterOffset: |
设置中心点偏移,向右向下为增长. 单位:屏幕比例值(0.25 ~ 0.75)默认为(0.5, 0.5) | |
(void) | - setCenterOffset:animated: |
设置中心点偏移 更多... | |
(void) | - setCenterOffsetV2:animated: |
设置中心点偏移 更多... | |
(void) | - setLogoOffset: |
设置地图Logo偏移 更多... | |
(void) | - setLogoMargin:anchor: |
设置地图Logo位置和大小. 调用后会覆盖默认位置 更多... | |
(void) | - setLogoScale: |
设置地图Logo大小. 更多... | |
(void) | - setScaleViewOffset: |
设置地图比例尺偏移 更多... | |
(void) | - setScaleViewFadeEnable: |
设置比例尺是否淡出,比例尺只在地图级别变化的时候淡入,并在地图级别停止变化后淡出 更多... | |
(void) | - setRoadEventVisible: |
设置是否显示封路事件 更多... | |
(void) | - setBuildingBlackList:count: |
设置不显示建筑物的区域. 更多... | |
(void) | - setCenterCoordinate:animated: |
设置中心点经纬度 更多... | |
(void) | - setMinZoomLevel:maxZoomLevel: |
设置最小最大缩放级别, 范围 3 <= minZoomLevel <= maxZoomLevel <= 20 更多... | |
(void) | - setZoomLevel:animated: |
设置缩放级别 更多... | |
(void) | - setRotation:animated: |
设置旋转角度, 正角度向右转, 单位(角度) 更多... | |
(void) | - enableAutoMaxOverlooking: |
允许最大俯仰角跟随缩放级别变化 更多... | |
(void) | - setOverlooking:animated: |
设置overlooking, 范围 [0, 45], 单位(角度) 更多... | |
(void) | - setVisibleMapRect:animated: |
设置当前地图可见范围的mapRect 更多... | |
(void) | - setVisibleMapRect:edgePadding:animated: |
设置当前地图可见范围的mapRect 更多... | |
(void) | - setRegion:animated: |
设定当前地图的region 更多... | |
(void) | - setRegion:edgePadding:animated: |
设定当前地图的region 更多... | |
(QMapRect) | - mapRectThatFits:edgePadding: |
根据边界留宽计算合适的地理范围 更多... | |
(QMapRect) | - mapRectThatFits:containsCalloutView:annotations:edgePadding: |
根据当前地图View的窗口大小调整传入的mapRect,返回适合当前地图窗口显示的mapRect(2D北朝上场景时) 更多... | |
(CGFloat) | - zoomLevelThatFits:edgePadding:outCenterCoordinate: |
根据边界留宽及地理范围计算合适的级别(2D北朝上场景时) 更多... | |
(void) | - setLimitMapRect:mode: |
根据边界留宽显示限制地图区域范围(2D北朝上场景时) 更多... | |
(float *) | - glViewMatrix |
获取当前地图view矩阵 更多... | |
(float *) | - glProjectionMatrix |
获取当前地图projection矩阵 更多... | |
(CGPoint) | - glVertexForCoordinate: |
将经纬度坐标转换为OpenGL使用的坐标 更多... | |
(CGFloat) | - glPointRatio |
返回每屏幕Point单位对应的OpenGL坐标系下的长度 更多... | |
(double) | - metersPerPointAtLatitude:zoomLevel: |
在指定的缩放级别和指定纬度下, 1 screen point 对应的距离(单位是米). 更多... | |
(CGPoint) | - convertCoordinate:toPointToView: |
将经纬度坐标转换为View坐标 更多... | |
(CLLocationCoordinate2D) | - convertPoint:toCoordinateFromView: |
将View坐标转换成经纬度坐标 更多... | |
(CGRect) | - convertRegion:toRectToView: |
将经纬度矩形区域转换为View矩形区域 更多... | |
(QCoordinateRegion) | - convertRect:toRegionFromView: |
将View矩形区域转换成经纬度矩形区域 更多... | |
(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, 当只有一个时,则将其作为地图的中心点. 更多... | |
(void) | - addAOILayer:callback: |
向地图添加一个 AOI 图层 更多... | |
(void) | - removeAOILayer: |
从地图移除一个 AOI 图层 更多... | |
(instancetype) | - initWithFrame:config: |
初始化 QMapView 更多... | |
(void) | - setOverseaSource: |
切换自定义图源 更多... | |
(void) | - addCustomLayer: |
向地图添加一个图层 更多... | |
(void) | - removeCustomLayer: |
从地图移除一个个性化图层 更多... | |
(NSString *) | - getDebugError |
地图view的错误信息, 用于定位问题 | |
(void) | - setIndoorEnabled: |
室内图开关. | |
(void) | - setActiveIndoorInfo: |
手动切换到指定的室内图及楼层 | |
(void) | - setIndoorMaskColor: |
设置显示室内图时的蒙层颜色. alpha=0时不显示,默认不显示 | |
(void) | - setIndoorCell: |
设置面样式, 需要在面所在室内图激活后再进行设置 | |
(void) | - resetIndoorCell |
清除自定义面样式(恢复默认样式), 需在面所在室内图激活时调用 | |
(void) | - addOverlay: |
向地图窗口添加Overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的View 更多... | |
(void) | - addOverlays: |
批量向地图窗口添加Overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的View 更多... | |
(void) | - removeOverlay: |
移除Overlay 更多... | |
(void) | - removeOverlays: |
移除Overlay 更多... | |
(QOverlayView *) | - viewForOverlay: |
返回指定overlay对象的OverlayView 更多... | |
(void) | - showOverlays:edgePadding:animated: |
设置地图使其可以显示数组中所有的overlay, 更多... | |
(void) | - showQMarkers:edgePadding:animated: |
设置地图使其可以显示数组中所有的QMarker覆盖物, 更多... | |
((deprecated("use - (void) | - takeSnapshotInRect:completion: |
截图 更多... | |
(void) | - takeSnapshotInRect:completion: |
异步截图 (默认超时时间为2.5秒) 更多... | |
(void) | - takeSnapshotInRect:timeout:completion: |
异步截图 更多... | |
(void) | - takeSnapshotInRect:timeout:afterScreenUpdates:completion: |
异步截图 更多... | |
(void) | - configureUserLocationPresentation: |
配置当前位置UI属性 (必须在QMapView 初始化以后, 定位开启之前调用) 更多... | |
(CLAccuracyAuthorization accuracyAuthorization) | - API_AVAILABLE |
定位精度权限状态 | |
(CLAuthorizationStatus authorizationStatus) | - API_AVAILABLE |
定位权限状态 | |
(void) | - setUserTrackingMode:animated: |
设置追踪用户位置的模式 更多... | |
(void) | - setUserLocationHidden: |
在地图中隐藏位置图标 | |
(void) | - setUserLocationCompassHidden: |
展示/隐藏位置图标罗盘. | |
(void) | - setUserLocationNavigationGravitylineHidden: |
展示/隐藏位置图标红线. | |
(void) | - requestTempPrecisedLocation:purposeKey:completion: |
申请临时精确定位权限 更多... | |
(void) | - addVisualLayer: |
向地图添加一个可视化数据图层 更多... | |
(void) | - removeVisualLayer: |
从地图移除一个个性化图层 更多... | |
类方法 | |
(void) | + loadPrefferedResourceFilesFromDirectory: |
使用用户传入的地图资源文件(在地图初始化前调用) 更多... | |
(void) | + clearMapCache |
清理地图缓存数据。注: 此接口必须在地图初始化前调用 | |
属性 | |
BOOL | handDrawMapEnabled |
是否开启手绘图,默认为 NO 更多... | |
BOOL | showsTraffic |
是否开启路况图,默认为 NO | |
id< QMapViewDelegate > | delegate |
地图回调 | |
QMapType | mapType |
BOOL | showsScale |
是否显示比例尺,默认为YES | |
BOOL | showsBuildings |
是否显示建筑物,默认为YES | |
BOOL | shows3DBuildings |
是否显示建筑物样式为3D效果,默认为YES | |
BOOL | showsPoi |
是否显示底图上的标注及名称,默认为YES | |
QMapLabelSize | labelSize |
设置底图上的标注的字体大小 更多... | |
BOOL | showsBaseMap |
是否显示底图,默认为YES | |
BOOL | showsCompass |
是否显示指南针,默认为NO | |
NSInteger | preferredFramesPerSecond |
当前地图最大渲染帧数,默认为60 | |
CGPoint | centerOffsetV2 |
设置中心点偏移,向右向下为正,默认为(0.5, 0.5),范围是 [0.05, 0.95]。若超出范围,则被裁减到 [0.05, 0.95]。 | |
CGPoint | logoCenter |
logo位置,需设置在地图的bounds里 | |
CGSize | logoSize |
logo的宽高 | |
CGPoint | scaleOrigin |
比例尺原点位置 | |
CGSize | scaleSize |
比例尺的尺寸 | |
QBasicMapViewLayer * | animationLayer |
地图动画Layer. 使用该layer 可以更灵活的组合 {centerCoordinate, zoomLevel, rotation, overlooking} 动画, 并且可以自定义其duration, timingFunction 等CoreAnimation所支持的一切动画属性. | |
CLLocationCoordinate2D | centerCoordinate |
中心点经纬度 | |
CGFloat | zoomLevel |
缩放级别, 范围 [minZoomLevel, maxZoomLevel] | |
CGFloat | minZoomLevel |
最小缩放级别, 默认 minZoomLevel = 3 | |
CGFloat | maxZoomLevel |
最大缩放级别, 默认 maxZoomLevel = 20 | |
CGFloat | rotation |
旋转角度, 正角度向右转, 单位(角度) | |
CGFloat | overlooking |
Overlooking, 范围 [0, 45], 单位(角度) | |
QMapRect | visibleMapRect |
当前地图可见范围的mapRect | |
QCoordinateRegion | region |
当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围 | |
double | metersPerPointAtCurrentZoomLevel |
在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米) | |
BOOL | zoomEnabled |
BOOL | keepCenterDuringZoom |
pinch时保持中心点, 默认为YES | |
BOOL | scrollEnabled |
BOOL | overlookingEnabled |
是否支持俯视. 默认为YES. | |
BOOL | rotateEnabled |
是否支持旋转. 默认为YES. | |
BOOL | alwaysTriggerDidTapCoordinateEnabled |
当地图被单击时,是否总是触发 "地图点击回调",默认为NO. 地图点击回调: 更多... | |
NSString * | userLocationAccessibilityLabel |
定位图标对应的无障碍label. | |
NSString * | mapViewAccessibilityLabel |
QMapView对应的无障碍label. 默认为地图 | |
CGPoint | mapViewAccessibilityAcitivePoint |
QMapView无障碍对应激活点 | |
NSString * | mapViewZoomAccessibiltyAnouncement |
QMapView缩放时自定义播报内容. | |
BOOL | annotationAccessibilityFrameClipToBounds |
标注view的accessibilityFrame是否会包含其子view. 默认为YES | |
NSArray * | annotations |
当前地图View的已经添加的标注数组 | |
NSArray< id< QAnnotation > > * | selectedAnnotations |
当前选中的annotations get: 处于选中的标注数组,其count == 0 或者 1 set: 数组中的第一个annotation会被选中 (index = 0),其他则忽略. 若数组为空则取消当前选中的annotation. | |
BOOL | indoorPicker |
是否使用内置的楼层选择控件. 默认为YES. | |
CGPoint | indoorPickerOffset |
默认的楼层选择控件偏移位置. 向右下增长 | |
QIndoorBuilding * | activeBuilding |
当前处于激活态的整个室内图数据 | |
QIndoorLevel * | activeLevel |
当前正在展示的室内楼层. | |
BOOL | offlineMapEnable |
离线地图开关, 默认为 NO | |
NSArray * | overlays |
当前mapView中已经添加的Overlay数组 | |
QUserLocationPresentation * | userLocatorPresentation |
地图view的定位标对象 | |
BOOL | showsUserLocation |
开启定位并展示位置图标. | |
QOverlayLevel | locatorDisplayLevel |
位置图标的展示层级. 默认 QOverlayLevelAboveLabels | |
int | locatorZIndex |
位置图标的显示顺序,决定了它与其它QOverlayView的压盖关系. 默认为10000000. 更多... | |
QUserLocation * | userLocation |
当前位置信息 | |
CLLocationAccuracy | desiredAccuracy |
设定定位精度。默认为kCLLocationAccuracyBest | |
CLLocationDistance | distanceFilter |
设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动 | |
CLLocationDegrees | headingFilter |
设定最小更新角度。默认为2度,设定为kCLHeadingFilterNone会提示任何角度改变 | |
BOOL | allowsBackgroundLocationUpdates |
以上是否允许后台定位。ios9以上可用. 请参考CLLocationManager.allowsBackgroundLocationUpdates | |
BOOL | pausesLocationUpdatesAutomatically |
QUserTrackingMode | userTrackingMode |
定位用户位置的模式 | |
BOOL | userLocationVisible |
当前位置在地图中是否可见 | |
地图view的核心类
- (void) addAnnotation: | (id< QAnnotation >) | annotation |
向地图窗口添加标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
annotation | 要添加的标注 |
由 category QMapView(Annotation) 提供.
- (void) addAnnotations: | (NSArray *) | annotations |
向地图窗口添加一组标注,需要实现QMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
annotations | 要添加的标注数组 |
由 category QMapView(Annotation) 提供.
- (void) addAOILayer: | (QAOILayer *) | layer | |
callback: | (void(^)(BOOL success)) | callback | |
- (void) addCustomLayer: | (QCustomLayer *) | layer |
- (void) addOverlay: | (id< QOverlay >) | overlay |
向地图窗口添加Overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的View
overlay | 要添加的overlay |
由 category QMapView(Overlay) 提供.
- (void) addOverlays: | (NSArray< id< QOverlay >> *) | overlays |
批量向地图窗口添加Overlay,需要实现QMapViewDelegate的-mapView:viewForOverlay:函数来生成标注对应的View
overlays | 要添加的overlay列表 |
由 category QMapView(Overlay) 提供.
- (void) addVisualLayer: | (QVisualLayer *) | visualOverlay |
- (NSSet<id <QAnnotation>> *) annotationsInMapRect: | (QMapRect) | mapRect |
获取指定投影矩形范围内的标注
mapRect | 投影矩形范围,当mapRect 为空时(QMapRectIsEmpty) 会返回 nil. |
由 category QMapView(Annotation) 提供.
- (void) bringAnnotationToFront: | (id< QAnnotation >) | DEPRECATED_ATTRIBUTE |
将制定的annotation放在最上层渲染.
annotation | 指定的annotation |
由 category QMapView(Annotation) 提供.
- (void) configureUserLocationPresentation: | (QUserLocationPresentation *) | presentation |
配置当前位置UI属性 (必须在QMapView 初始化以后, 定位开启之前调用)
presentation | 位置UI属性 |
由 category QMapView(UserLocation) 提供.
- (CGPoint) convertCoordinate: | (CLLocationCoordinate2D) | coordinate | |
toPointToView: | (UIView *) | view | |
将经纬度坐标转换为View坐标
coordinate | 待转换的经纬度坐标 |
view | 指定相对的View |
- (CLLocationCoordinate2D) convertPoint: | (CGPoint) | point | |
toCoordinateFromView: | (UIView *) | view | |
将View坐标转换成经纬度坐标
point | 待转换的View坐标 |
view | point坐标所在的view |
- (QCoordinateRegion) convertRect: | (CGRect) | rect | |
toRegionFromView: | (UIView *) | view | |
将View矩形区域转换成经纬度矩形区域
rect | 待转换的View矩形区域 |
view | rect坐标所在的view |
- (CGRect) convertRegion: | (QCoordinateRegion) | region | |
toRectToView: | (UIView *) | view | |
将经纬度矩形区域转换为View矩形区域
region | 待转换的经纬度矩形 |
view | 指定相对的View |
- (QAnnotationView *) dequeueReusableAnnotationViewWithIdentifier: | (NSString *) | identifier |
根据指定标识查找一个可被复用的标注View,一般在delegate中使用,用此函数来代替新申请一个View
identifier | 指定标识 |
由 category QMapView(Annotation) 提供.
- (void) deselectAnnotation: | (id< QAnnotation >) | annotation | |
animated: | (BOOL) | animated | |
- (void) enableAutoMaxOverlooking: | (BOOL) | enable |
允许最大俯仰角跟随缩放级别变化
enable | 是否打开 |
- (CGFloat) glPointRatio |
返回每屏幕Point单位对应的OpenGL坐标系下的长度
- (float *) glProjectionMatrix |
获取当前地图projection矩阵
- (CGPoint) glVertexForCoordinate: | (CLLocationCoordinate2D) | coordinate |
将经纬度坐标转换为OpenGL使用的坐标
coordinate | 经纬度坐标 |
- (float *) glViewMatrix |
获取当前地图view矩阵
- (instancetype) initWithFrame: | (CGRect) | frame | |
config: | (QMapConfig *) | config | |
+ (void) loadPrefferedResourceFilesFromDirectory: | (NSString *) | DEPRECATED_ATTRIBUTE |
使用用户传入的地图资源文件(在地图初始化前调用)
path | 资源文件存放目录的全路径 |
- (QMapRect) mapRectThatFits: | (QMapRect) | mapRect | |
containsCalloutView: | (BOOL) | bContainsCalloutView | |
annotations: | (NSArray< id< QAnnotation > > *) | annotations | |
edgePadding: | (UIEdgeInsets) | insets | |
根据当前地图View的窗口大小调整传入的mapRect,返回适合当前地图窗口显示的mapRect(2D北朝上场景时)
mapRect | 待调整的地理范围 |
bContainsCalloutView | 计算的maprect是否需要包含calloutView |
annotations | 要包含的annotation 数组 |
insets | mapRect四周要预留的边界大小 |
根据边界留宽计算合适的地理范围
mapRect | 待调整的地理范围 |
- (double) metersPerPointAtLatitude: | (CLLocationDegrees) | latitude | |
zoomLevel: | (CGFloat) | zoomLevel | |
在指定的缩放级别和指定纬度下, 1 screen point 对应的距离(单位是米).
latitude | 指定纬度下 |
zoomLevel | 指定的缩放级别 |
- (void) removeAnnotation: | (id< QAnnotation >) | annotation |
- (void) removeAnnotations: | (NSArray *) | annotations |
- (void) removeAOILayer: | (QAOILayer *) | layer |
- (void) removeCustomLayer: | (QCustomLayer *) | layer |
- (void) removeOverlay: | (id< QOverlay >) | overlay |
- (void) removeOverlays: | (NSArray< id< QOverlay >> *) | overlays |
- (void) removeVisualLayer: | (QVisualLayer *) | visualOverlay |
- (void) requestTempPrecisedLocation: | (QMapView *) | mapView | |
purposeKey: | (NSString *) | key | |
completion: | (ios(14)) | API_AVAILABLE | |
申请临时精确定位权限
key | info.plist中 NSLocationTemporaryUsageDescriptionDictionary 设置的 key |
由 category QMapView(UserLocation) 提供.
- (void) selectAnnotation: | (id< QAnnotation >) | annotation | |
animated: | (BOOL) | animated | |
- (void) setBuildingBlackList: | (QMapRect *) | noBuildingList | |
count: | (int) | count | |
设置不显示建筑物的区域.
noBuildingList | yes为显示,否则不显示 |
count | 区域个数 |
- (void) setCenterCoordinate: | (CLLocationCoordinate2D) | coordinate | |
animated: | (BOOL) | animated | |
设置中心点经纬度
coordinate | 中心点经纬度 |
animated | 是否采用动画 |
- (void) setCenterOffset: | (CGPoint) | offset | |
animated: | ((deprecated("use -(void)setCenterOffsetV2:(CGPoint)offset animated:(BOOL)animated instead"))) | __attribute__ | |
设置中心点偏移
offset | 中心点偏移,向右向下为正. 单位:屏幕比例值(0.25 ~ 0.75)默认为(0.5, 0.5) |
animated | 是否采用动画 |
- (void) setCenterOffsetV2: | (CGPoint) | offset | |
animated: | (BOOL) | animated | |
设置中心点偏移
offset | 中心点偏移,向右向下为正,默认为(0.5, 0.5),范围是 [0.05, 0.95]。若超出范围,则被裁减到 [0.05, 0.95]。 |
animated | 是否采用动画 |
- (void) setForeignLanguage: | (QMapLanguage) | language |
指定海外图文字的首选语言
指定海外图文字的语言,默认采用中文
language | 指定的语言 |
- (void) setLimitMapRect: | (QMapRect) | mapRect | |
mode: | (QMapLimitRectFitMode) | mode | |
根据边界留宽显示限制地图区域范围(2D北朝上场景时)
mapRect | 待调整的地理范围 |
mode | 限制地区区域的对齐方式,分等宽对齐和等高对齐 当传入的mapRect的值都为0时,取消区域限制 |
- (void) setLogoMargin: | (CGPoint) | margin | |
anchor: | (QMapLogoAnchor) | anchor | |
设置地图Logo位置和大小. 调用后会覆盖默认位置
margin | 基于指定锚点(近边之间)的边距长度值. 单位Point, 默认为(6, 3) |
anchor | Logo基于mapview的位置的基准锚点. |
- (void) setLogoOffset: | (CGPoint) | DEPRECATED_ATTRIBUTE |
设置地图Logo偏移
offset | Logo中心的偏移量. 如果offset为CGPointZero则为默认位置 |
- (void) setLogoScale: | (CGFloat) | scale |
设置地图Logo大小.
scale | Logo大小. 基于原始大小的比例值, 默认为1.0. 有效区间[0.7, 1.3] |
- (void) setMapStyle: | (int) | styleType |
改变底图样式
@notes 值为在官网配置的自定义样式列表中的顺序, 从1开始
- (void) setMinZoomLevel: | (CGFloat) | minZoomLevel | |
maxZoomLevel: | (CGFloat) | maxZoomLevel | |
设置最小最大缩放级别, 范围 3 <= minZoomLevel <= maxZoomLevel <= 20
minZoomLevel | 最小缩放级别 |
maxZoomLevel | 最大缩放级别 |
- (void) setOverlooking: | (CGFloat) | overlooking | |
animated: | (BOOL) | animated | |
设置overlooking, 范围 [0, 45], 单位(角度)
overlooking | overlooking |
animated | 是否采用动画 |
- (void) setOverseaSource: | (QOverseaProvider *) | provider |
- (void) setRegion: | (QCoordinateRegion) | region | |
animated: | (BOOL) | animated | |
设定当前地图的region
region | 要设定的地图范围,用经纬度的方式表示 |
animated | 是否采用动画 |
- (void) setRegion: | (QCoordinateRegion) | region | |
edgePadding: | (UIEdgeInsets) | insets | |
animated: | (BOOL) | animated | |
设定当前地图的region
region | 要设定的地图范围,用经纬度的方式表示 |
insets | 要嵌入的边界 |
animated | 是否采用动画 |
- (void) setRoadEventVisible: | (BOOL) | DEPRECATED_ATTRIBUTE |
设置是否显示封路事件
visible | yes为显示,否则不显示 |
- (void) setRotation: | (CGFloat) | rotation | |
animated: | (BOOL) | animated | |
设置旋转角度, 正角度向右转, 单位(角度)
rotation | 旋转角度 |
animated | 是否采用动画 |
- (void) setScaleViewFadeEnable: | (BOOL) | enable |
设置比例尺是否淡出,比例尺只在地图级别变化的时候淡入,并在地图级别停止变化后淡出
enable | 为true时,比例尺会淡出;为false时,比例尺常驻 |
- (void) setScaleViewOffset: | (CGPoint) | offset |
设置地图比例尺偏移
offset | 比例尺的偏移量. 如果offset为CGPointZero则为默认位置 |
- (void) setStyleType: | (QMapStyleType) | DEPRECATED_ATTRIBUTE |
设置底图样式,默认为标准样式.
styleType | 用户自定义配置的样式序号. |
@notes 已弃用, 请使用setMapStyle
- (void) setUserTrackingMode: | (QUserTrackingMode) | mode | |
animated: | (BOOL) | animated | |
- (void) setVisibleMapRect: | (QMapRect) | mapRect | |
animated: | (BOOL) | animated | |
设置当前地图可见范围的mapRect
mapRect | 目标mapRect |
animated | 是否采用动画 |
- (void) setVisibleMapRect: | (QMapRect) | mapRect | |
edgePadding: | (UIEdgeInsets) | insets | |
animated: | (BOOL) | animated | |
设置当前地图可见范围的mapRect
mapRect | 目标mapRect |
insets | 要嵌入的边界 |
animated | 是否采用动画 |
- (void) setZoomLevel: | (CGFloat) | zoomLevel | |
animated: | (BOOL) | animated | |
设置缩放级别
zoomLevel | 缩放级别 |
animated | 是否采用动画 |
- (void) showAnnotations: | (NSArray< id< QAnnotation >> *) | annotations | |
edgePadding: | (UIEdgeInsets) | insets | |
animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的annotation, 当只有一个时,则将其作为地图的中心点.
annotations | 需要显示的annotations |
insets | insets 嵌入边界 |
animated | 是否执行动画 |
由 category QMapView(Annotation) 提供.
- (void) showOverlays: | (NSArray< id< QOverlay >> *) | overlays | |
edgePadding: | (UIEdgeInsets) | insets | |
animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的overlay,
overlays | 需要显示的overlays |
insets | insets 嵌入边界 |
animated | 是否执行动画 |
由 category QMapView(Overlay) 提供.
- (void) showQMarkers: | (NSArray< QMarker * > *) | markers | |
edgePadding: | (UIEdgeInsets) | insets | |
animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的QMarker覆盖物,
markers | 需要显示的markers |
insets | insets 嵌入边界 |
animated | 是否执行动画 |
由 category QMapView(Overlay) 提供.
- (void) takeSnapshotInRect: | (CGRect) | rect | |
completion: | (void(^)(UIImage *resultImage)) | completion | |
- ((deprecated("use - (void) takeSnapshotInRect: | (CGRect) | rect | |
completion: | (void(^)(UIImage *resultImage)) | instead | |
- (void) takeSnapshotInRect: | (CGRect) | rect | |
timeout: | (CFTimeInterval) | timeout | |
afterScreenUpdates: | (BOOL) | afterUpdates | |
completion: | (void(^)(UIImage *resultImage)) | completion | |
异步截图
rect | 范围 |
timeout | 超时时间. |
afterUpdates | 是否等待当前内容更新完. |
completion | 异步block结果 |
由 category QMapView(Snapshot) 提供.
- (void) takeSnapshotInRect: | (CGRect) | rect | |
timeout: | (CFTimeInterval) | timeout | |
completion: | (void(^)(UIImage *resultImage)) | completion | |
- (QAnnotationView *) viewForAnnotation: | (id< QAnnotation >) | annotation |
- (QOverlayView *) viewForOverlay: | (id< QOverlay >) | overlay |
- (CGFloat) zoomLevelThatFits: | (QMapRect) | mapRect | |
edgePadding: | (UIEdgeInsets) | insets | |
outCenterCoordinate: | (CLLocationCoordinate2D *) | outCoordinate | |
根据边界留宽及地理范围计算合适的级别(2D北朝上场景时)
mapRect | 待调整的地理范围 |
outCoordinate | 合适的中心点经纬度. |
|
readwritenonatomicassign |
当地图被单击时,是否总是触发 "地图点击回调",默认为NO. 地图点击回调:
当设置为NO时:只有当点击到地图空白处(即未点击到 Annotation, POI,Polyline,Polygon,定位标) 才会触发回调。 当设置为YES时:只要点击到地图(未点击到 Annotation),就会触发回调。
|
readwritenonatomicassign |
是否开启手绘图,默认为 NO
@notes 打开手绘图会将最大级别限制为19
|
readwritenonatomicassign |
设置底图上的标注的字体大小
默认QMapLabelSize_Normal.
|
readwritenonatomicassign |
位置图标的显示顺序,决定了它与其它QOverlayView的压盖关系. 默认为10000000.
大值压盖小值. 只有同displayLevel的QOverlayView才会比较zIndex
由 category QMapView(UserLocation) 提供.
|
readwritenonatomicassign |
指定定位是否会被系统自动暂停. 默认为YES.
由 category QMapView(UserLocation) 提供.
|
readwritenonatomicassign |
设定地图View能否支持用户移动地图, 默认为YES.
|
readwritenonatomicassign |
设定地图View能否支持用户多点缩放, 默认为YES.