|
iOS高德地图SDK(2D)
v5.6.0
|
#import <MAMapView.h>
Instance Methods | |
| (void) | - setCompassImage: |
| 设置罗盘的图像 More... | |
| (CGFloat) | - metersPerPointForZoomLevel: |
| 在指定的缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米) More... | |
| (void) | - setCenterCoordinate:animated: |
| 设定地图中心点经纬度 More... | |
| (void) | - setRegion:animated: |
| 设定当前地图的region More... | |
| (MACoordinateRegion) | - regionThatFits: |
| 根据当前地图视图frame的大小调整region范围,返回适合当前地图frame的region,调整过程中当前地图的中心点不会改变 More... | |
| (void) | - setVisibleMapRect:animated: |
| 设置当前地图可见范围的map rect More... | |
| (void) | - setVisibleMapRect:edgePadding:animated: |
| 设置当前地图可见范围的map rect More... | |
| (MAMapRect) | - mapRectThatFits: |
| 调整map rect使其适合地图窗口显示的范围 More... | |
| (MAMapRect) | - mapRectThatFits:edgePadding: |
| 调整map rect使其适合地图窗口显示的范围 More... | |
| (void) | - setZoomLevel:animated: |
| 设置当前地图的缩放级别zoom level More... | |
| (void) | - setZoomLevel:atPivot:animated: |
| 设置当前地图的缩放级别zoom level More... | |
| (CGPoint) | - convertCoordinate:toPointToView: |
| 将经纬度坐标转化为相对于指定view的坐标 More... | |
| (CLLocationCoordinate2D) | - convertPoint:toCoordinateFromView: |
| 将相对于view的坐标转化为经纬度坐标 More... | |
| (CGRect) | - convertRegion:toRectToView: |
| 将map rect 转化为相对于view的坐标 More... | |
| (MACoordinateRegion) | - convertRect:toRegionFromView: |
| 将相对于view的rectangle转化为region More... | |
| (void) | - setUserTrackingMode:animated: |
| 设置追踪用户位置的模式 More... | |
| (void) | - updateUserLocationRepresentation: |
| 设定UserLocationView样式。如果用户自定义了userlocation的annotationView,或者该annotationView还未添加到地图上,此方法将不起作用 More... | |
| (void) | - addAnnotation: |
| 向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View More... | |
| (void) | - addAnnotations: |
| 向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View More... | |
| (void) | - removeAnnotation: |
| 移除标注 More... | |
| (void) | - removeAnnotations: |
| 移除一组标注 More... | |
| (MAAnnotationView *) | - viewForAnnotation: |
| 根据标注数据过去标注view More... | |
| (MAAnnotationView *) | - dequeueReusableAnnotationViewWithIdentifier: |
| 从复用内存池中获取制定复用标识的annotation view More... | |
| (void) | - selectAnnotation:animated: |
| 选中标注数据对应的view More... | |
| (void) | - deselectAnnotation:animated: |
| 取消选中标注数据对应的view More... | |
| (NSSet *) | - annotationsInMapRect: |
| 获取指定投影矩形范围内的标注 More... | |
| (void) | - showAnnotations:animated: |
| 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置 More... | |
| (void) | - showAnnotations:edgePadding:animated: |
| 设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置 More... | |
| (MAOverlayRenderer *) | - rendererForOverlay: |
| 查找指定overlay对应的Renderer,如果该Renderer尚未创建,返回nil More... | |
| (MAOverlayView *) | - viewForOverlay: |
| (void) | - addOverlay: |
| 向地图添加Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer More... | |
| (void) | - addOverlays: |
| 向地图添加一组Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer More... | |
| (void) | - removeOverlay: |
| 移除Overlay More... | |
| (void) | - removeOverlays: |
| 移除一组Overlay More... | |
| (void) | - insertOverlay:atIndex: |
| 在指定的索引处添加一个Overlay More... | |
| (void) | - exchangeOverlayAtIndex:withOverlayAtIndex: |
| 在交换指定索引处的Overlay More... | |
| (void) | - insertOverlay:aboveOverlay: |
| 在指定的Overlay之上插入一个overlay More... | |
| (void) | - insertOverlay:belowOverlay: |
| 在指定的Overlay之下插入一个overlay More... | |
| (void) | - showOverlays:animated: |
| 设置地图使其可以显示数组中所有的overlay More... | |
| (void) | - showOverlays:edgePadding:animated: |
| 设置地图使其可以显示数组中所有的overlay More... | |
| (void) | - clearDisk |
| 清除所有磁盘上缓存的地图数据 More... | |
| (UIImage *) | - takeSnapshotInRect: |
| 在指定区域内截图(默认会包含该区域内的annotationView) More... | |
| (void) | - takeSnapshotInRect:withCompletionBlock: |
| 获得地图当前可视区域截图 More... | |
Properties | |
| id< MAMapViewDelegate > | delegate |
| 地图View的Delegate More... | |
| MAMapType | mapType |
| 地图类型 More... | |
| MAMapLanguage | language |
| 地图语言 More... | |
| BOOL | showTraffic |
| 是否显示交通,默认为NO More... | |
| BOOL | scrollEnabled |
| 是否支持平移,默认为YES More... | |
| BOOL | zoomEnabled |
| 是否支持缩放,默认为YES More... | |
| BOOL | isAbroad |
| 标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域 More... | |
| BOOL | allowsAnnotationViewSorting |
| 是否允许对annotationView根据zIndex进行排序,默认为YES。当annotationView数量比较大时可能会引起性能问题,可以设置此属性为NO More... | |
| CGPoint | logoCenter |
| logo位置, 必须在mapView.bounds之内,否则会被忽略 More... | |
| CGSize | logoSize |
| logo的宽高 More... | |
| BOOL | showsCompass |
| 是否显示罗盘,默认为YES More... | |
| CGPoint | compassOrigin |
| 罗盘原点位置 More... | |
| CGSize | compassSize |
| 罗盘的宽高 More... | |
| BOOL | showsScale |
| 是否显示比例尺,默认为YES More... | |
| CGPoint | scaleOrigin |
| 比例尺原点位置 More... | |
| CGSize | scaleSize |
| 比例尺的最大宽高 More... | |
| CGFloat | metersPerPointForCurrentZoomLevel |
| 在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米). 支持KVO More... | |
| CLLocationCoordinate2D | centerCoordinate |
| 当前地图的中心点经纬度坐标,改变该值时,地图缩放级别不会发生变化 More... | |
| MACoordinateRegion | region |
| 当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围 More... | |
| MAMapRect | visibleMapRect |
| 当前地图可见范围的map rect More... | |
| MACoordinateRegion | limitRegion |
| 设置可见地图区域的矩形边界,如限制地图只显示北京市范围 More... | |
| MAMapRect | limitMapRect |
| 设置可见地图区域的矩形边界,如限制地图只显示北京市范围 More... | |
| double | zoomLevel |
| 缩放级别, [3, 20] More... | |
| double | minZoomLevel |
| 最小缩放级别, 最小值为3 More... | |
| double | maxZoomLevel |
| 最大缩放级别,最大值为20 More... | |
| BOOL | showsUserLocation |
| 是否显示用户位置 More... | |
| MAUserLocation * | userLocation |
| 当前的位置数据 More... | |
| MAUserTrackingMode | userTrackingMode |
| 定位用户位置的模式 More... | |
| BOOL | userLocationVisible |
| 当前位置再地图中是否可见 More... | |
| NSArray * | annotations |
| 标注数组 More... | |
| NSArray * | selectedAnnotations |
| 处于选中状态的标注数据数据(其count == 0 或 1) More... | |
| CGRect | annotationVisibleRect |
| annotation 可见区域 More... | |
| NSArray * | overlays |
| Overlay数组 More... | |
| CLLocationDistance | distanceFilter |
| 设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动 More... | |
| CLLocationAccuracy | desiredAccuracy |
| 设定定位精度。默认为kCLLocationAccuracyBest More... | |
| CLLocationDegrees | headingFilter |
| 设定最小更新角度。默认为1度,设定为kCLHeadingFilterNone会提示任何角度改变 More... | |
| BOOL | pausesLocationUpdatesAutomatically |
| 指定定位是否会被系统自动暂停。默认为YES。只在iOS 6.0之后起作用 More... | |
| BOOL | allowsBackgroundLocationUpdates |
| 是否允许后台定位。默认为NO。只在iOS 9.0之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates处于选中状态,否则会抛出异常 More... | |
| - (void) addAnnotation: | (id< MAAnnotation >) | annotation |
向地图窗口添加标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
| annotation | 要添加的标注 |
| - (void) addAnnotations: | (NSArray *) | annotations |
向地图窗口添加一组标注,需要实现MAMapViewDelegate的-mapView:viewForAnnotation:函数来生成标注对应的View
| annotations | 要添加的标注数组 |
| - (void) addOverlay: | (id< MAOverlay >) | overlay |
向地图添加Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
| overlay | 要添加的overlay |
| - (void) addOverlays: | (NSArray *) | overlays |
向地图添加一组Overlay,需要实现MAMapViewDelegate的-mapView:rendererForOverlay:函数来生成标注对应的Renderer
| overlays | 要添加的overlay数组 |
| - (NSSet *) annotationsInMapRect: | (MAMapRect) | mapRect |
获取指定投影矩形范围内的标注
| mapRect | 投影矩形范围 |
| - (void) clearDisk |
清除所有磁盘上缓存的地图数据
| - (CGPoint) convertCoordinate: | (CLLocationCoordinate2D) | coordinate | |
| toPointToView: | (UIView *) | view | |
将经纬度坐标转化为相对于指定view的坐标
| coordinate | 要转化的经纬度坐标 |
| view | 指定的坐标系统的view |
| - (CLLocationCoordinate2D) convertPoint: | (CGPoint) | point | |
| toCoordinateFromView: | (UIView *) | view | |
将相对于view的坐标转化为经纬度坐标
| point | 要转化的坐标 |
| view | point所基于的view |
| - (MACoordinateRegion) convertRect: | (CGRect) | rect | |
| toRegionFromView: | (UIView *) | view | |
将相对于view的rectangle转化为region
| rect | 要转化的rectangle |
| view | rectangle所基于的view |
| - (CGRect) convertRegion: | (MACoordinateRegion) | region | |
| toRectToView: | (UIView *) | view | |
将map rect 转化为相对于view的坐标
| region | 要转化的 map rect |
| view | 返回值所基于的view |
| - (MAAnnotationView *) dequeueReusableAnnotationViewWithIdentifier: | (NSString *) | identifier |
从复用内存池中获取制定复用标识的annotation view
| identifier | 复用标识 |
| - (void) deselectAnnotation: | (id< MAAnnotation >) | annotation | |
| animated: | (BOOL) | animated | |
取消选中标注数据对应的view
| annotation | 标注数据 |
| animated | 是否有动画效果 |
| - (void) exchangeOverlayAtIndex: | (NSUInteger) | index1 | |
| withOverlayAtIndex: | (NSUInteger) | index2 | |
在交换指定索引处的Overlay
| index1 | 索引1 |
| index2 | 索引2 |
| - (void) insertOverlay: | (id< MAOverlay >) | overlay | |
| aboveOverlay: | (id< MAOverlay >) | sibling | |
在指定的Overlay之上插入一个overlay
| overlay | 带添加的Overlay |
| sibling | 用于指定相对位置的Overlay |
| - (void) insertOverlay: | (id< MAOverlay >) | overlay | |
| atIndex: | (NSUInteger) | index | |
在指定的索引处添加一个Overlay
| overlay | 要添加的overlay |
| index | 指定的索引 |
| - (void) insertOverlay: | (id< MAOverlay >) | overlay | |
| belowOverlay: | (id< MAOverlay >) | sibling | |
在指定的Overlay之下插入一个overlay
| overlay | 带添加的Overlay |
| sibling | 用于指定相对位置的Overlay |
调整map rect使其适合地图窗口显示的范围
| mapRect | 要调整的map rect |
| - (MAMapRect) mapRectThatFits: | (MAMapRect) | mapRect | |
| edgePadding: | (UIEdgeInsets) | insets | |
调整map rect使其适合地图窗口显示的范围
| mapRect | 要调整的map rect |
| insets | 嵌入边界 |
| - (CGFloat) metersPerPointForZoomLevel: | (CGFloat) | zoomLevel |
在指定的缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米)
| zoomLevel | 指定的缩放级别, 在[minZoomLevel, maxZoomLevel]范围内 |
| - (MACoordinateRegion) regionThatFits: | (MACoordinateRegion) | region |
根据当前地图视图frame的大小调整region范围,返回适合当前地图frame的region,调整过程中当前地图的中心点不会改变
| region | 要调整的经纬度范围 |
| - (void) removeAnnotation: | (id< MAAnnotation >) | annotation |
移除标注
| annotation | 要移除的标注 |
| - (void) removeAnnotations: | (NSArray *) | annotations |
移除一组标注
| annotations | 要移除的标注数组 |
| - (void) removeOverlay: | (id< MAOverlay >) | overlay |
移除Overlay
| overlay | 要移除的overlay |
| - (void) removeOverlays: | (NSArray *) | overlays |
移除一组Overlay
| overlays | 要移除的overlay数组 |
| - (MAOverlayRenderer *) rendererForOverlay: | (id< MAOverlay >) | overlay |
查找指定overlay对应的Renderer,如果该Renderer尚未创建,返回nil
| overlay | 指定的overlay |
| - (void) selectAnnotation: | (id< MAAnnotation >) | annotation | |
| animated: | (BOOL) | animated | |
选中标注数据对应的view
| annotation | 标注数据 8 |
| animated | 是否有动画效果 |
| - (void) setCenterCoordinate: | (CLLocationCoordinate2D) | centerCoordinate | |
| animated: | (BOOL) | animated | |
设定地图中心点经纬度
| centerCoordinate | 要设定的地图中心点经纬度 |
| animated | 是否采用动画效果 |
| - (void) setCompassImage: | (UIImage *) | image |
设置罗盘的图像
| image | 当设置图像非空时,指南针将呈现该图像,如果为nil时,则恢复默认 |
| - (void) setRegion: | (MACoordinateRegion) | region | |
| animated: | (BOOL) | animated | |
设定当前地图的region
| region | 要设定的地图范围,用经纬度的方式表示 |
| animated | 是否采用动画效果 |
| - (void) setUserTrackingMode: | (MAUserTrackingMode) | mode | |
| animated: | (BOOL) | animated | |
设置追踪用户位置的模式
| mode | 要使用的模式 |
| animated | 是否采用动画效果 |
| - (void) setVisibleMapRect: | (MAMapRect) | mapRect | |
| animated: | (BOOL) | animated | |
设置当前地图可见范围的map rect
| mapRect | 要调整的map rect |
| animated | 是否采用动画效果 |
| - (void) setVisibleMapRect: | (MAMapRect) | mapRect | |
| edgePadding: | (UIEdgeInsets) | insets | |
| animated: | (BOOL) | animated | |
设置当前地图可见范围的map rect
| mapRect | 要设置的map rect |
| insets | 嵌入边界 |
| animated | 是否采用动画效果 |
| - (void) setZoomLevel: | (double) | newZoomLevel | |
| animated: | (BOOL) | animated | |
设置当前地图的缩放级别zoom level
| newZoomLevel | 要设置的zoom level |
| animated | 是否采用动画效果 |
| - (void) setZoomLevel: | (double) | newZoomLevel | |
| atPivot: | (CGPoint) | pivot | |
| animated: | (BOOL) | animated | |
设置当前地图的缩放级别zoom level
| newZoomLevel | 要设置的zoom level |
| pivot | 指定缩放的锚点,屏幕坐标 |
| animated | 是否采用动画效果 |
| - (void) showAnnotations: | (NSArray *) | annotations | |
| animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置
| annotations | 需要显示的annotation |
| animated | 是否执行动画 |
| - (void) showAnnotations: | (NSArray *) | annotations | |
| edgePadding: | (UIEdgeInsets) | insets | |
| animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的annotation, 如果数组中只有一个则直接设置地图中心为annotation的位置
| annotations | 需要显示的annotation |
| insets | insets 嵌入边界 |
| animated | 是否执行动画 |
| - (void) showOverlays: | (NSArray *) | overlays | |
| animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的overlay
| overlays | 需要显示的overlays |
| animated | 是否执行动画 |
| - (void) showOverlays: | (NSArray *) | overlays | |
| edgePadding: | (UIEdgeInsets) | insets | |
| animated: | (BOOL) | animated | |
设置地图使其可以显示数组中所有的overlay
| overlays | 需要显示的overlays |
| insets | insets 嵌入边界 |
| animated | 是否执行动画 |
| - (UIImage *) takeSnapshotInRect: | (CGRect) | rect |
在指定区域内截图(默认会包含该区域内的annotationView)
| rect | 指定的区域 |
Provided by category MAMapView(Snapshot).
| - (void) takeSnapshotInRect: | (CGRect) | rect | |
| withCompletionBlock: | (void(^)(UIImage *resultImage, CGRect rect)) | block | |
| - (void) updateUserLocationRepresentation: | (MAUserLocationRepresentation *) | representation |
设定UserLocationView样式。如果用户自定义了userlocation的annotationView,或者该annotationView还未添加到地图上,此方法将不起作用
| representation | 样式信息对象 |
| - (MAAnnotationView *) viewForAnnotation: | (id< MAAnnotation >) | annotation |
根据标注数据过去标注view
| annotation | 标注数据 |
| - (MAOverlayView *) viewForOverlay: | ((deprecated("use -(MAOverlayRenderer *)rendererForOverlay:(id <MAOverlay>)overlay instead"))) | __attribute__ |
|
readwritenonatomicassign |
是否允许对annotationView根据zIndex进行排序,默认为YES。当annotationView数量比较大时可能会引起性能问题,可以设置此属性为NO
|
readwritenonatomicassign |
是否允许后台定位。默认为NO。只在iOS 9.0之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates处于选中状态,否则会抛出异常
Provided by category MAMapView(LocationOption).
|
readnonatomicassign |
标注数组
|
readnonatomicassign |
annotation 可见区域
|
readwritenonatomicassign |
当前地图的中心点经纬度坐标,改变该值时,地图缩放级别不会发生变化
|
readwritenonatomicassign |
罗盘原点位置
|
readnonatomicassign |
罗盘的宽高
|
readwritenonatomicweak |
地图View的Delegate
|
readwritenonatomicassign |
设定定位精度。默认为kCLLocationAccuracyBest
Provided by category MAMapView(LocationOption).
|
readwritenonatomicassign |
设定定位的最小更新距离。默认为kCLDistanceFilterNone,会提示任何移动
Provided by category MAMapView(LocationOption).
|
readwritenonatomicassign |
设定最小更新角度。默认为1度,设定为kCLHeadingFilterNone会提示任何角度改变
Provided by category MAMapView(LocationOption).
|
readnonatomicassign |
标识当前地图中心位置是否在中国范围外。此属性不是精确判断,不能用于边界区域
|
readwritenonatomicassign |
地图语言
|
readwritenonatomicassign |
设置可见地图区域的矩形边界,如限制地图只显示北京市范围
|
readwritenonatomicassign |
设置可见地图区域的矩形边界,如限制地图只显示北京市范围
|
readwritenonatomicassign |
logo位置, 必须在mapView.bounds之内,否则会被忽略
|
readnonatomicassign |
logo的宽高
|
readwritenonatomicassign |
地图类型
|
readwritenonatomicassign |
最大缩放级别,最大值为20
|
readnonatomicassign |
在当前缩放级别下, 基于地图中心点, 1 screen point 对应的距离(单位是米). 支持KVO
|
readwritenonatomicassign |
最小缩放级别, 最小值为3
|
readnonatomicassign |
Overlay数组
|
readwritenonatomicassign |
指定定位是否会被系统自动暂停。默认为YES。只在iOS 6.0之后起作用
Provided by category MAMapView(LocationOption).
|
readwritenonatomicassign |
当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围
|
readwritenonatomicassign |
比例尺原点位置
|
readnonatomicassign |
比例尺的最大宽高
|
readwritenonatomicassign |
是否支持平移,默认为YES
|
readwritenonatomiccopy |
处于选中状态的标注数据数据(其count == 0 或 1)
|
readwritenonatomicassign |
是否显示罗盘,默认为YES
|
readwritenonatomicassign |
是否显示比例尺,默认为YES
|
readwritenonatomicassign |
是否显示用户位置
|
readwritenonatomicassign |
是否显示交通,默认为NO
|
readnonatomicassign |
当前的位置数据
|
readnonatomicassign |
当前位置再地图中是否可见
|
readwritenonatomicassign |
定位用户位置的模式
|
readwritenonatomicassign |
当前地图可见范围的map rect
|
readwritenonatomicassign |
是否支持缩放,默认为YES
|
readwritenonatomicassign |
缩放级别, [3, 20]