BaiduMap_IOSSDK_v6.6.6_Docs 6.6.6

载入中...
搜索中...
未找到
构造函数 | 所有成员列表
<BMKMapViewDelegate>协议 参考

MapView的Delegate，mapView通过此类来通知用户对应的事件 更多...

`#include <BMKMapView.h>`

类 <BMKMapViewDelegate> 继承关系图:

## 构造函数
(void) | - mapViewWillBackground:
(void) | - mapViewDidForeground:
(void) | - mapViewDidFinishLoading:
(void) | - mapViewDidRenderValidData:withError:
(void) | - mapViewDidFinishRendering:
(void) | - mapView:onDrawMapFrame:
(void) | - mapView:regionWillChangeAnimated:
(void) | - mapView:regionWillChangeAnimated:reason:
(void) | - mapView:regionDidChangeAnimated:
(void) | - mapView:regionDidChangeAnimated:reason:
(nullable __kindof BMKAnnotationView *) | - mapView:viewForAnnotation:
(void) | - mapView:didAddAnnotationViews:
(void) | - mapView:clickAnnotationView:
(void) | - mapView:didSelectAnnotationView:
(void) | - mapView:didDeselectAnnotationView:
(void) | - mapView:annotationView:didChangeDragState:fromOldState:
(void) | - mapView:annotationViewForBubble:
(nullable __kindof BMKOverlayView *) | - mapView:viewForOverlay:
(void) | - mapView:didAddOverlayViews:
(void) | - mapView:onClickedBMKOverlayView:
(void) | - mapView:onClickedMapPoi:
(void) | - mapView:onClickedMapBlank:
(void) | - mapview:onDoubleClick:
(void) | - mapview:onLongClick:
(void) | - mapview:onForceTouch:force:maximumPossibleForce:
(void) | - mapStatusDidChanged:
(void) | - mapview:baseIndoorMapWithIn:baseIndoorMapInfo:
(void) | - mapView:didChangeUserTrackingMode:

## 详细描述

MapView的Delegate，mapView通过此类来通知用户对应的事件

## 函数文档

## ◆ mapStatusDidChanged:

- (void) mapStatusDidChanged: |  | (BMKMapView *) | mapView |
| optional required

地图状态改变完成后会调用此接口

参数

  mapView | 地图View

## ◆ mapView:annotationView:didChangeDragState:fromOldState:

- (void) mapView: |  | (BMKMapView *) | mapView
annotationView: |  | (BMKAnnotationView *) | view
didChangeDragState: |  | (BMKAnnotationViewDragState) | newState
fromOldState: |  | (BMKAnnotationViewDragState) | oldState
| optional required

拖动annotation view时，若view的状态发生变化，会调用此函数。ios3.2以后支持

参数

  mapView | 地图View
  view | annotation view
  newState | 新状态
  oldState | 旧状态

## ◆ mapView:annotationViewForBubble:

- (void) mapView: |  | (BMKMapView *) | mapView
annotationViewForBubble: |  | (BMKAnnotationView *) | view
| optional required

当点击annotation view弹出的泡泡时，调用此接口

参数

  mapView | 地图View
  view | 泡泡所属的annotation view

## ◆ mapview:baseIndoorMapWithIn:baseIndoorMapInfo:

- (void) mapview: |  | (BMKMapView *) | mapView
baseIndoorMapWithIn: |  | (BOOL) | flag
baseIndoorMapInfo: |  | (nullable BMKBaseIndoorMapInfo *) | info
| optional required

地图进入/移出室内图会调用此接口

参数

  mapView | 地图View
  flag | YES:进入室内图; NO:移出室内图
  info | 室内图信息

## ◆ mapView:clickAnnotationView:

- (void) mapView: |  | (BMKMapView *) | mapView
clickAnnotationView: |  | (BMKAnnotationView *) | view
| optional required

当点击一个annotation view时，调用此接口 每次点击BMKAnnotationView都会回调此接口。

参数

  mapView | 地图View
  view | 点击的annotation view

