目录

HMapViewDelegate

Class Info

@protocol HMapViewDelegate <NSObject>

Delegate class for HMapView.

Public Method Summary

Qualifier and Type

Method Name and Description

void

locationManagerDidChangeAuthorization:

Called when the user location permission changes.

void

mapViewDidStopLocatingUser:

Called when the map view stops location.

void

mapViewInitComplete:

Called after the map is initialized and configuration file is loaded.

void

mapViewWillStartLocatingUser:

Called when the map view is about to start location.

void

mapView:annotationViewCalloutTapped:

Called when a callout view is selected.

void

mapView:annotationView:didChangeDragState:fromOldState:

Called when the view status changes during the drag of the annotation view.

UIView *

mapView:customCalloutForAnnotationView:

Called when a CustomCallout object is generated based on annotationView.

void

mapView:didAddAnnotationViews:

Called when an annotation view is added to mapView.

void

mapView:didAddOverlayViews:

Called when an overlay view is added to mapView.

void

mapView:didChangeUserTrackingMode:animated:

Called when userTrackingMode changes during location.

void

mapView:didDeselectAnnotationView:

Called when an annotation view is deselected.

void

mapView:didFailToLocateUserWithError:

Called when location fails.

void

mapView:didLongGuestureTapAtCoordinate:

Called when the map is long pressed.

void

mapView:didSelectAnnotationView:

Called when an annotation view is selected.

void

mapView:didTapAtCoordinate:

Called when a blank area on the map is tapped.

void

mapView:didTapMyLocation:

Called when the my-location icon on the map is tapped.

void

mapView:didTapOverlay:

Called when an overlay on the map is tapped.

void

mapView:didTapPoi:

Called when a POI on the map is tapped.

void

mapView:didUpdateUserLocation:fromHeading:

Called when the user location is updated.

HAnnotationView *

mapView:viewForAnnotation:

Generates a view based on the specified annotation.

HOverlayView *

mapView:viewForOverlay:

Generates a view based on the specified overlay.

Public Methods

[h2]locationManagerDidChangeAuthorization:

Method

- (void)locationManagerDidChangeAuthorization:(HMapView *)mapView

Called when the user location permission changes.

Parameters

Name

Description

mapView

Map view.

[h2]mapViewDidStopLocatingUser:

Method

- (void)mapViewDidStopLocatingUser:(HMapView *)mapView

Called when the map view stops location.

Parameters

Name

Description

mapView

Map view.

[h2]mapViewInitComplete:

Method

- (void)mapViewInitComplete:(HMapView *)mapView

Called after the map is initialized and configuration file is loaded.

Parameters

Name

Description

mapView

Map view.

[h2]mapViewWillStartLocatingUser:

Method

- (void)mapViewWillStartLocatingUser:(HMapView *)mapView

Called when the map view is about to start location.

Parameters

Name

Description

mapView

Map view.

[h2]mapView:annotationViewCalloutTapped:

Method

- (void)mapView:(HMapView *)mapView annotationViewCalloutTapped:(HAnnotationView *)view

Called when a callout view is selected.

Parameters

Name

Description

mapView

Map view.

view

Annotation view corresponding to the selected callout view.

[h2]mapView:annotationView:didChangeDragState:fromOldState:

Method

- (void)mapView:(HMapView *)mapView annotationView:(HAnnotationView *)view didChangeDragState:(HAnnotationViewDragState)newState fromOldState:(HAnnotationViewDragState)oldState

Called when the view status changes during the drag of the annotation view.

Parameters

Name

Description

mapView

Map view.

view

Target annotation view.

newState

New status.

oldState

Old status.

[h2]mapView:customCalloutForAnnotationView:

Method

- (UIView *)mapView:(HMapView *)mapView customCalloutForAnnotationView:(HAnnotationView *)annotationView

Called when a CustomCallout object is generated based on annotationView.

Parameters

Name

Description

mapView

Map view.

annotationView

Specified annotation view.

Returns

Type

Description

UIView *

CustomCallout object.

[h2]mapView:didAddAnnotationViews:

Method

- (void)mapView:(HMapView *)mapView didAddAnnotationViews:(NSArray<HAnnotationView *> *)views

Called when an annotation view is added to mapView.

Parameters

Name

Description

mapView

Map view.

views

