HereSDKMapViewDelegate

@protocol HereSDKMapViewDelegate <NSObject>

Protocol for receiving map view updates.

  • Received when user hash is expired

    Declaration

    Objective-C

    - (void)mapViewAuthenticationDidFail:(nonnull HereSDKMapView *)mapView
                               withError:(nonnull NSError *)error;

    Swift

    optional func mapViewAuthenticationDidFail(_ mapView: HereSDKMapView, withError error: Error)

    Parameters

    mapView

    mapview instance

    error

    the error passed to delegate

  • Update that mapview finished loading (its definition)

    Declaration

    Objective-C

    - (void)mapViewDidFinishLoadingMap:(nonnull HereSDKMapView *)mapView;

    Swift

    optional func mapViewDidFinishLoadingMap(_ mapView: HereSDKMapView)

    Parameters

    mapView

    mapview that finished loading

  • Return annotation style for specific annotation

    Declaration

    Objective-C

    - (nullable HereSDKAnnotationStyle *)mapView:(nonnull HereSDKMapView *)mapView
                              styleForAnnotation:
                                  (nonnull id<HereSDKAnnotation>)annotation;

    Parameters

    mapView

    mapview that has annotation

    annotation

    annotation to style

    Return Value

    annotation style

  • Update that user location was updated on mapview

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didUpdateUserLocationAnnotation:
            (nonnull HereSDKUserLocationAnnotation *)userLocationAnnotation;

    Swift

    optional func mapView(_ mapView: HereSDKMapView, didUpdate userLocationAnnotation: HereSDKUserLocationAnnotation)

    Parameters

    mapView

    mapview that present user location

    userLocationAnnotation

    userLocationAnnotation that has been updated

  • Update that mapview recognized a long press gesture

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didRecognizeLongPressGestureForLocation:(nonnull CLLocation *)location;

    Swift

    optional func mapView(_ mapView: HereSDKMapView, didRecognizeLongPressGestureFor location: CLLocation)

    Parameters

    mapView

    mapview that recognized the long press gesture

    location

    CLLocation of the gesture

  • Update that mapview recognized a tap gesture

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didTapLocation:(nonnull CLLocation *)location;

    Swift

    optional func mapView(_ mapView: HereSDKMapView, didTap location: CLLocation)

    Parameters

    mapView

    mapview that recognized the tap gesture

    location

    CLLocation of the gesture

  • Tells the receiver an annotation was tapped

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didTapAnnotation:(nonnull id<HereSDKAnnotation>)annotation;

    Parameters

    mapView

    mapview that has annotation

    annotation

    annotation that was tapped

  • Tells the receiver an annotation was long tapped

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didLongTapAnnotation:(nonnull id<HereSDKAnnotation>)annotation;

    Parameters

    mapView

    mapview that has annotation

    annotation

    annotation that was long tapped

  • Returns a Boolean value indicating whether the annotation is able to display extra information in a callout bubble.

    This method is called after an annotation is selected, before any callout is displayed for the annotation.

    If the return value is YES, a callout view is shown when the user taps on an annotation, selecting it. The default callout displays the annotation’s title and subtitle. You can customize the callout’s contents by implementing the -mapView:calloutViewForAnnotation: method.

    If the return value is NO, or if this method is absent from the delegate, or if the annotation lacks a title or subtitle or the mapView:calloutViewForAnnotation: is absent from the delegate or returns nil, the annotation will not show a callout even when selected.

    Declaration

    Objective-C

    - (BOOL)mapView:(nonnull HereSDKMapView *)mapView
        annotationCanShowCallout:(nonnull id<HereSDKAnnotation>)annotation;
  • Returns a callout view to display for the given annotation.

    If this method is present in the delegate, it must return a new instance of a view dedicated to display the callout. The returned view will be configured by the map view.

    If this method is absent from the delegate, or if it returns nil, a standard, two-line, bubble-like callout view is displayed by default.

    Declaration

    Objective-C

    - (nullable UIView *)mapView:(nonnull HereSDKMapView *)mapView
        calloutViewForAnnotation:(nonnull id<HereSDKAnnotation>)annotation;
  • Tells the receiver an annotation was selected and presented its view on the map

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didSelectAnnotation:(nonnull id<HereSDKAnnotation>)annotation;

    Parameters

    mapView

    mapview that has annotation

    annotation

    annotation that was selected

  • Tells the receiver an annotation was deselected and its view on the map was hidden

    Declaration

    Objective-C

    - (void)mapView:(nonnull HereSDKMapView *)mapView
        didDeselectAnnotation:(nonnull id<HereSDKAnnotation>)annotation;

    Parameters

    mapView

    mapview that has annotation

    annotation

    annotation that was deselected