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

#import <MAMapView.h>

Inheritance diagram for MAMapView:

Instance Methods

(NSDictionary< NSNumber *, UIColor * > *trafficStatus) - __attribute
 设置实时交通颜色,key为 MATrafficStatus
 
(BOOL openGLESDisabled) - __attribute
 停止/开启 OpenGLES绘制, 默认NO. 对应回调是 - (void)mapView:(MAMapView *) didChangeOpenGLESDisabled:(BOOL)
 
(void) - setRegion:animated:
 设定当前地图的经纬度范围,该范围可能会被调整为适合地图窗口显示的范围
 
(MACoordinateRegion- regionThatFits:
 根据当前地图视图frame的大小调整region范围
 
(void) - setVisibleMapRect:animated:
 设置可见区域
 
(MAMapRect- mapRectThatFits:
 重新计算可见地图矩形区域,使之匹配mapview长宽比
 
(MAMapRect- mapRectThatFits:edgePadding:
 根据边缘插入来调整地图矩形区域,使之匹配mapview加insets后的长宽比
 
(void) - setVisibleMapRect:edgePadding:animated:
 设置可见地图矩形区域
 
(void) - setVisibleMapRect:edgePadding:animated:duration:
 设置可见地图矩形区域
 
(void) - setCenterCoordinate:animated:
 设置当前地图的中心点,改变该值时,地图的比例尺级别不会发生变化
 
(void) - setZoomLevel:animated:
 设置缩放级别(默认3-19,有室内地图时为3-20)
 
(void) - setZoomLevel:atPivot:animated:
 根据指定的枢纽点来缩放地图
 
(void) - setRotationDegree:animated:duration:
 设置地图旋转角度(逆时针为正向)
 
(void) - setCameraDegree:animated:duration:
 设置地图相机角度(范围为[0.f, 60.f],但高于40度的角度需要在16级以上才能生效)
 
(MAMapStatus *) - getMapStatus
 获取地图状态
 
(void) - setMapStatus:animated:
 设置地图状态
 
(void) - setMapStatus:animated:duration:
 设置地图状态
 
(void) - setCompassImage:
 设置指南针的图片
 
(UIImage *) - takeSnapshotInRect:
 在指定区域内截图(默认会包含该区域内的annotationView),注意不要在地图回调方法内直接调用
 
(void) - takeSnapshotInRect:withCompletionBlock:
 异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调
 
(void) - takeSnapshotInRect:timeoutInterval:completionBlock:
 异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调 (since 7.8.0)
 
(double) - metersPerPointForZoomLevel:
 在指定的缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米).
 
(CGPoint) - convertCoordinate:toPointToView:
 将经纬度转换为指定view坐标系的坐标
 
(CLLocationCoordinate2D) - convertPoint:toCoordinateFromView:
 将指定view坐标系的坐标转换为经纬度
 
(CGRect) - convertRegion:toRectToView:
 将经纬度region转换为指定view坐标系的rect
 
(MACoordinateRegion- convertRect:toRegionFromView:
 将指定view坐标系的rect转换为经纬度region
 
(void) - reloadMap
 重新加载地图
 
(void) - clearDisk
 清除所有磁盘上缓存的地图数据(不包括离线地图)
 
(void) - reloadInternalTexture
 重新加载内部纹理,在纹理被错误释放时可以执行此方法。(since 5.4.0)
 
(NSString *) - mapContentApprovalNumber
 获取地图审图号。如果启用了“自定义样式”功能(customMapStyleEnabled 为 YES),则返回nil。(since 5.4.0)
 
(NSString *) - satelliteImageApprovalNumber
 获取卫星图片审图号。(since 5.4.0)
 
(NSString *) - terrainApprovalNumber
 获取地形图审图号。(since 8.2.0)
 
(void) - addAnimationWith:zoomAnimation:rotateAnimation:cameraDegreeAnimation:
 添加CAKeyframeAnimation动画。(since 6.0.0)
 
(void) - forceRefresh
 强制刷新。(since 6.0.0)
 
(void) - setConstructingRoadEnable:
 设置在建道路图层是否显示。默认NO(since 7.7.0)
 
 annotations
 所有添加的标注, 注意从5.3.0开始返回数组内不再包含定位蓝点userLocation
 
 selectedAnnotations
 处于选中状态的标注数据数据(其count == 0 或 1)
 
 annotationVisibleRect
 annotation 可见区域
 
 addAnnotation:
 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
 
 addAnnotations:
 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
 
 removeAnnotation:
 移除标注
 
 removeAnnotations:
 移除一组标注
 
 annotationsInMapRect:
 获取指定投影矩形范围内的标注
 
 viewForAnnotation:
 根据标注数据获取标注view
 
 dequeueReusableAnnotationViewWithIdentifier:
 从复用内存池中获取制定复用标识的annotation view
 
 selectAnnotation:animated:
 选中标注数据对应的view。注意:如果annotation对应的annotationView因不在屏幕范围内而被移入复用池,为了完成选中操作,会将对应的annotationView添加到地图上,并将地图中心点移至annotation.coordinate的位置。
 
 deselectAnnotation:animated:
 取消选中标注数据对应的view
 
 showAnnotations:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
 
 showAnnotations:edgePadding:animated:
 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置。
 
 hideBuildingsWithPolygon:polygonSize:
 隐藏建筑物
 
 showHiddenBuildingsWithOperationId:
 显示建筑物
 
 customMapStyleEnabled
 是否开启自定义样式, 默认NO. since 5.0.0
 
 setCustomMapStyleOptions:
 自定义地图样式设置,可以支持分级样式配置,如控制不同级别显示不同的颜色(自7.0.0开始样式有更新,旧的样式文件不能继续使用,必须到官网重新导出新样式文件。 自6.6.0开始使用新版样式,旧版样式无法在新版接口setCustomMapStyleOptions:(MAMapCustomStyleOptions *)styleOptions中使用,请到官网(lbs.amap.com)更新新版样式文件.)
 
 addEngineOverlay:
 向地图窗口添加Overlay。
 
 overlays
 所有添加的Overlay
 
 overlaysInLevel:
 取位于level下的overlays
 
 addOverlay:
 向地图窗口添加Overlay。 需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer。 默认添加层级:MAGroundOverlay默认层级为MAOverlayLevelAboveRoads,其余overlay类型默认层级为MAOverlayLevelAboveLabels
 
 addOverlays:
 向地图窗口添加一组Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer 默认添加层级:MAOverlayLevelAboveLabels
 
 addOverlay:level:
 向地图窗口添加Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
 
 addOverlays:level:
 向地图窗口添加一组Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
 
 removeOverlay:
 移除Overlay
 
 removeOverlays:
 移除一组Overlay
 
 insertOverlay:atIndex:level:
 在指定层级的指定的索引处添加一个Overlay
 
 insertOverlay:aboveOverlay:
 在指定的Overlay之上插入一个overlay
 
 insertOverlay:belowOverlay:
 在指定的Overlay之下插入一个overlay
 
 insertOverlay:atIndex:
 在指定的索引处添加一个Overlay
 
 exchangeOverlayAtIndex:withOverlayAtIndex:
 在MAOverlayLevelAboveLabels上交换指定索引处的Overlay
 
 exchangeOverlayAtIndex:withOverlayAtIndex:atLevel:
 交换指定索引处的Overlay
 
 exchangeOverlay:withOverlay:
 交换两个overlay
 
 rendererForOverlay:
 查找指定overlay对应的Renderer,如果该View尚未创建,返回nil
 
 showOverlays:animated:
 设置地图使其可以显示数组中所有的overlay, 如果数组中只有一个则直接设置地图中心为overlay的位置。
 
 showOverlays:edgePadding:animated:
 设置地图使其可以显示数组中所有的overlay, 如果数组中只有一个则直接设置地图中心为overlay的位置。
 
 getHittedPolylinesWith:traverseAll:
 获取点击选中的polylineRenderer, 注意:开启polylineRenderer的点击选中功能,需设置userInteractionEnabled=YES。since 7.1.0
 
 showsUserLocation
 是否显示用户位置
 
 userLocation
 当前的位置数据
 
 customizeUserLocationAccuracyCircleRepresentation
 是否自定义用户位置精度圈(userLocationAccuracyCircle)对应的 view, 默认为 NO.
如果为YES: 会调用 - (MAOverlayRenderer *)mapView (MAMapView *)mapView rendererForOverlay:(id <MAOverlay>)overlay 若返回nil, 则不加载.
如果为NO : 会使用默认的样式.
 
 userLocationAccuracyCircle
 用户位置精度圈 对应的overlay
 
 userTrackingMode
 定位用户位置的模式, 注意:在follow模式下,设置地图中心点、设置可见区域、滑动手势、选择annotation操作会取消follow模式,并触发 - (void)mapView:(MAMapView *)mapView didChangeUserTrackingMode:(MAUserTrackingMode)mode animated:(BOOL)animated;
 
 userLocationVisible
 当前位置再地图中是否可见
 
 distanceFilter
 设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动
 
 desiredAccuracy
 设定定位精度。默认为kCLLocationAccuracyBest
 
 headingFilter
 设定最小更新角度。默认为1度,设定为kCLHeadingFilterNone会提示任何角度改变
 
 pausesLocationUpdatesAutomatically
 指定定位是否会被系统自动暂停
 
 allowsBackgroundLocationUpdates
 是否允许后台定位。默认为NO。只在iOS 9.0之后起作用。
设置为YES的时候必须保证 Background Modes 中的 Location updates处于选中状态,否则会抛出异常。
注意:定位必须在停止的状态下设置(showsUserLocation = NO),否则无效
 
 setUserTrackingMode:animated:
 设置定位用户位置的模式
 
 updateUserLocationRepresentation:
 设定UserLocationView样式。如果用户自定义了userlocation的annotationView,或者该annotationView还未添加到地图上,此方法将不起作用
 

Class Methods

(void) + updatePrivacyShow:privacyInfo:
 更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. 注意:必须在MAMapView实例化之前调用 since 8.1.0
 
(void) + updatePrivacyAgree:
 更新用户授权高德SDK隐私协议状态. 注意:必须在MAMapView实例化之前调用 since 8.1.0
 

Properties

BOOL metalEnabled
 标记是否开启metal,默认NO. 注意:因机型或系统限制(要求机型最低5S,系统最低iOS10),开启metal可能失败。
 
BOOL terrainEnabled
 是否打开地形图,默认NO. 注意:需在地图创建前设置 (since 8.2.0)
 
BOOL terrainAuth
 是否有地形图授权,默认YES. 如果没有授权会回调MAMapViewDelegate的 - (void)mapView:(MAMapView *)mapView didFailLoadTerrainWithError:(NSError *)error 方法 (since 9.3.1)
 
id< MAMapViewDelegatedelegate
 地图view的delegate
 
MAMapType mapType
 地图类型。注意:自定义样式优先级高于mapType,如开启了自定义样式,要关闭自定义样式后mapType才生效
 
CLLocationCoordinate2D centerCoordinate
 当前地图的中心点,改变该值时,地图的比例尺级别不会发生变化
 
MACoordinateRegion region
 当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围
 
MAMapRect visibleMapRect
 可见区域, 设定的该范围可能会被调整为适合地图窗口显示的范围
 
MACoordinateRegion limitRegion
 设置可见地图区域的矩形边界,如限制地图只显示北京市范围
 
MAMapRect limitMapRect
 设置可见地图区域的矩形边界,如限制地图只显示北京市范围
 
CGFloat zoomLevel
 缩放级别(默认3-19,有室内地图时为3-20)
 
CGFloat minZoomLevel
 最小缩放级别
 
CGFloat maxZoomLevel
 最大缩放级别(有室内地图时最大为20,否则为19)
 
CGFloat rotationDegree
 设置地图旋转角度(逆时针为正向)
 
CGFloat cameraDegree
 设置地图相机角度(范围为[0.f, 60.f],但高于40度的角度需要在16级以上才能生效)
 
BOOL zoomingInPivotsAroundAnchorPoint
 是否以screenAnchor点作为锚点进行缩放,默认为YES。如果为NO,则以手势中心点作为锚点
 
BOOL zoomEnabled
 是否支持缩放, 默认YES
 
BOOL scrollEnabled
 是否支持平移, 默认YES
 
BOOL rotateEnabled
 是否支持旋转, 默认YES
 
BOOL rotateCameraEnabled
 是否支持camera旋转, 默认YES
 
BOOL showsBuildings
 是否显示楼块,默认为YES
 
BOOL showsLabels
 是否显示底图标注, 默认为YES
 
BOOL showTraffic
 是否显示交通路况图层, 默认为NO
 
BOOL touchPOIEnabled
 是否支持单击地图获取POI信息(默认为YES), 对应的回调是 -(void)mapView:(MAMapView *) didTouchPois:(NSArray *)
 
BOOL showsCompass
 是否显示指南针, 默认YES
 
CGPoint compassOrigin
 指南针原点位置
 
CGSize compassSize
 指南针的宽高
 
BOOL showsScale
 是否显示比例尺, 默认YES
 
CGPoint scaleOrigin
 比例尺原点位置
 
CGSize scaleSize
 比例尺的最大宽高
 
CGPoint logoCenter
 logo位置, 必须在mapView.bounds之内,否则会被忽略
 
CGSize logoSize
 logo的宽高
 
double metersPerPointForCurrentZoom
 在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米)
 
BOOL isAbroad
 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域
 
NSUInteger maxRenderFrame
 最大帧数,有效的帧数为:60、30、20、10等能被60整除的数。默认为60
 
BOOL isAllowDecreaseFrame
 是否允许降帧,默认为YES
 
BOOL renderringDisabled
 停止/开启 地图绘制, 默认NO.
 
CGPoint screenAnchor
 地图的视图锚点。坐标系归一化,(0, 0)为MAMapView左上角,(1, 1)为右下角。默认为(0.5, 0.5),即当前地图的视图中心 (since 5.0.0)
 
NSRunLoopMode runLoopMode
 地图渲染的runloop mode,默认为NSRunLoopCommonModes。如果是和UIScrollView一起使用且不希望地图在scrollView拖动时渲染,请设置此值为NSDefaultRunLoopMode。(since 5.1.0)
 
NSNumber * mapLanguage
 设置语言。中文:@0: 英文:@1. 英文使用注意事项:1、不能和自定义地图样式同时使用;2、英文状态只在MAMapTypeStandard生效
 

Method Documentation

◆ __attribute [1/2]

- (BOOL openGLESDisabled) __attribute ((deprecated("已废弃,since 7.9.0,请使用renderringDisabled属性"))) 

停止/开启 OpenGLES绘制, 默认NO. 对应回调是 - (void)mapView:(MAMapView *) didChangeOpenGLESDisabled:(BOOL)

◆ __attribute [2/2]

- (NSDictionary< NSNumber *, UIColor * > *trafficStatus) __attribute ((deprecated("已废弃 since 7.8.0"))) 

设置实时交通颜色,key为 MATrafficStatus

◆ addAnimationWith:zoomAnimation:rotateAnimation:cameraDegreeAnimation:

- (void) addAnimationWith: (CAKeyframeAnimation *)  mapCenterAnimation
zoomAnimation: (CAKeyframeAnimation *)  zoomAnimation
rotateAnimation: (CAKeyframeAnimation *)  rotateAnimation
cameraDegreeAnimation: (CAKeyframeAnimation *)  cameraDegreeAnimation 

添加CAKeyframeAnimation动画。(since 6.0.0)

Parameters
mapCenterAnimation地图中心点动画
zoomAnimation放大缩小动画
rotateAnimation旋转动画
cameraDegreeAnimation仰角动画

◆ clearDisk

- (void) clearDisk

清除所有磁盘上缓存的地图数据(不包括离线地图)

◆ convertCoordinate:toPointToView:

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

将经纬度转换为指定view坐标系的坐标

Parameters
coordinate经纬度
view指定的view
Returns
基于指定view坐标系的坐标

◆ convertPoint:toCoordinateFromView:

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

将指定view坐标系的坐标转换为经纬度

Parameters
point指定view坐标系的坐标
view指定的view
Returns
经纬度

◆ convertRect:toRegionFromView:

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

将指定view坐标系的rect转换为经纬度region

Parameters
rect指定view坐标系的rect
view指定的view
Returns
经纬度region

◆ convertRegion:toRectToView:

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

将经纬度region转换为指定view坐标系的rect

Parameters
region经纬度region
view指定的view
Returns
指定view坐标系的rect

◆ forceRefresh

- (void) forceRefresh

强制刷新。(since 6.0.0)

◆ getMapStatus

- (MAMapStatus *) getMapStatus

获取地图状态

Returns
地图状态

◆ mapContentApprovalNumber

- (NSString *) mapContentApprovalNumber

获取地图审图号。如果启用了“自定义样式”功能(customMapStyleEnabled 为 YES),则返回nil。(since 5.4.0)

Returns
地图审图号

◆ mapRectThatFits:

- (MAMapRect) mapRectThatFits: (MAMapRect mapRect

重新计算可见地图矩形区域,使之匹配mapview长宽比

Parameters
mapRect要调整的地图矩形区域
Returns
调整后的地图矩形区域

◆ mapRectThatFits:edgePadding:

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

根据边缘插入来调整地图矩形区域,使之匹配mapview加insets后的长宽比

Parameters
mapRect要调整的地图矩形区域
insets边缘插入
Returns
调整后的地图矩形区域

◆ metersPerPointForZoomLevel:

- (double) metersPerPointForZoomLevel: (CGFloat)  zoomLevel

在指定的缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米).

Parameters
zoomLevel指定的缩放级别, 在[minZoomLevel, maxZoomLevel]范围内.
Returns
对应的距离(单位是米)

◆ regionThatFits:

- (MACoordinateRegion) regionThatFits: (MACoordinateRegion region

根据当前地图视图frame的大小调整region范围

Parameters
region要调整的经纬度范围
Returns
调整后的经纬度范围

◆ reloadInternalTexture

- (void) reloadInternalTexture

重新加载内部纹理,在纹理被错误释放时可以执行此方法。(since 5.4.0)

◆ reloadMap

- (void) reloadMap

重新加载地图

将离线地图解压到 Documents/3dvmap/ 目录下后,调用此函数使离线数据生效, 对应的回调分别是 offlineDataWillReload:(MAMapView *)mapView, offlineDataDidReload:(MAMapView *)mapView.

◆ satelliteImageApprovalNumber

- (NSString *) satelliteImageApprovalNumber

获取卫星图片审图号。(since 5.4.0)

Returns
卫星图片审图号

◆ setCameraDegree:animated:duration:

- (void) setCameraDegree: (CGFloat)  cameraDegree
animated: (BOOL)  animated
duration: (CFTimeInterval)  duration 

设置地图相机角度(范围为[0.f, 60.f],但高于40度的角度需要在16级以上才能生效)

Parameters
cameraDegree要设置的相机角度
animated是否动画
duration动画时间

◆ setCenterCoordinate:animated:

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

设置当前地图的中心点,改变该值时,地图的比例尺级别不会发生变化

Parameters
coordinate要设置的中心点
animated是否动画设置

◆ setCompassImage:

- (void) setCompassImage: (UIImage *)  image

设置指南针的图片

Parameters
image新的指南针图片

◆ setConstructingRoadEnable:

- (void) setConstructingRoadEnable: (BOOL)  enabled

设置在建道路图层是否显示。默认NO(since 7.7.0)

Parameters
enabled是否显示

◆ setMapStatus:animated:

- (void) setMapStatus: (MAMapStatus *)  status
animated: (BOOL)  animated 

设置地图状态

Parameters
status要设置的地图状态
animated是否动画

◆ setMapStatus:animated:duration:

- (void) setMapStatus: (MAMapStatus *)  status
animated: (BOOL)  animated
duration: (CFTimeInterval)  duration 

设置地图状态

Parameters
status要设置的地图状态
animated是否动画
duration动画时间,默认动画时间为0.35s

◆ setRegion:animated:

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

设定当前地图的经纬度范围,该范围可能会被调整为适合地图窗口显示的范围

Parameters
region要设定的经纬度范围
animated是否动画设置

◆ setRotationDegree:animated:duration:

- (void) setRotationDegree: (CGFloat)  rotationDegree
animated: (BOOL)  animated
duration: (CFTimeInterval)  duration 

设置地图旋转角度(逆时针为正向)

Parameters
rotationDegree旋转角度, 如当前角度是0,720表示逆时针旋转2周,-720表示正时针旋转2周
animated动画
duration动画时间

◆ setVisibleMapRect:animated:

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

设置可见区域

Parameters
mapRect要设定的可见区域
animated是否动画设置

◆ setVisibleMapRect:edgePadding:animated:

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

设置可见地图矩形区域

Parameters
insets边缘插入
mapRect要显示的地图矩形区域
animated是否动画效果

◆ setVisibleMapRect:edgePadding:animated:duration:

- (void) setVisibleMapRect: (MAMapRect mapRect
edgePadding: (UIEdgeInsets)  insets
animated: (BOOL)  animated
duration: (CFTimeInterval)  duration 

设置可见地图矩形区域

Parameters
insets边缘插入
mapRect要显示的地图矩形区域
animated是否动画效果
duration动画时长,单位秒

◆ setZoomLevel:animated:

- (void) setZoomLevel: (CGFloat)  zoomLevel
animated: (BOOL)  animated 

设置缩放级别(默认3-19,有室内地图时为3-20)

Parameters
zoomLevel要设置的缩放级别
animated是否动画设置

◆ setZoomLevel:atPivot:animated:

- (void) setZoomLevel: (CGFloat)  zoomLevel
atPivot: (CGPoint)  pivot
animated: (BOOL)  animated 

根据指定的枢纽点来缩放地图

Parameters
zoomLevel缩放级别
pivot枢纽点(基于地图view的坐标系)
animated是否动画

◆ takeSnapshotInRect:

- (UIImage *) takeSnapshotInRect: ((deprecated("已废弃,请使用takeSnapshotInRect:withCompletionBlock:方法 since 6.0.0")))  __attribute

在指定区域内截图(默认会包含该区域内的annotationView),注意不要在地图回调方法内直接调用

Parameters
rect指定的区域
Returns
截图image

◆ takeSnapshotInRect:timeoutInterval:completionBlock:

- (void) takeSnapshotInRect: (CGRect)  rect
timeoutInterval: (NSTimeInterval)  timeout
completionBlock: (void(^)(UIImage *resultImage, NSInteger state))  block 

异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调 (since 7.8.0)

Parameters
rect指定的区域
timeout超时时间
block回调block(resultImage:返回的图片,state:0载入不完整,1完整)

◆ takeSnapshotInRect:withCompletionBlock:

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

异步在指定区域内截图(默认会包含该区域内的annotationView), 地图载入完整时回调

Parameters
rect指定的区域
block回调block(resultImage:返回的图片,state:0载入不完整,1完整)

◆ terrainApprovalNumber

- (NSString *) terrainApprovalNumber

获取地形图审图号。(since 8.2.0)

Returns
地形图审图号

◆ updatePrivacyAgree:

+ (void) updatePrivacyAgree: (AMapPrivacyAgreeStatus)  agreeStatus

更新用户授权高德SDK隐私协议状态. 注意:必须在MAMapView实例化之前调用 since 8.1.0

Parameters
agreeStatus用户授权高德SDK隐私协议状态

◆ updatePrivacyShow:privacyInfo:

+ (void) updatePrivacyShow: (AMapPrivacyShowStatus)  showStatus
privacyInfo: (AMapPrivacyInfoStatus)  containStatus 

更新App是否显示隐私弹窗的状态,隐私弹窗是否包含高德SDK隐私协议内容的状态. 注意:必须在MAMapView实例化之前调用 since 8.1.0

Parameters
showStatus隐私弹窗状态
containStatus包含高德SDK隐私协议状态

Property Documentation

◆ cameraDegree

- (CGFloat) cameraDegree
readwritenonatomicassign

设置地图相机角度(范围为[0.f, 60.f],但高于40度的角度需要在16级以上才能生效)

◆ centerCoordinate

- (CLLocationCoordinate2D) centerCoordinate
readwritenonatomicassign

当前地图的中心点,改变该值时,地图的比例尺级别不会发生变化

◆ compassOrigin

- (CGPoint) compassOrigin
readwritenonatomicassign

指南针原点位置

◆ compassSize

- (CGSize) compassSize
readnonatomicassign

指南针的宽高

◆ delegate

- (id<MAMapViewDelegate>) delegate
readwritenonatomicweak

地图view的delegate

◆ isAbroad

- (BOOL) isAbroad
readnonatomicassign

标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域

◆ isAllowDecreaseFrame

- (BOOL) isAllowDecreaseFrame
readwritenonatomicassign

是否允许降帧,默认为YES

◆ limitMapRect

- (MAMapRect) limitMapRect
readwritenonatomicassign

设置可见地图区域的矩形边界,如限制地图只显示北京市范围

◆ limitRegion

- (MACoordinateRegion) limitRegion
readwritenonatomicassign

设置可见地图区域的矩形边界,如限制地图只显示北京市范围

◆ logoCenter

- (CGPoint) logoCenter
readwritenonatomicassign

logo位置, 必须在mapView.bounds之内,否则会被忽略

◆ logoSize

- (CGSize) logoSize
readnonatomicassign

logo的宽高

◆ mapLanguage

- (NSNumber*) mapLanguage
readwritenonatomicstrong

设置语言。中文:@0: 英文:@1. 英文使用注意事项:1、不能和自定义地图样式同时使用;2、英文状态只在MAMapTypeStandard生效

◆ mapType

- (MAMapType) mapType
readwritenonatomicassign

地图类型。注意:自定义样式优先级高于mapType,如开启了自定义样式,要关闭自定义样式后mapType才生效

◆ maxRenderFrame

- (NSUInteger) maxRenderFrame
readwritenonatomicassign

最大帧数,有效的帧数为:60、30、20、10等能被60整除的数。默认为60

◆ maxZoomLevel

- (CGFloat) maxZoomLevel
readwritenonatomicassign

最大缩放级别(有室内地图时最大为20,否则为19)

◆ metalEnabled

- (BOOL) metalEnabled
readwritenonatomicassign

标记是否开启metal,默认NO. 注意:因机型或系统限制(要求机型最低5S,系统最低iOS10),开启metal可能失败。

◆ metersPerPointForCurrentZoom

- (double) metersPerPointForCurrentZoom
readnonatomicassign

在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米)

◆ minZoomLevel

- (CGFloat) minZoomLevel
readwritenonatomicassign

最小缩放级别

◆ region

- (MACoordinateRegion) region
readwritenonatomicassign

当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围

◆ renderringDisabled

- (BOOL) renderringDisabled
readwritenonatomicassign

停止/开启 地图绘制, 默认NO.

◆ rotateCameraEnabled

- (BOOL) rotateCameraEnabled
readwritenonatomicassign

是否支持camera旋转, 默认YES

◆ rotateEnabled

- (BOOL) rotateEnabled
readwritenonatomicassign

是否支持旋转, 默认YES

◆ rotationDegree

- (CGFloat) rotationDegree
readwritenonatomicassign

设置地图旋转角度(逆时针为正向)

◆ runLoopMode

- (NSRunLoopMode) runLoopMode
readwritenonatomiccopy

地图渲染的runloop mode,默认为NSRunLoopCommonModes。如果是和UIScrollView一起使用且不希望地图在scrollView拖动时渲染,请设置此值为NSDefaultRunLoopMode。(since 5.1.0)

◆ scaleOrigin

- (CGPoint) scaleOrigin
readwritenonatomicassign

比例尺原点位置

◆ scaleSize

- (CGSize) scaleSize
readnonatomicassign

比例尺的最大宽高

◆ screenAnchor

- (CGPoint) screenAnchor
readwritenonatomicassign

地图的视图锚点。坐标系归一化,(0, 0)为MAMapView左上角,(1, 1)为右下角。默认为(0.5, 0.5),即当前地图的视图中心 (since 5.0.0)

◆ scrollEnabled

- (BOOL) scrollEnabled
readwritenonatomicassign

是否支持平移, 默认YES

◆ showsBuildings

- (BOOL) showsBuildings
readwritenonatomicassign

是否显示楼块,默认为YES

◆ showsCompass

- (BOOL) showsCompass
readwritenonatomicassign

是否显示指南针, 默认YES

◆ showsLabels

- (BOOL) showsLabels
readwritenonatomicassign

是否显示底图标注, 默认为YES

◆ showsScale

- (BOOL) showsScale
readwritenonatomicassign

是否显示比例尺, 默认YES

◆ showTraffic

- (BOOL) showTraffic
readwritenonatomicassign

是否显示交通路况图层, 默认为NO

◆ terrainAuth

- (BOOL) terrainAuth
readnonatomicassign

是否有地形图授权,默认YES. 如果没有授权会回调MAMapViewDelegate的 - (void)mapView:(MAMapView *)mapView didFailLoadTerrainWithError:(NSError *)error 方法 (since 9.3.1)

◆ terrainEnabled

- (BOOL) terrainEnabled
readwritenonatomicassign

是否打开地形图,默认NO. 注意:需在地图创建前设置 (since 8.2.0)

◆ touchPOIEnabled

- (BOOL) touchPOIEnabled
readwritenonatomicassign

是否支持单击地图获取POI信息(默认为YES), 对应的回调是 -(void)mapView:(MAMapView *) didTouchPois:(NSArray *)

◆ visibleMapRect

- (MAMapRect) visibleMapRect
readwritenonatomicassign

可见区域, 设定的该范围可能会被调整为适合地图窗口显示的范围

◆ zoomEnabled

- (BOOL) zoomEnabled
readwritenonatomicassign

是否支持缩放, 默认YES

◆ zoomingInPivotsAroundAnchorPoint

- (BOOL) zoomingInPivotsAroundAnchorPoint
readwritenonatomicassign

是否以screenAnchor点作为锚点进行缩放,默认为YES。如果为NO,则以手势中心点作为锚点

◆ zoomLevel

- (CGFloat) zoomLevel
readwritenonatomicassign

缩放级别(默认3-19,有室内地图时为3-20)


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