Added annotation view.

[h2]mapView:didAddOverlayViews:

Method

- (void)mapView:(HMapView *)mapView didAddOverlayViews:(NSArray *)overlayViews

Called when an overlay view is added to mapView.

Parameters

Name

Description

mapView

Map view.

overlayViews

Added overlay view.

[h2]mapView:didChangeUserTrackingMode:animated:

Method

- (void)mapView:(HMapView *)mapView didChangeUserTrackingMode:(HUserTrackingMode)mode animated:(BOOL)animated

Called when userTrackingMode changes during location.

Parameters

Name

Description

mapView

Map view.

mode

User tracking mode (HUserTrackingMode).

animated

Indicates whether animation is enabled.

  • YES
  • NO

[h2]mapView:didDeselectAnnotationView:

Method

- (void)mapView:(HMapView *)mapView didDeselectAnnotationView:(HAnnotationView *)view

Called when an annotation view is deselected.

Parameters

Name

Description

mapView

Map view.

view

Annotation view that is deselected.

[h2]mapView:didFailToLocateUserWithError:

Method

- (void)mapView:(HMapView *)mapView didFailToLocateUserWithError:(NSError *)error

Called when location fails.

Parameters

Name

Description

mapView

Map view.

error

Error code, which is defined in CLError.h.

[h2]mapView:didLongGuestureTapAtCoordinate:

Method

- (void)mapView:(HMapView *)mapView didLongGuestureTapAtCoordinate:(CLLocationCoordinate2D)coordinate

Called when the map is long pressed.

Parameters

Name

Description

mapView

Map view.

coordinate

Longitude-latitude coordinates.

[h2]mapView:didSelectAnnotationView:

Method

- (void)mapView:(HMapView *)mapView didSelectAnnotationView:(HAnnotationView *)view

Called when an annotation view is selected.

Parameters

Name

Description

mapView

Map view.

view

Selected annotation view.

[h2]mapView:didTapAtCoordinate:

Method

- (void)mapView:(HMapView *)mapView didTapAtCoordinate:(CLLocationCoordinate2D)coordinate

Called when a blank area on the map is tapped.

Parameters

Name

Description

mapView

Map view.

coordinate

Coordinates.

[h2]mapView:didTapMyLocation:

Method

- (void)mapView:(HMapView *)mapView didTapMyLocation:(CLLocationCoordinate2D)location

Called when the my-location icon on the map is tapped.

Parameters

Name

Description

mapView

Map view.

location

Longitude-latitude coordinates of the pinpointed location.

[h2]mapView:didTapOverlay:

Method

- (void)mapView:(HMapView *)mapView didTapOverlay:(id <HOverlay>)overlay

Called when an overlay on the map is tapped.

Parameters

Name

Description

mapView

Map view.

overlay

Overlay object. Currently, only lines (Polyline and its subclasses) can be tapped.

[h2]mapView:didTapPoi:

Method

- (void)mapView:(HMapView *)mapView didTapPoi:(HPoiInfo *)poi

Called when a POI on the map is tapped.

Parameters

Name

Description

mapView

Map view.

poi

POI data.

[h2]mapView:didUpdateUserLocation:fromHeading:

Method

- (void)mapView:(HMapView *)mapView didUpdateUserLocation:(HUserLocation *)userLocation fromHeading:(BOOL)fromHeading

Called when the user location is updated.

Parameters

Name

Description

mapView

Map view.

userLocation

New user location.

fromHeading

Indicates whether the update is triggered by heading change.

  • YES: The update is triggered by heading change.
  • NO: The update is triggered by location change.

[h2]mapView:viewForAnnotation:

Method

- (HAnnotationView *)mapView:(HMapView *)mapView viewForAnnotation:(id <HAnnotation>)annotation

Generates a view based on the specified annotation.

Parameters

Name

Description

mapView

Map view.

annotation

Specified annotation.

Returns

Type

Description

HAnnotationView *

Generated annotation view.

[h2]mapView:viewForOverlay:

Method

- (HOverlayView *)mapView:(HMapView *)mapView viewForOverlay:(id <HOverlay>)overlay

Generates a view based on the specified overlay.

Parameters

Name

Description

mapView

Map view.

overlay

Specified overlay.

Returns

Type

Description

HOverlayView *

Generated overlay view.