SPSmartMapViewDelegate

Objective-C

@protocol SPSmartMapViewDelegate <NSObject>

Swift

protocol SPSmartMapViewDelegate : NSObjectProtocol

SPSmartMapViewDelegate

The ‘SPSmartMapViewDelegate’ protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the ‘SPSmartMapViewDelegate’ class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete.

Map Lifecycle Events

  • Called when map style has loaded and the map is ready to be used.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnMapLoaded:(nonnull SPSmartMapView *)smartMap;

    Swift

    optional func spSmartMapView(onMapLoaded smartMap: SPSmartMapView)

    Parameters

    smartMap

    the object that called this delegate method.

Map Interaction Events

Map Settings Interaction Events

  • Called when an external link that is used to send email is clicked

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        shouldSendEmailToAddress:(nonnull NSString *)email;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, shouldSendEmailToAddress email: String)

    Parameters

    smartMap

    The object that sent this event

    email

    The email address that should be sent to

Building and Floor Events

  • Called after the visible floor or building on the map has changed. The ‘buildingRef’ parameter is nil if there is no ‘visible’ building.

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        onVisibleFloorChanged:(NSInteger)floorIndex
                  buildingRef:(nullable NSString *)buildingRef;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, onVisibleFloorChanged floorIndex: Int, buildingRef: String?)

    Parameters

    smartMap

    the object that called this delegate method.

    floorIndex

    the new visible floor index

    buildingRef

    visible building identifier or nil if no visible building

  • Called after the user moves onto a new floor or building. The ‘buildingRef’ parameter is nil if the user has moved outside of a building.

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        onUserFloorChanged:(NSInteger)floorIndex
               buildingRef:(nullable NSString *)buildingRef;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, onUserFloorChanged floorIndex: Int, buildingRef: String?)

    Parameters

    smartMap

    the object that called this delegate method.

    floorIndex

    the floor index for the user

    buildingRef

    the building identifier for the user or nil if the user is outside

Navigation Events

  • Called when navigation route calculation is done and the route preview will be displayed.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnNavigationPreviewAppeared:
        (nonnull SPSmartMapView *)smartMap;

    Swift

    optional func spSmartMapView(onNavigationPreviewAppeared smartMap: SPSmartMapView)

    Parameters

    smartMap

    the object that called this delegate method.

  • Called when navigation starts or a navigation route was recalculated and navigation starts from the new position.

    Shows navigation instructions.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnNavigationStarted:(nonnull SPSmartMapView *)smartMap;

    Swift

    optional func spSmartMapView(onNavigationStarted smartMap: SPSmartMapView)

    Parameters

    smartMap

    the object that called this delegate method.

  • Called when user has reached the destination.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnNavigationDestinationReached:
        (nonnull SPSmartMapView *)smartMap;

    Swift

    optional func spSmartMapView(onNavigationDestinationReached smartMap: SPSmartMapView)

    Parameters

    smartMap

    the object that called this delegate method.

  • Called when navigation is stopped. Navigation will be stopped when user cancels navigation, the calls ‘stopNavigation’ method or when user has reached the destination.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnNavigationEnded:(nonnull SPSmartMapView *)smartMap;

    Swift

    optional func spSmartMapView(onNavigationEnded smartMap: SPSmartMapView)

    Parameters

    smartMap

    the object that called this delegate method.

  • Called if navigation fails.

    Declaration

    Objective-C

    - (void)spSmartMapViewOnNavigationFailed:(nonnull SPSmartMapView *)smartMap
                                   withError:(SPNavigationError)error;

    Swift

    optional func spSmartMapView(onNavigationFailed smartMap: SPSmartMapView, withError error: SPNavigationError)

    Parameters

    error

    describes why navigation fails. See ‘SPNavigationError’ documentation for more details.

Live Data

  • Called when a new live objects will appear on the map.

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        onLiveObjectWillAppear:(nonnull NSString *)identifier;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, onLiveObjectWillAppear identifier: String)

    Parameters

    smartMap

    the object that called this delegate method.

    identifier

    unique identifier for the live object

  • Called when a live object will disappear from the map.

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        onLiveObjectWillDisappear:(nonnull NSString *)identifier;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, onLiveObjectWillDisappear identifier: String)

    Parameters

    smartMap

    the object that called this delegate method.

    identifier

    unique identifier for the live object

  • Called when a live object is updated on the map.

    Declaration

    Objective-C

    - (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap
        onLiveObjectUpdated:(nonnull NSString *)identifier
                inGeofences:(nonnull NSArray<NSString *> *)inGeofences
                     status:(SPLiveObjectStatus)status;

    Swift

    optional func spSmartMapView(_ smartMap: SPSmartMapView, onLiveObjectUpdated identifier: String, inGeofences: [String], status: SPLiveObjectStatus)

    Parameters

    smartMap

    the object that called this delegate method.

    identifier

    unique identifier for the live object

    inGeofences

    array of geofences that the user is in

    status

    extra information on the state of the object

Search events