## ◆ mapView:didAddAnnotationViews:

- (void) mapView: |  | (BMKMapView *) | mapView
didAddAnnotationViews: |  | (NSArray *) | views
| optional required

当mapView新添加annotation views时，调用此接口

参数

  mapView | 地图View
  views | 新添加的annotation views

## ◆ mapView:didAddOverlayViews:

- (void) mapView: |  | (BMKMapView *) | mapView
didAddOverlayViews: |  | (NSArray *) | overlayViews
| optional required

当mapView新添加overlay views时，调用此接口

参数

  mapView | 地图View
  overlayViews | 新添加的overlay views

## ◆ mapView:didChangeUserTrackingMode:

- (void) mapView: |  | (BMKMapView *) | mapView
didChangeUserTrackingMode: |  | (BMKUserTrackingMode) | mode
| optional required

切换定位模式会调用此接口

参数

  mapView | 地图View
  mode | 切换后的定位模式

## ◆ mapView:didDeselectAnnotationView:

- (void) mapView: |  | (BMKMapView *) | mapView
didDeselectAnnotationView: |  | (BMKAnnotationView *) | view
| optional required

当取消选中一个annotation views时，调用此接口

参数

  mapView | 地图View
  view | 取消选中的annotation views

## ◆ mapView:didSelectAnnotationView:

- (void) mapView: |  | (BMKMapView *) | mapView
didSelectAnnotationView: |  | (BMKAnnotationView *) | view
| optional required

当选中一个annotation views时，调用此接口 当BMKAnnotation的title为nil，BMKAnnotationView的canShowCallout为NO时，不显示气泡，点击BMKAnnotationView会回调此接口。 当气泡已经弹出，点击BMKAnnotationView不会继续回调此接口。

参数

  mapView | 地图View
  view | 选中的annotation views

## ◆ mapView:onClickedBMKOverlayView:

- (void) mapView: |  | (BMKMapView *) | mapView
onClickedBMKOverlayView: |  | (BMKOverlayView *) | overlayView
| optional required

点中覆盖物后会回调此接口

参数

  mapView | 地图View
  overlayView | 覆盖物view信息

## ◆ mapView:onClickedMapBlank:

- (void) mapView: |  | (BMKMapView *) | mapView
onClickedMapBlank: |  | (CLLocationCoordinate2D) | coordinate
| optional required

点中底图空白处会回调此接口

参数

  mapView | 地图View
  coordinate | 空白处坐标点的经纬度

## ◆ mapView:onClickedMapPoi:

- (void) mapView: |  | (BMKMapView *) | mapView
onClickedMapPoi: |  | (BMKMapPoi *) | mapPoi
| optional required

点中底图标注后会回调此接口

参数

  mapView | 地图View
  mapPoi | 标注点信息

## ◆ mapview:onDoubleClick:

- (void) mapview: |  | (BMKMapView *) | mapView
onDoubleClick: |  | (CLLocationCoordinate2D) | coordinate
| optional required

双击地图时会回调此接口

参数

  mapView | 地图View
  coordinate | 返回双击处坐标点的经纬度

## ◆ mapView:onDrawMapFrame:

- (void) mapView: |  | (BMKMapView *) | mapView
onDrawMapFrame: |  | (BMKMapStatus *) | status
| optional required

地图渲染每一帧画面过程中，以及每次需要重绘地图时（例如添加覆盖物）都会调用此接口

参数

  mapView | 地图View
  status | 此时地图的状态

## ◆ mapview:onForceTouch:force:maximumPossibleForce:

- (void) mapview: |  | (BMKMapView *) | mapView
onForceTouch: |  | (CLLocationCoordinate2D) | coordinate
force: |  | (CGFloat) | force
maximumPossibleForce: |  | (CGFloat) | maximumPossibleForce
| optional required

3DTouch 按地图时会回调此接口（仅在支持3D Touch，且forceTouchEnabled属性为YES时，会回调此接口）

