BaiduMap_IOSSDK_v6.5.2_Docs  6.5.2
构造函数 | 类方法 | 属性 | 所有成员列表
BMKMapView类 参考

地图View类,使用此View可以显示地图窗口,并且对地图进行相关的操作 更多...

#import <BMKMapView.h>

类 BMKMapView 继承关系图:

构造函数

(BOOL) - setCustomTrafficColorForSmooth:slow:congestion:severeCongestion:
 
(void) - viewWillAppear
 当mapview即将被显式的时候调用,恢复之前存储的mapview状态。 更多...
 
(void) - viewWillDisappear
 当mapview即将被隐藏的时候调用,存储当前mapview的状态。 更多...
 
(void) - mapForceRefresh
 强制刷新mapview 更多...
 
(BOOL) - zoomIn
 
(BOOL) - zoomOut
 
(BMKCoordinateRegion- regionThatFits:
 此接口什么都没做,已废弃。 更多...
 
(void) - setRegion:animated:
 
(void) - setCenterCoordinate:animated:
 
(nullable UIImage *) - takeSnapshot
 
(nullable UIImage *) - takeSnapshot:
 
(void) - setCompassImage:
 
(void) - setVisibleMapRect:animated:
 
(BMKMapRect- mapRectThatFits:
 此方法什么都没做,已废弃 更多...
 
(void) - setVisibleMapRect:edgePadding:animated:
 
(void) - fitVisibleMapRect:edgePadding:withAnimated:
 
(BMKMapRect- mapRectThatFits:edgePadding:
 
(CGPoint) - convertCoordinate:toPointToView:
 
(CLLocationCoordinate2D) - convertPoint:toCoordinateFromView:
 
(CGRect) - convertRegion:toRectToView:
 
(BMKCoordinateRegion- convertRect:toRegionFromView:
 
(CGRect) - convertMapRect:toRectToView:
 
(BMKMapRect- convertRect:toMapRectFromView:
 
(CGPoint) - screenPointFromMapPoint3:
 
(CGPoint) - glPointForMapPoint:
 
(CGPoint *) - glPointsForMapPoints:count:
 
(void) - setMapCenterToScreenPt:
 
(BMKMapStatus *) - getMapStatusFromCoordinateRegion:edgePadding:
 
(BMKMapStatus *) - getMapStatus
 
(void) - setMapStatus:
 
(void) - setMapStatus:withAnimation:
 
(void) - setMapStatus:withAnimation:withAnimationTime:
 
(BOOL) - isSurpportBaiduHeatMap
 
(float *) - getProjectionMatrix
 
(float *) - getViewMatrix
 
(void) - addAnnotation:
 
(void) - addAnnotations:
 
(void) - removeAnnotation:
 
(void) - removeAnnotations:
 
(nullable BMKAnnotationView *) - viewForAnnotation:
 
(nullable BMKAnnotationView *) - dequeueReusableAnnotationViewWithIdentifier:
 
(void) - selectAnnotation:animated:
 
(void) - deselectAnnotation:animated:
 
(void) - showAnnotations:animated:
 
(nullable NSArray< id< BMKAnnotation >> *) - annotationsInCoordinateBounds:
 
(void) - setCustomMapStylePath:
 
(void) - setCustomMapStylePath:mode:
 
(void) - setCustomMapStyleEnable:
 
(void) - setCustomMapStyleWithOption:preLoad:success:failure:
 
(void) - addHeatMap:
 
(void) - removeHeatMap
 移除热力图 更多...
 
(void) - startHeatMapFrameAnimation
 开始动画 更多...
 
(void) - stopHeatMapFrameAnimation
 暂停动画 更多...
 
(void) - setHeatMapFrameAnimationIndex:
 控制渲染帧索引 更多...
 
(BMKSwitchIndoorFloorError- switchBaseIndoorMapFloor:withID:
 
(nullable BMKBaseIndoorMapInfo *) - getFocusedBaseIndoorMapInfo
 
(void) - updateLocationViewWithParam:
 
(void) - updateLocationData:
 
(BOOL) - switchOverlayLayerAndNavigationLayer:
 
(BOOL) - switchOverlayLayerAndPOILayer:
 
(void) - addOverlay:
 
(void) - addOverlays:
 
(void) - removeOverlay:
 
(void) - removeOverlays:
 
(void) - insertOverlay:atIndex:
 
(void) - exchangeOverlayAtIndex:withOverlayAtIndex:
 
(void) - insertOverlay:aboveOverlay:
 
(void) - insertOverlay:belowOverlay:
 
(nullable BMKOverlayView *) - viewForOverlay:
 

类方法

(void) + customMapStyle:
 
(void) + enableCustomMapStyle:
 
("废弃方法(空实现),逻辑由地图SDK控制") + __deprecated_msg
 
("废弃方法(空实现),逻辑由地图SDK控制") + __deprecated_msg
 
(BOOL) + setBaiduMapSDKMetalEnable:
 

属性

id< BMKMapViewDelegatedelegate
 地图View的Delegate 更多...
 
id< BMKMapGestureDelegategestureDelegate
 地图View的手势Delegate 更多...
 
BMKMapType mapType
 当前地图类型,可设定为标准地图、卫星地图 更多...
 
BMKMapLanguageType languageType
 
BMKCoordinateRegion region
 当前地图的经纬度范围,设定的该范围可能会被调整为适合地图窗口显示的范围 更多...
 
BMKCoordinateRegion limitMapRegion
 限制地图的显示范围(地图状态改变时,该范围不会在地图显示范围外。设置成功后,会调整地图显示该范围) 更多...
 
CGPoint compassPosition
 指南针的位置,设定坐标以BMKMapView左上角为原点,向右向下增长 更多...
 
CGSize compassSize
 指南针的宽高 更多...
 
CLLocationCoordinate2D centerCoordinate
 当前地图的中心点,改变该值时,地图的比例尺级别不会发生变化 更多...
 
NSInteger fontSizeLevel
 
float zoomLevel
 地图比例尺级别,在手机上当前可使用的级别为4-21级 更多...
 
float minZoomLevel
 地图的自定义最小比例尺级别 更多...
 
float maxZoomLevel
 地图的自定义最大比例尺级别 更多...
 
int rotation
 地图旋转角度,在手机上当前可使用的范围为-180~180度 更多...
 
int overlooking
 地图俯视角度,在手机上当前可使用的范围为-45~0度 更多...
 
int minOverlooking
 地图俯视角度最小值(即角度最大值),在手机上当前可设置的范围为-79~0度 更多...
 
BOOL buildingsEnabled
 设定地图是否现显示3D楼块效果 更多...
 
BOOL showMapPoi
 设定地图是否显示底图poi标注(不包含室内图标注),默认YES 更多...
 
BOOL trafficEnabled
 设定地图是否打开路况图层 更多...
 
BOOL baiduHeatMapEnabled
 设定地图是否打开百度城市热力图图层(百度自有数据),注:地图层级大于11时,可显示热力图 更多...
 
BOOL gesturesEnabled
 设定地图View能否支持所有手势操作 更多...
 
BOOL zoomEnabled
 设定地图View能否支持用户多点缩放(双指) 更多...
 
BOOL zoomEnabledWithTap
 设定地图View能否支持用户缩放(双击或双指单击) 更多...
 
BOOL scrollEnabled
 设定地图View能否支持用户移动地图 更多...
 
BOOL overlookEnabled
 设定地图View能否支持俯仰角 更多...
 
BOOL rotateEnabled
 设定地图View能否支持旋转 更多...
 
BOOL forceTouchEnabled
 设定地图是否回调force touch事件,默认为NO,仅适用于支持3D Touch的情况,开启后会回调 - mapview:onForceTouch:force:maximumPossibleForce: 更多...
 
BOOL gestureZoomAnimationEnabled
 设定地图手势缩放是否需要动画,默认YES,设置为NO时手势缩放时将无动画 since 6.5.2 更多...
 
BOOL showMapScaleBar
 设定是否显式比例尺 更多...
 
CGPoint mapScaleBarPosition
 比例尺的位置,设定坐标以BMKMapView左上角为原点,向右向下增长 更多...
 
CGSize mapScaleBarSize
 比例尺的宽高 更多...
 
BMKLogoPosition logoPosition
 logo位置,默认BMKLogoPositionLeftBottom 更多...
 
BMKMapRect visibleMapRect
 当前地图范围,采用直角坐标系表示,向右向下增长 更多...
 
UIEdgeInsets mapPadding
 
BOOL updateTargetScreenPtWhenMapPaddingChanged
 设置mapPadding时,地图中心(屏幕坐标:BMKMapStatus.targetScreenPt)是否跟着改变,默认YES 更多...
 
BOOL ChangeWithTouchPointCenterEnabled
 
BOOL ChangeCenterWithDoubleTouchPointEnabled
 
NSArray< id< BMKAnnotation > > * annotations
 当前地图View的已经添加的标注数组 更多...
 
BOOL isSelectedAnnotationViewFront
 设定是否总让选中的annotaion置于最前面 更多...
 
BOOL baseIndoorMapEnabled
 设定地图是否显示室内图(包含室内图标注),默认不显示 更多...
 
BOOL showIndoorMapPoi
 设定室内图标注是否显示,默认YES,仅当显示室内图(baseIndoorMapEnabled为YES)时生效 更多...
 
BOOL showsUserLocation
 设定是否显示定位图层 更多...
 
BMKUserTrackingMode userTrackingMode
 设定定位模式,取值为:BMKUserTrackingMode 更多...
 
BOOL userLocationVisible
 返回定位坐标点是否在当前地图可视区域内 更多...
 
BOOL showOperateLayer
 地图是否展示运营图层默认YES,since 6.4.0 更多...
 
NSArray< id< BMKOverlay > > * overlays
 当前mapView中已经添加的Overlay数组 更多...
 

详细描述

地图View类,使用此View可以显示地图窗口,并且对地图进行相关的操作

函数文档

◆ __deprecated_msg [1/2]

+ ("废弃方法(空实现),逻辑由地图SDK控制") __deprecated_msg

2.10.0起废弃,空实现,逻辑由地图SDK控制 当应用即将后台时调用,停止一切调用opengl相关的操作。

◆ __deprecated_msg [2/2]

+ ("废弃方法(空实现),逻辑由地图SDK控制") __deprecated_msg

2.10.0起废弃,空实现,逻辑由地图SDK控制 当应用恢复前台状态时调用。

◆ addAnnotation:

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

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

参数
annotation要添加的标注

由 category BMKMapView(AnnotationAPI) 提供.

◆ addAnnotations:

- (void) addAnnotations: (NSArray< id< BMKAnnotation >> *)  annotations

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

参数
annotations要添加的标注数组

由 category BMKMapView(AnnotationAPI) 提供.

◆ addHeatMap:

- (void) addHeatMap: (BMKHeatMap *)  heatMap

添加热力图

参数
heatMap热力图绘制和显示数据

由 category BMKMapView(HeatMapAPI) 提供.

◆ addOverlay:

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

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

参数
overlay要添加的overlay

由 category BMKMapView(OverlaysAPI) 提供.

◆ addOverlays:

- (void) addOverlays: (NSArray< id< BMKOverlay >> *)  overlays

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

参数
overlays要添加的overlay数组

由 category BMKMapView(OverlaysAPI) 提供.

◆ annotationsInCoordinateBounds:

- (nullable NSArray<id <BMKAnnotation>> *) annotationsInCoordinateBounds: (BMKCoordinateBounds bounds

获取矩形区域内的所有annotations

参数
bounds矩形区域(经纬度)

由 category BMKMapView(AnnotationAPI) 提供.

◆ convertCoordinate:toPointToView:

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

将经纬度坐标转换为View坐标

参数
coordinate待转换的经纬度坐标
view指定相对的View
返回
转换后的View坐标

◆ convertMapRect:toRectToView:

- (CGRect) convertMapRect: (BMKMapRect mapRect
toRectToView: (UIView *)  view 

将直角地理坐标矩形区域转换为View矩形区域

参数
mapRect待转换的直角地理坐标矩形
view指定相对的View
返回
转换后的View矩形区域

◆ convertPoint:toCoordinateFromView:

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

将View坐标转换成经纬度坐标

参数
point待转换的View坐标
viewpoint坐标所在的view
返回
转换后的经纬度坐标

◆ convertRect:toMapRectFromView:

- (BMKMapRect) convertRect: (CGRect)  rect
toMapRectFromView: (UIView *)  view 

将View矩形区域转换成直角地理坐标矩形区域

参数
rect待转换的View矩形区域
viewrect坐标所在的view
返回
转换后的直角地理坐标矩形区域

◆ convertRect:toRegionFromView:

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

将View矩形区域转换成经纬度矩形区域

参数
rect待转换的View矩形区域
viewrect坐标所在的view
返回
转换后的经纬度矩形区域

◆ convertRegion:toRectToView:

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

将经纬度矩形区域转换为View矩形区域

参数
region待转换的经纬度矩形
view指定相对的View
返回
转换后的View矩形区域

◆ customMapStyle:

+ (void) customMapStyle: ("Please use -(void)setCustomMapStyleEnable:(BOOL)enable")  __deprecated_msg

设置自定义地图样式 since 6.0 空实现 注:必须在BMKMapView对象初始化之前调用

参数
customMapStyleJsonFilePath自定义样式文件所在路径,包含文件名

◆ dequeueReusableAnnotationViewWithIdentifier:

- (nullable BMKAnnotationView *) dequeueReusableAnnotationViewWithIdentifier: (NSString *)  identifier

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

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

由 category BMKMapView(AnnotationAPI) 提供.

◆ deselectAnnotation:animated:

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

取消指定的标注的选中状态,本版暂不支持animate效果

参数
annotation指定的标注
animated本版暂不支持

由 category BMKMapView(AnnotationAPI) 提供.

◆ enableCustomMapStyle:

+ (void) enableCustomMapStyle: ("Please use -(void)setCustomMapStylePath:(NSString *)customMapStyleFilePath")  __deprecated_msg

自定义地图样式开关,影响所有BMKMapView对象 since 6.0 空实现

参数
enable自定义地图样式是否生效

◆ exchangeOverlayAtIndex:withOverlayAtIndex:

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

在交换指定索引处的Overlay

参数
index1索引1
index2索引2

由 category BMKMapView(OverlaysAPI) 提供.

◆ fitVisibleMapRect:edgePadding:withAnimated:

- (void) fitVisibleMapRect: (BMKMapRect mapRect
edgePadding: (UIEdgeInsets)  insets
withAnimated: (BOOL)  animate 

根据当前mapView的窗口大小,预留insets指定的边界区域后,将mapRect指定的地理范围显示在剩余的区域内,并尽量充满

参数
mapRect要显示的地图范围,用直角坐标系表示
insets屏幕四周预留的边界大小(mapRect的内容不会显示在该边界范围内)
animate是否采用动画效果

◆ getFocusedBaseIndoorMapInfo

- (nullable BMKBaseIndoorMapInfo *) getFocusedBaseIndoorMapInfo

获取当前聚焦的室内图信息

返回
当前聚焦的室内图信息。没有聚焦的室内图,返回nil

由 category BMKMapView(IndoorMapAPI) 提供.

◆ getMapStatus

- (BMKMapStatus *) getMapStatus

获取地图状态

返回
返回地图状态信息

◆ getMapStatusFromCoordinateRegion:edgePadding:

- (BMKMapStatus *) getMapStatusFromCoordinateRegion: (BMKCoordinateRegion region
edgePadding: (UIEdgeInsets)  insets 

根据地理经纬度范围和边距计算BMKMapStatus

参数
region地理范围
insets边距
返回
BMKMapStatus

◆ getProjectionMatrix

- (float *) getProjectionMatrix

获取OpenGL映射矩阵 V5.0.0版本新增,用于3D绘制场景

返回
OpenGL映射矩阵数组

◆ getViewMatrix

- (float *) getViewMatrix

获取OpenGL视图矩阵 V5.0.0版本新增,用于3D绘制场景

返回
OpenGL视图矩阵数组

◆ glPointForMapPoint:

- (CGPoint) glPointForMapPoint: (BMKMapPoint mapPoint

将BMKMapPoint转换为opengles可以直接使用的坐标

参数
mapPointBMKMapPoint坐标
返回
opengles 直接支持的坐标

◆ glPointsForMapPoints:count:

- (CGPoint *) glPointsForMapPoints: (BMKMapPoint *)  mapPoints
count: (NSUInteger)  count 

批量将BMKMapPoint转换为opengles可以直接使用的坐标

参数
mapPointsBMKMapPoint坐标数据指针
count个数,count不能大于数组长度
返回
opengles 直接支持的坐标数据指针(需要调用者手动释放)

◆ insertOverlay:aboveOverlay:

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

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

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

由 category BMKMapView(OverlaysAPI) 提供.

◆ insertOverlay:atIndex:

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

在指定的索引处添加一个Overlay

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

由 category BMKMapView(OverlaysAPI) 提供.

◆ insertOverlay:belowOverlay:

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

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

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

由 category BMKMapView(OverlaysAPI) 提供.

◆ isSurpportBaiduHeatMap

- (BOOL) isSurpportBaiduHeatMap

判断当前图区是否支持百度热力图(百度自有数据)

返回
支持返回YES,否则返回NO

◆ mapForceRefresh

- (void) mapForceRefresh

强制刷新mapview

◆ mapRectThatFits:

- (BMKMapRect) mapRectThatFits: ("此方法已废弃")  __deprecated_msg

此方法什么都没做,已废弃

◆ mapRectThatFits:edgePadding:

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

根据当前地图View的窗口大小调整传入的mapRect,返回适合当前地图窗口显示的mapRect,并且在该mapRect四周保留insets指定的边界区域

参数
mapRect待调整的地理范围,采用直角坐标系表示
insetsmapRect四周要预留的边界大小
返回
调整后适合当前地图窗口显示的地理范围,采用直角坐标系

◆ regionThatFits:

- (BMKCoordinateRegion) regionThatFits: ("此方法已废弃")  __deprecated_msg

此接口什么都没做,已废弃。

◆ removeAnnotation:

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

移除标注

参数
annotation要移除的标注

由 category BMKMapView(AnnotationAPI) 提供.

◆ removeAnnotations:

- (void) removeAnnotations: (NSArray< id< BMKAnnotation > > *)  annotations

移除一组标注

参数
annotations要移除的标注数组

由 category BMKMapView(AnnotationAPI) 提供.

◆ removeHeatMap

- (void) removeHeatMap

移除热力图

由 category BMKMapView(HeatMapAPI) 提供.

◆ removeOverlay:

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

移除Overlay

参数
overlay要移除的overlay

由 category BMKMapView(OverlaysAPI) 提供.

◆ removeOverlays:

- (void) removeOverlays: (NSArray< id< BMKOverlay >> *)  overlays

移除一组Overlay

参数
overlays要移除的overlay数组

由 category BMKMapView(OverlaysAPI) 提供.

◆ screenPointFromMapPoint3:

- (CGPoint) screenPointFromMapPoint3: (BMKMapPoint3 mapPoint3

将三维地理坐标转化为屏幕坐标 since 6.5.2

参数
mapPoint3三维地理坐标
返回
屏幕坐标

◆ selectAnnotation:animated:

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

选中指定的标注,本版暂不支持animate效果

参数
annotation指定的标注
animated本版暂不支持

由 category BMKMapView(AnnotationAPI) 提供.

◆ setBaiduMapSDKMetalEnable:

+ (BOOL) setBaiduMapSDKMetalEnable: (BOOL)  metalEnable

V6.5.2版本新增 设置地图是否使用Metal绘制,请在创建BMKMapView前设置有效

◆ setCenterCoordinate:animated:

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

设定地图中心点坐标

参数
coordinate要设定的地图中心点坐标,用经纬度表示
animated是否采用动画效果

◆ setCompassImage:

- (void) setCompassImage: (UIImage *)  image

设置罗盘的图片

参数
image设置的图片

◆ setCustomMapStyleEnable:

- (void) setCustomMapStyleEnable: (BOOL)  enable

V5.0.0版本新增 个性化地图样式开关,仅影响当前BMKMapView对象,需在对象创建后调用

参数
enable当前自定义地图样式是否生效

由 category BMKMapView(CustomMapAPI) 提供.

◆ setCustomMapStylePath:

- (void) setCustomMapStylePath: (NSString *)  customMapStyleFilePath

V5.0.0版本新增 设置个性化地图样式路径,仅影响当前BMKMapView对象,需在对象创建后调用

参数
customMapStyleFilePath本地个性化样式文件所在路径,包含文件名

由 category BMKMapView(CustomMapAPI) 提供.

◆ setCustomMapStylePath:mode:

- (void) setCustomMapStylePath: (NSString *)  customMapStyleFilePath
mode: (int)  mode 

V5.0.0版本新增 设置个性化地图样式路径,仅影响当前BMKMapView对象,需在对象创建后调用

参数
customMapStyleFilePath本地个性化样式文件所在路径,包含文件名
mode加载模式,0:加载本地文件 1:加载在线文件或在线缓存文件

由 category BMKMapView(CustomMapAPI) 提供.

◆ setCustomMapStyleWithOption:preLoad:success:failure:

- (void) setCustomMapStyleWithOption: (BMKCustomMapStyleOption *)  option
preLoad: (void(^)(NSString *_Nullable path))  preLoad
success: (void(^)(NSString *path))  success
failure: (void(^)(NSError *error, NSString *_Nullable path))  failure 

V5.0.0版本新增 在线个性化样式加载状态回调接口。 在线个性化样式创建地址:http://lbsyun.baidu.com/apiconsole/custommap 调用该接口加载个性化样式的默认策略为:

  • 1、优先通过BMKCustomMapStyleOption配置的个性化样式ID,加载在线个性化样式;
  • 2、如果配置的个性化样式ID无效或在线个性化样式请求失败,则加载本地缓存的最新一次请求成功的在线个性化样式;
  • 3、如果本地缓存中没有最新一次请求成功的在线个性化样式,则通过BMKCustomMapStyleOption中配置的本地离线样式路径加载本地样式
  • 4、如果以上样式加载都失败,则显示普通地图样式。
    参数
    option在线个性化样式配置选项
    preLoad当预加载成功时会执行的block对象,path:本地缓存的最新一次请求成功的在线个性化样式路径
    success当加载成功时会执行的block对象,path:请求成功的在线个性化样式路径
    failure当加载未成功时会执行的block对象,error:失败错误信息,path:失败后根据策略加载的个性化样式路径(路径可能会为nil)

由 category BMKMapView(CustomMapAPI) 提供.

◆ setCustomTrafficColorForSmooth:slow:congestion:severeCongestion:

- (BOOL) setCustomTrafficColorForSmooth: (UIColor *)  smooth
slow: (UIColor *)  slow
congestion: (UIColor *)  congestion
severeCongestion: (UIColor *)  severeCongestion 

自定义路况颜色。注意:如果需要自定义路况颜色,必须4种路况全都设置。4个参数全部合法时,自定义颜色才有效;否则全部使用默认的。 since 6.0.0 暂不支持

参数
smooth路况畅通对应的颜色
slow路况缓行对应的颜色
congestion路况拥堵对应的颜色
severeCongestion路况严重拥堵对应的颜色
返回
自定义颜色合法返回YES,非法返回NO

◆ setHeatMapFrameAnimationIndex:

- (void) setHeatMapFrameAnimationIndex: (NSInteger)  index

控制渲染帧索引

由 category BMKMapView(HeatMapAPI) 提供.

◆ setMapCenterToScreenPt:

- (void) setMapCenterToScreenPt: (CGPoint)  ptInScreen

设置地图中心点在地图中的屏幕坐标位置

参数
ptInScreen要设定的地图中心点位置,为屏幕坐标,设置的中心点不能超过屏幕范围,否则无效

◆ setMapStatus:

- (void) setMapStatus: (BMKMapStatus *)  mapStatus

设置地图状态

参数
mapStatus地图状态信息

◆ setMapStatus:withAnimation:

- (void) setMapStatus: (BMKMapStatus *)  mapStatus
withAnimation: (BOOL)  bAnimation 

设置地图状态

参数
mapStatus地图状态信息
bAnimation是否需要动画效果,true:需要做动画

◆ setMapStatus:withAnimation:withAnimationTime:

- (void) setMapStatus: (BMKMapStatus *)  mapStatus
withAnimation: (BOOL)  bAnimation
withAnimationTime: (int)  ulDuration 

设置地图状态

参数
mapStatus地图状态信息
bAnimation是否需要动画效果,true:需要做动画
ulDuration指定动画时间,单位:ms

◆ setRegion:animated:

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

设定当前地图的显示范围

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

◆ setVisibleMapRect:animated:

- (void) setVisibleMapRect: (BMKMapRect mapRect
animated: (BOOL)  animate 

设定当前地图的显示范围,采用直角坐标系表示

参数
mapRect要设定的地图范围,用直角坐标系表示
animate是否采用动画效果

◆ setVisibleMapRect:edgePadding:animated:

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

设定地图的显示范围,并使mapRect四周保留insets指定的边界区域

参数
mapRect要设定的地图范围,用直角坐标系表示
insets指定的四周边界大小
animate是否采用动画效果

◆ showAnnotations:animated:

- (void) showAnnotations: (NSArray< id< BMKAnnotation >> *)  annotations
animated: (BOOL)  animated 

设置地图使显示区域显示所有annotations,如果数组中只有一个则直接设置地图中心为annotation的位置

参数
annotations指定的标注
animated是否启动动画

由 category BMKMapView(AnnotationAPI) 提供.

◆ startHeatMapFrameAnimation

- (void) startHeatMapFrameAnimation

开始动画

由 category BMKMapView(HeatMapAPI) 提供.

◆ stopHeatMapFrameAnimation

- (void) stopHeatMapFrameAnimation

暂停动画

由 category BMKMapView(HeatMapAPI) 提供.

◆ switchBaseIndoorMapFloor:withID:

- (BMKSwitchIndoorFloorError) switchBaseIndoorMapFloor: (NSString *)  strFloor
withID: (NSString *)  strID 

设置室内图楼层

参数
strFloor楼层
strID室内图ID
返回
切换结果错误码

由 category BMKMapView(IndoorMapAPI) 提供.

◆ switchOverlayLayerAndNavigationLayer:

- (BOOL) switchOverlayLayerAndNavigationLayer: (BOOL)  isSwitch

地图overlay图层与导航图层交换位置 since 6.5.0

参数
isSwitchYES 交换位置, NO 复原位置
返回
成功返回YES,否则返回NO

由 category BMKMapView(MapLayerAPI) 提供.

◆ switchOverlayLayerAndPOILayer:

- (BOOL) switchOverlayLayerAndPOILayer: (BOOL)  isSwitch

地图overlay图层与POI图层交换位置 since 6.5.0 用于将自定义覆盖物绘制在POI图层之下(例如:解决Polyline绘制遮挡道路名称问题) 注意:addOverlay后调用此方法

参数
isSwitchYES 交换位置, NO 复原位置
返回
成功返回YES,否则返回NO

由 category BMKMapView(MapLayerAPI) 提供.

◆ takeSnapshot

- (nullable UIImage *) takeSnapshot

获得地图当前可视区域截图

返回
返回view范围内的截取的UIImage

◆ takeSnapshot:

- (nullable UIImage *) takeSnapshot: (CGRect)  rect

获得地图区域区域截图

返回
返回指定区域的截取的UIImage

◆ updateLocationData:

- (void) updateLocationData: (BMKUserLocation *)  userLocation

动态更新我的位置数据

参数
userLocation定位数据

由 category BMKMapView(LocationViewAPI) 提供.

◆ updateLocationViewWithParam:

- (void) updateLocationViewWithParam: (BMKLocationViewDisplayParam *)  locationViewDisplayParam

动态定制我的位置样式

参数
locationViewDisplayParam样式参数

由 category BMKMapView(LocationViewAPI) 提供.

◆ viewForAnnotation:

- (nullable BMKAnnotationView *) viewForAnnotation: (id< BMKAnnotation >)  annotation

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

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

由 category BMKMapView(AnnotationAPI) 提供.

◆ viewForOverlay:

- (nullable BMKOverlayView *) viewForOverlay: (id< BMKOverlay >)  overlay

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

参数
overlay指定的overlay 指定overlay对应的View

由 category BMKMapView(OverlaysAPI) 提供.

◆ viewWillAppear

- (void) viewWillAppear

当mapview即将被显式的时候调用,恢复之前存储的mapview状态。

◆ viewWillDisappear

- (void) viewWillDisappear

当mapview即将被隐藏的时候调用,存储当前mapview的状态。

◆ zoomIn

- (BOOL) zoomIn

放大一级比例尺

返回
是否成功

◆ zoomOut

- (BOOL) zoomOut

缩小一级比例尺

返回
是否成功

属性说明

◆ annotations

- (NSArray<id <BMKAnnotation> >*) annotations
readnonatomiccopy

当前地图View的已经添加的标注数组

由 category BMKMapView(AnnotationAPI) 提供.

◆ baiduHeatMapEnabled

- (BOOL) baiduHeatMapEnabled
readwritenonatomicassign

设定地图是否打开百度城市热力图图层(百度自有数据),注:地图层级大于11时,可显示热力图

◆ baseIndoorMapEnabled

- (BOOL) baseIndoorMapEnabled
readwritenonatomicassign

设定地图是否显示室内图(包含室内图标注),默认不显示

由 category BMKMapView(IndoorMapAPI) 提供.

◆ buildingsEnabled

- (BOOL) buildingsEnabled
readwritenonatomicassign

设定地图是否现显示3D楼块效果

◆ centerCoordinate

- (CLLocationCoordinate2D) centerCoordinate
readwritenonatomicassign

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

◆ ChangeCenterWithDoubleTouchPointEnabled

- (BOOL) ChangeCenterWithDoubleTouchPointEnabled
readwritenonatomicassign

设定双击手势放大地图时,BMKMapView的放大效果的中心点。 设置为YES时,以双击的位置为中心点进行放大,地图中心点会改变; 设置为NO时,以当前地图的中心点为中心进行放大,地图中心点不变; 默认值为YES。

◆ ChangeWithTouchPointCenterEnabled

- (BOOL) ChangeWithTouchPointCenterEnabled
readwritenonatomicassign

设定双指手势操作时,BMKMapView的旋转和缩放效果的中心点。 设置为YES时,以手势的中心点(二个指头的中心点)为中心进行旋转和缩放,地图中心点会改变; 设置为NO时,以当前地图的中心点为中心进行旋转和缩放,地图中心点不变; 默认值为NO。

◆ compassPosition

- (CGPoint) compassPosition
readwritenonatomicassign

指南针的位置,设定坐标以BMKMapView左上角为原点,向右向下增长

◆ compassSize

- (CGSize) compassSize
readnonatomicassign

指南针的宽高

◆ delegate

- (id<BMKMapViewDelegate>) delegate
readwritenonatomicweak

地图View的Delegate

◆ fontSizeLevel

- (NSInteger) fontSizeLevel
readwritenonatomicassign

设置地图字体大小 since 6.3.0 共4个级别(0: 小, 1: 标准, 2: 大, 3: 特大) 默认1

◆ forceTouchEnabled

- (BOOL) forceTouchEnabled
readwritenonatomicassign

设定地图是否回调force touch事件,默认为NO,仅适用于支持3D Touch的情况,开启后会回调 - mapview:onForceTouch:force:maximumPossibleForce:

◆ gestureDelegate

- (id<BMKMapGestureDelegate>) gestureDelegate
readwritenonatomicweak

地图View的手势Delegate

◆ gesturesEnabled

- (BOOL) gesturesEnabled
readwritenonatomicassign

设定地图View能否支持所有手势操作

◆ gestureZoomAnimationEnabled

- (BOOL) gestureZoomAnimationEnabled
readwritenonatomicassign

设定地图手势缩放是否需要动画,默认YES,设置为NO时手势缩放时将无动画 since 6.5.2

◆ isSelectedAnnotationViewFront

- (BOOL) isSelectedAnnotationViewFront
readwritenonatomicassign

设定是否总让选中的annotaion置于最前面

由 category BMKMapView(AnnotationAPI) 提供.

◆ languageType

- (BMKMapLanguageType) languageType
readwritenonatomicassign

地图底图语言类型 (暂不支持多地图) kBMKMapLanguageChinese: 中文地图; kBMKMapLanguageEnglish: 英文地图 默认kBMKMapLanguageChinese中文地图; since 6.4.0

◆ limitMapRegion

- (BMKCoordinateRegion) limitMapRegion
readwritenonatomicassign

限制地图的显示范围(地图状态改变时,该范围不会在地图显示范围外。设置成功后,会调整地图显示该范围)

◆ logoPosition

- (BMKLogoPosition) logoPosition
readwritenonatomicassign

logo位置,默认BMKLogoPositionLeftBottom

◆ mapPadding

- (UIEdgeInsets) mapPadding
readwritenonatomicassign

地图预留边界,默认:UIEdgeInsetsZero。 注:设置后,会根据mapPadding调整logo、比例尺、指南针的位置。 当updateTargetScreenPtWhenMapPaddingChanged==YES时,地图中心(屏幕坐标:BMKMapStatus.targetScreenPt)跟着改变

◆ mapScaleBarPosition

- (CGPoint) mapScaleBarPosition
readwritenonatomicassign

比例尺的位置,设定坐标以BMKMapView左上角为原点,向右向下增长

◆ mapScaleBarSize

- (CGSize) mapScaleBarSize
readnonatomicassign

比例尺的宽高

◆ mapType

- (BMKMapType) mapType
readwritenonatomicassign

当前地图类型,可设定为标准地图、卫星地图

◆ maxZoomLevel

- (float) maxZoomLevel
readwritenonatomicassign

地图的自定义最大比例尺级别

◆ minOverlooking

- (int) minOverlooking
readwritenonatomicassign

地图俯视角度最小值(即角度最大值),在手机上当前可设置的范围为-79~0度

◆ minZoomLevel

- (float) minZoomLevel
readwritenonatomicassign

地图的自定义最小比例尺级别

◆ overlays

- (NSArray<id <BMKOverlay> >*) overlays
readnonatomiccopy

当前mapView中已经添加的Overlay数组

由 category BMKMapView(OverlaysAPI) 提供.

◆ overlookEnabled

- (BOOL) overlookEnabled
readwritenonatomicassign

设定地图View能否支持俯仰角

◆ overlooking

- (int) overlooking
readwritenonatomicassign

地图俯视角度,在手机上当前可使用的范围为-45~0度

◆ region

- (BMKCoordinateRegion) region
readwritenonatomicassign

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

◆ rotateEnabled

- (BOOL) rotateEnabled
readwritenonatomicassign

设定地图View能否支持旋转

◆ rotation

- (int) rotation
readwritenonatomicassign

地图旋转角度,在手机上当前可使用的范围为-180~180度

◆ scrollEnabled

- (BOOL) scrollEnabled
readwritenonatomicassign

设定地图View能否支持用户移动地图

◆ showIndoorMapPoi

- (BOOL) showIndoorMapPoi
readwritenonatomicassign

设定室内图标注是否显示,默认YES,仅当显示室内图(baseIndoorMapEnabled为YES)时生效

由 category BMKMapView(IndoorMapAPI) 提供.

◆ showMapPoi

- (BOOL) showMapPoi
readwritenonatomicassign

设定地图是否显示底图poi标注(不包含室内图标注),默认YES

◆ showMapScaleBar

- (BOOL) showMapScaleBar
readwritenonatomicassign

设定是否显式比例尺

◆ showOperateLayer

- (BOOL) showOperateLayer
readwritenonatomicassign

地图是否展示运营图层默认YES,since 6.4.0

由 category BMKMapView(MapLayerAPI) 提供.

◆ showsUserLocation

- (BOOL) showsUserLocation
readwritenonatomicassign

设定是否显示定位图层

由 category BMKMapView(LocationViewAPI) 提供.

◆ trafficEnabled

- (BOOL) trafficEnabled
readwritenonatomicassign

设定地图是否打开路况图层

◆ updateTargetScreenPtWhenMapPaddingChanged

- (BOOL) updateTargetScreenPtWhenMapPaddingChanged
readwritenonatomicassign

设置mapPadding时,地图中心(屏幕坐标:BMKMapStatus.targetScreenPt)是否跟着改变,默认YES

◆ userLocationVisible

- (BOOL) userLocationVisible
readnonatomicassign

返回定位坐标点是否在当前地图可视区域内

由 category BMKMapView(LocationViewAPI) 提供.

◆ userTrackingMode

- (BMKUserTrackingMode) userTrackingMode
readwritenonatomicassign

设定定位模式,取值为:BMKUserTrackingMode

由 category BMKMapView(LocationViewAPI) 提供.

◆ visibleMapRect

- (BMKMapRect) visibleMapRect
readwritenonatomicassign

当前地图范围,采用直角坐标系表示,向右向下增长

◆ zoomEnabled

- (BOOL) zoomEnabled
readwritenonatomicassign

设定地图View能否支持用户多点缩放(双指)

◆ zoomEnabledWithTap

- (BOOL) zoomEnabledWithTap
readwritenonatomicassign

设定地图View能否支持用户缩放(双击或双指单击)

◆ zoomLevel

- (float) zoomLevel
readwritenonatomicassign

地图比例尺级别,在手机上当前可使用的级别为4-21级


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