高德地图SDK(导航) V11.2.0501

Loading...
Searching...
No Matches
Instance Methods | List of all members
<MAMapViewDelegate> Protocol Reference

`#include <MAMapView.h>`

Inheritance diagram for <MAMapViewDelegate>:

## Instance Methods
(void) | - mapViewRegionChanged:
| 地图区域改变过程中会调用此接口 since 4.6.0 This interface will be called during the map region change process. since 4.6.0
(void) | - mapView:regionWillChangeAnimated:
| 地图区域即将改变时会调用此接口 This interface will be called when the map region is about to change
(void) | - mapView:regionDidChangeAnimated:
| 地图区域改变完成后会调用此接口 This interface will be called after the map region change is completed
(void) | - mapView:regionWillChangeAnimated:wasUserAction:
| 地图区域即将改变时会调用此接口，如实现此接口则不会触发回掉mapView:regionWillChangeAnimated: This interface will be called when the map region is about to change, and if this interface is implemented, the callback mapView:regionWillChangeAnimated: will not be triggered
(void) | - mapView:regionDidChangeAnimated:wasUserAction:
| 地图区域改变完成后会调用此接口，如实现此接口则不会触发回掉mapView:regionDidChangeAnimated: This interface will be called after the map region change is completed，and if this interface is implemented, the callback mapView:regionDidChangeAnimated: will not be triggered
(void) | - mapView:mapWillMoveByUser:
| 地图将要发生移动时调用此接口 This interface will be called when the map is about to move
(void) | - mapView:mapDidMoveByUser:
| 地图移动结束后调用此接口 This interface will be called after the map movement ends
(void) | - mapView:mapWillZoomByUser:
| 地图将要发生缩放时调用此接口 This interface is called when the map is about to zoom
(void) | - mapView:mapDidZoomByUser:
| 地图缩放结束后调用此接口 This interface is called after the map zoom ends
(void) | - mapViewWillStartLoadingMap:
| 地图开始加载 The map starts loading
(void) | - mapViewDidFinishLoadingMap:
| 地图加载成功 The map is loaded successfully
(void) | - mapViewDidFailLoadingMap:withError:
| 地图加载失败 The map fails to load
(void) | - mapView:didFailLoadTerrainWithError:
| 地形图加载失败 Terrain map failed to load
(MAAnnotationView *) | - mapView:viewForAnnotation:
| 根据anntation生成对应的View。 Generate corresponding View based on annotation.
(void) | - mapView:didAddAnnotationViews:
| 当mapView新添加annotation views时，调用此接口 This interface is called when new annotation views are added to the mapView
(void) | - mapView:didSelectAnnotationView:
| 当选中一个annotation view时，调用此接口. 注意如果已经是选中状态，再次点击不会触发此回调。取消选中需调用-(void)deselectAnnotation:animated: This interface is called when an annotation view is selected. Note that if it is already in the selected state, clicking again will not trigger this callback. To deselect, call -(void)deselectAnnotation:animated:
(void) | - mapView:didDeselectAnnotationView:
| 当取消选中一个annotation view时，调用此接口 This interface is called when an annotation view is deselected
(void) | - mapViewWillStartLocatingUser:
| 在地图View将要启动定位时，会调用此函数 This function is called when the map view is about to start positioning
(void) | - mapViewDidStopLocatingUser:
| 在地图View停止定位后，会调用此函数 This function will be called after the MapView stops locating
(void) | - mapView:didUpdateUserLocation:updatingLocation:
| 位置或者设备方向更新后，会调用此函数 This function will be called after the location or device orientation is updated
(void) | - mapViewRequireLocationAuth:
| 当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription，并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined，会调用代理的此方法。 此方法实现调用后台权限API即可（ 该回调必须实现 [locationManager requestAlwaysAuthorization] ）; since 6.8.0 When the plist is configured with NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription, and [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined, this method of the delegate will be called. This method just needs to call the background permission API (this callback must implement [locationManager requestAlwaysAuthorization]); since 6.8.0
(void) | - mapView:didFailToLocateUserWithError:
| 定位失败后，会调用此函数 This function will be called after positioning failure
(void) | - mapView:annotationView:didChangeDragState:fromOldState:
| 拖动annotation view时view的状态变化 State changes of the annotation view during dragging
(MAOverlayRenderer *) | - mapView:rendererForOverlay:
| 根据overlay生成对应的Renderer Generate the corresponding Renderer based on the overlay
(void) | - mapView:didAddOverlayRenderers:
| 当mapView新添加overlay renderers时，调用此接口 Call this interface when mapView adds new overlay renderers
(void) | - mapView:annotationView:calloutAccessoryControlTapped:
| 标注view的accessory view(必须继承自UIControl)被点击时，触发该回调 When the accessory view of the annotation view (must inherit from UIControl) is clicked, this callback is triggered
(void) | - mapView:didAnnotationViewCalloutTapped:
| 标注view的calloutview整体点击时，触发该回调。只有使用默认calloutview时才生效。 Triggers this callback when the calloutView of the annotationView is clicked. Only takes effect when using the default calloutView
(void) | - mapView:didAnnotationViewTapped:
| 标注view被点击时，触发该回调。（since 5.7.0） When the annotation view is clicked, this callback is triggered （since 5.7.0）
(void) | - mapView:didChangeUserTrackingMode:animated:
| 当userTrackingMode改变时，调用此接口 When the userTrackingMode changes, this interface is called
(void) | - mapView:didChangeOpenGLESDisabled:
| 当openGLESDisabled变量改变时，调用此接口 When the openGLESDisabled variable changes, call this interface
(void) | - mapView:didTouchPois:
| 当touchPOIEnabled == YES时，单击地图使用该回调获取POI信息 When touchPOIEnabled == YES, click on the map to use this callback to get POI information
(void) | - mapView:didSingleTappedAtCoordinate:
| 单击地图回调，返回经纬度 Click on the map callback, return latitude and longitude
(void) | - mapView:didLongPressedAtCoordinate:
| 长按地图，返回经纬度 Long press on the map, return latitude and longitude
(void) | - mapInitComplete:
| 地图初始化完成（在此之后，可以进行坐标计算） Map initialization completed (after this, coordinate calculations can be performed)
(void) | - offlineDataWillReload:
| 离线地图数据将要被加载, 调用reloadMap会触发该回调，离线数据生效前的回调. Offline map data is about to be loaded, calling reloadMap will trigger this callback, the callback before the offline data takes effect.
(void) | - offlineDataDidReload:
| 离线地图数据加载完成, 调用reloadMap会触发该回调，离线数据生效后的回调. Offline map data loading completed. Calling reloadMap will trigger this callback, which is the callback after the offline data takes effect.
(void) | - customMapStyleAuthFailedWithErrorCode:message:
| 自定义地图样式在线数据加载鉴权失败回调

## Method Documentation

## ◆ customMapStyleAuthFailedWithErrorCode:message:

- (void) customMapStyleAuthFailedWithErrorCode: |  | (int) | errorCode
message: |  | (NSString *) | msg
| optional

自定义地图样式在线数据加载鉴权失败回调

Parameters

  errorCode | 错误码
  msg | 错误信息

## ◆ mapInitComplete:

- (void) mapInitComplete: |  | (MAMapView *) | mapView |
| optional

地图初始化完成（在此之后，可以进行坐标计算） Map initialization completed (after this, coordinate calculations can be performed)

Parameters

  mapView | 地图View Map view

## ◆ mapView:annotationView:calloutAccessoryControlTapped:

- (void) mapView: |  | (MAMapView *) | mapView
annotationView: |  | (MAAnnotationView *) | view
calloutAccessoryControlTapped: |  | (UIControl *) | control
| optional

标注view的accessory view(必须继承自UIControl)被点击时，触发该回调 When the accessory view of the annotation view (must inherit from UIControl) is clicked, this callback is triggered

Parameters

  mapView | 地图View Map view
  view | callout所属的标注view the annotation view to which the callout belongs
  control | 对应的control Corresponding control

## ◆ mapView:annotationView:didChangeDragState:fromOldState:

- (void) mapView: |  | (MAMapView *) | mapView
annotationView: |  | (MAAnnotationView *) | view
didChangeDragState: |  | (MAAnnotationViewDragState) | newState
fromOldState: |  | (MAAnnotationViewDragState) | oldState
| optional

拖动annotation view时view的状态变化 State changes of the annotation view during dragging

Parameters

  mapView | 地图View Map view
  view | annotation view
  newState | 新状态 New state
  oldState | 旧状态 Old state

## ◆ mapView:didAddAnnotationViews:

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

当mapView新添加annotation views时，调用此接口 This interface is called when new annotation views are added to the mapView

Parameters

  mapView | 地图View Map view
  views | 新添加的annotation views the newly added annotation views

## ◆ mapView:didAddOverlayRenderers:

- (void) mapView: |  | (MAMapView *) | mapView
didAddOverlayRenderers: |  | (NSArray *) | overlayRenderers
| optional

当mapView新添加overlay renderers时，调用此接口 Call this interface when mapView adds new overlay renderers

Parameters

  mapView | 地图View Map view
  overlayRenderers | 新添加的overlay renderers Newly added overlay renderers

## ◆ mapView:didAnnotationViewCalloutTapped:

- (void) mapView: |  | (MAMapView *) | mapView
didAnnotationViewCalloutTapped: |  | (MAAnnotationView *) | view
| optional

标注view的calloutview整体点击时，触发该回调。只有使用默认calloutview时才生效。 Triggers this callback when the calloutView of the annotationView is clicked. Only takes effect when using the default calloutView

Parameters

  mapView | 地图的view Map view
  view | calloutView所属的annotationView The annotationView to which the calloutView belongs

## ◆ mapView:didAnnotationViewTapped:

- (void) mapView: |  | (MAMapView *) | mapView
didAnnotationViewTapped: |  | (MAAnnotationView *) | view
| optional

标注view被点击时，触发该回调。（since 5.7.0） When the annotation view is clicked, this callback is triggered （since 5.7.0）

Parameters

  mapView | 地图的view Map view
  view | annotationView

## ◆ mapView:didChangeOpenGLESDisabled:

- (void) mapView: |  | (MAMapView *) | mapView
didChangeOpenGLESDisabled: |  | ((deprecated("Deprecated, since 7.9.0"))) | __attribute
| optional

当openGLESDisabled变量改变时，调用此接口 When the openGLESDisabled variable changes, call this interface

Parameters

  mapView | 地图View Map view
  openGLESDisabled | 改变后的openGLESDisabled the changed openGLESDisabled

## ◆ mapView:didChangeUserTrackingMode:animated:

- (void) mapView: |  | (MAMapView *) | mapView
didChangeUserTrackingMode: |  | (MAUserTrackingMode) | mode
animated: |  | (BOOL) | animated
| optional

当userTrackingMode改变时，调用此接口 When the userTrackingMode changes, this interface is called

Parameters

  mapView | 地图View Map view
  mode | 改变后的mode The changed mode
  animated | 动画 Animation

## ◆ mapView:didDeselectAnnotationView:

- (void) mapView: |  | (MAMapView *) | mapView
didDeselectAnnotationView: |  | (MAAnnotationView *) | view
| optional

当取消选中一个annotation view时，调用此接口 This interface is called when an annotation view is deselected

Parameters

  mapView | 地图View Map view
  view | 取消选中的annotation view Deselect the annotation view

## ◆ mapView:didFailLoadTerrainWithError:

- (void) mapView: |  | (MAMapView *) | mapView
didFailLoadTerrainWithError: |  | (NSError *) | error
| optional

地形图加载失败 Terrain map failed to load

Parameters

  mapView | 地图View Map view
  error | 错误信息 Error message

## ◆ mapView:didFailToLocateUserWithError:

- (void) mapView: |  | (MAMapView *) | mapView
didFailToLocateUserWithError: |  | (NSError *) | error
| optional

定位失败后，会调用此函数 This function will be called after positioning failure

Parameters

  mapView | 地图View Map view
  error | 错误号，参考CLError.h中定义的错误号 Error code, refer to the error codes defined in CLError.h

## ◆ mapView:didLongPressedAtCoordinate:

- (void) mapView: |  | (MAMapView *) | mapView
didLongPressedAtCoordinate: |  | (CLLocationCoordinate2D) | coordinate
| optional

长按地图，返回经纬度 Long press on the map, return latitude and longitude

Parameters

  mapView | 地图View Map view
  coordinate | 经纬度 latitude and longitude

## ◆ mapView:didSelectAnnotationView:

- (void) mapView: |  | (MAMapView *) | mapView
didSelectAnnotationView: |  | (MAAnnotationView *) | view
| optional

当选中一个annotation view时，调用此接口. 注意如果已经是选中状态，再次点击不会触发此回调。取消选中需调用-(void)deselectAnnotation:animated: This interface is called when an annotation view is selected. Note that if it is already in the selected state, clicking again will not trigger this callback. To deselect, call -(void)deselectAnnotation:animated:

Parameters

  mapView | 地图View Map view
  view | 选中的annotation view On the selected annotation view

## ◆ mapView:didSingleTappedAtCoordinate:

- (void) mapView: |  | (MAMapView *) | mapView
didSingleTappedAtCoordinate: |  | (CLLocationCoordinate2D) | coordinate
| optional

单击地图回调，返回经纬度 Click on the map callback, return latitude and longitude

Parameters

  mapView | 地图View Map view
  coordinate | 经纬度 latitude and longitude

## ◆ mapView:didTouchPois:

- (void) mapView: |  | (MAMapView *) | mapView
didTouchPois: |  | (NSArray *) | pois
| optional

当touchPOIEnabled == YES时，单击地图使用该回调获取POI信息 When touchPOIEnabled == YES, click on the map to use this callback to get POI information

Parameters

  mapView | 地图View Map view
  pois | 获取到的poi数组(由MATouchPoi组成) the obtained poi array (composed of MATouchPoi)

## ◆ mapView:didUpdateUserLocation:updatingLocation:

- (void) mapView: |  | (MAMapView *) | mapView
didUpdateUserLocation: |  | (MAUserLocation *) | userLocation
updatingLocation: |  | (BOOL) | updatingLocation
| optional

位置或者设备方向更新后，会调用此函数 This function will be called after the location or device orientation is updated

Parameters

  mapView | 地图View Map view
  userLocation | 用户定位信息(包括位置与设备方向等数据) User location information (including location and device orientation data)
  updatingLocation | 标示是否是location数据更新, YES:location数据更新 NO:heading数据更新 Indicates whether it is a location data update, YES: location data update NO: heading data update

## ◆ mapView:mapDidMoveByUser:

- (void) mapView: |  | (MAMapView *) | mapView
mapDidMoveByUser: |  | (BOOL) | wasUserAction
| optional

地图移动结束后调用此接口 This interface will be called after the map movement ends

Parameters

  mapView | 地图view Map view
  wasUserAction | 标识是否是用户动作 Identifies whether it is a user action

## ◆ mapView:mapDidZoomByUser:

- (void) mapView: |  | (MAMapView *) | mapView
mapDidZoomByUser: |  | (BOOL) | wasUserAction
| optional

地图缩放结束后调用此接口 This interface is called after the map zoom ends

Parameters

  mapView | 地图view Map view
  wasUserAction | 标识是否是用户动作 Identifies whether it is a user action

## ◆ mapView:mapWillMoveByUser:

- (void) mapView: |  | (MAMapView *) | mapView
mapWillMoveByUser: |  | (BOOL) | wasUserAction
| optional

地图将要发生移动时调用此接口 This interface will be called when the map is about to move

Parameters

  mapView | 地图view Map view
  wasUserAction | 标识是否是用户动作 Identifies whether it is a user action

## ◆ mapView:mapWillZoomByUser:

- (void) mapView: |  | (MAMapView *) | mapView
mapWillZoomByUser: |  | (BOOL) | wasUserAction
| optional

地图将要发生缩放时调用此接口 This interface is called when the map is about to zoom

Parameters

  mapView | 地图view Map view
  wasUserAction | 标识是否是用户动作 Identifies whether it is a user action

## ◆ mapView:regionDidChangeAnimated:

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

地图区域改变完成后会调用此接口 This interface will be called after the map region change is completed

Parameters

  mapView | 地图View Map View
  animated | 是否动画 Whether to animate

## ◆ mapView:regionDidChangeAnimated:wasUserAction:

- (void) mapView: |  | (MAMapView *) | mapView
regionDidChangeAnimated: |  | (BOOL) | animated
wasUserAction: |  | (BOOL) | wasUserAction
| optional

地图区域改变完成后会调用此接口，如实现此接口则不会触发回掉mapView:regionDidChangeAnimated: This interface will be called after the map region change is completed，and if this interface is implemented, the callback mapView:regionDidChangeAnimated: will not be triggered

Parameters

  mapView | 地图View Map View
  animated | 是否动画 Whether to animate
  wasUserAction | 标识是否是用户动作 Indicates whether it is a user action

## ◆ mapView:regionWillChangeAnimated:

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

地图区域即将改变时会调用此接口 This interface will be called when the map region is about to change

Parameters

  mapView | 地图View Map View
  animated | 是否动画 Whether to animate

## ◆ mapView:regionWillChangeAnimated:wasUserAction:

- (void) mapView: |  | (MAMapView *) | mapView
regionWillChangeAnimated: |  | (BOOL) | animated
wasUserAction: |  | (BOOL) | wasUserAction
| optional

地图区域即将改变时会调用此接口，如实现此接口则不会触发回掉mapView:regionWillChangeAnimated: This interface will be called when the map region is about to change, and if this interface is implemented, the callback mapView:regionWillChangeAnimated: will not be triggered

Parameters

  mapView | 地图View Map View
  animated | 是否动画 Whether to animate
  wasUserAction | 标识是否是用户动作 Indicates whether it is a user action

## ◆ mapView:rendererForOverlay:

- (MAOverlayRenderer *) mapView: |  | (MAMapView *) | mapView
rendererForOverlay: |  | (id< MAOverlay >) | overlay
| optional

根据overlay生成对应的Renderer Generate the corresponding Renderer based on the overlay

Parameters

  mapView | 地图View Map view
  overlay | 指定的overlay the specified overlay

Returns
  生成的覆盖物Renderer the generated overlay Renderer

## ◆ mapView:viewForAnnotation:

- (MAAnnotationView *) mapView: |  | (MAMapView *) | mapView
viewForAnnotation: |  | (id< MAAnnotation >) | annotation
| optional

根据anntation生成对应的View。 Generate corresponding View based on annotation.

注意： Note： 1、5.1.0后由于定位蓝点增加了平滑移动功能，如果在开启定位的情况先添加annotation，需要在此回调方法中判断annotation是否为MAUserLocation，从而返回正确的View。 if ([annotation isKindOfClass:[MAUserLocation class]]) { return nil; } After version 5.1.0, the positioning blue dot has added a smooth movement function. If you add an annotation while the positioning is turned on，it is necessary to determine whether the annotation is MAUserLocation in this callback method in order to return the correct View. if ([annotation isKindOfClass:[MAUserLocation class]]) { return nil; }

2、请不要在此回调中对annotation进行select和deselect操作，此时annotationView还未添加到mapview。 Please do not perform select or deselect operations on the annotation in this callback, as the annotationView has not been added to the mapView yet.

Parameters

  mapView | 地图View Map view
  annotation | 指定的标注 Specified annotation

Returns
  生成的标注View Generated annotation View

## ◆ mapViewDidFailLoadingMap:withError:

- (void) mapViewDidFailLoadingMap: |  | (MAMapView *) | mapView
withError: |  | (NSError *) | error
| optional

地图加载失败 The map fails to load

Parameters

  mapView | 地图View Map view
  error | 错误信息 Error message

## ◆ mapViewDidFinishLoadingMap:

- (void) mapViewDidFinishLoadingMap: |  | (MAMapView *) | mapView |
| optional

地图加载成功 The map is loaded successfully

Parameters

  mapView | 地图View Map view

## ◆ mapViewDidStopLocatingUser:

- (void) mapViewDidStopLocatingUser: |  | (MAMapView *) | mapView |
| optional

在地图View停止定位后，会调用此函数 This function will be called after the MapView stops locating

Parameters

  mapView | 地图View Map view

## ◆ mapViewRegionChanged:

- (void) mapViewRegionChanged: |  | (MAMapView *) | mapView |
| optional

地图区域改变过程中会调用此接口 since 4.6.0 This interface will be called during the map region change process. since 4.6.0

Parameters

  mapView | 地图View Map View

## ◆ mapViewRequireLocationAuth:

- (void) mapViewRequireLocationAuth: |  | (CLLocationManager *) | locationManager |
| optional

当plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription，并且[CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined，会调用代理的此方法。 此方法实现调用后台权限API即可（ 该回调必须实现 [locationManager requestAlwaysAuthorization] ）; since 6.8.0 When the plist is configured with NSLocationAlwaysUsageDescription or NSLocationAlwaysAndWhenInUseUsageDescription, and [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined, this method of the delegate will be called. This method just needs to call the background permission API (this callback must implement [locationManager requestAlwaysAuthorization]); since 6.8.0

Parameters

  locationManager | 地图的CLLocationManager。 Map's CLLocationManager

## ◆ mapViewWillStartLoadingMap:

- (void) mapViewWillStartLoadingMap: |  | (MAMapView *) | mapView |
| optional

地图开始加载 The map starts loading

Parameters

  mapView | 地图View Map view

## ◆ mapViewWillStartLocatingUser:

- (void) mapViewWillStartLocatingUser: |  | (MAMapView *) | mapView |
| optional

在地图View将要启动定位时，会调用此函数 This function is called when the map view is about to start positioning

Parameters

  mapView | 地图View Map view

## ◆ offlineDataDidReload:

- (void) offlineDataDidReload: |  | (MAMapView *) | mapView |
| optional

离线地图数据加载完成, 调用reloadMap会触发该回调，离线数据生效后的回调. Offline map data loading completed. Calling reloadMap will trigger this callback, which is the callback after the offline data takes effect.

Parameters

  mapView | 地图View, Map view

## ◆ offlineDataWillReload:

- (void) offlineDataWillReload: |  | (MAMapView *) | mapView |
| optional

离线地图数据将要被加载, 调用reloadMap会触发该回调，离线数据生效前的回调. Offline map data is about to be loaded, calling reloadMap will trigger this callback, the callback before the offline data takes effect.

Parameters

  mapView | 地图View Map view

The documentation for this protocol was generated from the following file:

- MAMapView.h

© 2017 高德信息技术有限公司 版权所有，保留所有权利。