参数

  mapView | 地图View
  coordinate | 触摸点的经纬度
  force | 触摸该点的力度(参考UITouch的force属性)
  maximumPossibleForce | 当前输入机制下的最大可能力度(参考UITouch的maximumPossibleForce属性)

## ◆ mapview:onLongClick:

- (void) mapview: |  | (BMKMapView *) | mapView
onLongClick: |  | (CLLocationCoordinate2D) | coordinate
| optional required

长按地图时会回调此接口

参数

  mapView | 地图View
  coordinate | 返回长按事件坐标点的经纬度

## ◆ mapView:regionDidChangeAnimated:

- (void) mapView: |  | (BMKMapView *) | mapView
regionDidChangeAnimated: |  | (BOOL) | animated
| optional required

地图区域改变完成后会调用此接口

参数

  mapView | 地图View
  animated | 是否动画

## ◆ mapView:regionDidChangeAnimated:reason:

- (void) mapView: |  | (BMKMapView *) | mapView
regionDidChangeAnimated: |  | (BOOL) | animated
reason: |  | (BMKRegionChangeReason) | reason
| optional required

地图区域改变完成后会调用此接口

参数

  mapView | 地图View
  animated | 是否动画
  reason | 地区区域改变的原因

## ◆ mapView:regionWillChangeAnimated:

- (void) mapView: |  | (BMKMapView *) | mapView
regionWillChangeAnimated: |  | (BOOL) | animated
| optional required

地图区域即将改变时会调用此接口

参数

  mapView | 地图View
  animated | 是否动画

## ◆ mapView:regionWillChangeAnimated:reason:

- (void) mapView: |  | (BMKMapView *) | mapView
regionWillChangeAnimated: |  | (BOOL) | animated
reason: |  | (BMKRegionChangeReason) | reason
| optional required

地图区域即将改变时会调用此接口

参数

  mapView | 地图View
  animated | 是否动画
  reason | 地区区域改变的原因

## ◆ mapView:viewForAnnotation:

- (nullable __kindof BMKAnnotationView *) mapView: |  | (BMKMapView *) | mapView
viewForAnnotation: |  | (id< BMKAnnotation >) | annotation
| optional required

根据anntation生成对应的View

参数

  mapView | 地图View
  annotation | 指定的标注

返回
  生成的标注View

## ◆ mapView:viewForOverlay:

- (nullable __kindof BMKOverlayView *) mapView: |  | (BMKMapView *) | mapView
viewForOverlay: |  | (id< BMKOverlay >) | overlay
| optional required

根据overlay生成对应的View

参数

  mapView | 地图View
  overlay | 指定的overlay

返回
  生成的覆盖物View

## ◆ mapViewDidFinishLoading:

- (void) mapViewDidFinishLoading: |  | (BMKMapView *) | mapView |
| optional required

地图初始化完毕时会调用此接口

参数

  mapView | 地图View

## ◆ mapViewDidFinishRendering:

- (void) mapViewDidFinishRendering: |  | (BMKMapView *) | mapView |
| optional required

地图渲染完毕后会调用此接口

参数

  mapView | 地图View

## ◆ mapViewDidForeground:

- (void) mapViewDidForeground: |  | (BMKMapView *) | mapView |
| optional required

APP进入前台后调用此接口 APP进入前台后对地图及覆盖物的操作请在该回调里执行

参数

  mapView | 地图View

## ◆ mapViewDidRenderValidData:withError:

- (void) mapViewDidRenderValidData: |  | (BMKMapView *) | mapView
withError: |  | (NSError *) | error
| optional required

地图绘制出有效数据时调用此接口

参数

  mapView | 地图View
  error | 错误码

## ◆ mapViewWillBackground:

- (void) mapViewWillBackground: |  | (BMKMapView *) | mapView |
| optional

APP退到后台前调用此接口 APP退到后台前对地图及覆盖物的操作请在该回调里执行

参数

  mapView | 地图View

该协议的文档由以下文件生成:

- BaiduMapAPI_Map.framework/Headers/BMKMapView.h