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.
-
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
smartMapthe object that called this delegate method.
-
Called when the map is clicked.
Declaration
Objective-C
- (BOOL)spSmartMapView:(nonnull SPSmartMapView *)smartMap onMapClicked:(nonnull NSArray<SPSmartMapObject *> *)objects;Swift
optional func spSmartMapView(_ smartMap: SPSmartMapView, onMapClicked objects: [SPSmartMapObject]) -> BoolParameters
smartMapthe object that called this delegate method.
objectslist of map objects that were clicked or empty array if no objects were found
Return Value
true if map event was consumed by the app. If so, SDK ignores click event.
-
Called when the views of smartMap changed
Declaration
Objective-C
- (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap onViewStatusChanged:(SPMapViewStatus)status withPOIDetail:(nullable SPSmartMapObject *)objectDetail;Swift
optional func spSmartMapView(_ smartMap: SPSmartMapView, onViewStatusChanged status: SPMapViewStatus, withPOIDetail objectDetail: SPSmartMapObject?)Parameters
smartMapthe object that called this delegate method.
statusCurrent map status
objectDetailDetail of POI existing in the current view if any.
-
Called when the state of the smart bottom sheet changed
Declaration
Objective-C
- (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap onBottomSheetChanged:(SPSmartMapBottomSheetViewState)state;Swift
optional func spSmartMapView(_ smartMap: SPSmartMapView, onBottomSheetChanged state: SPSmartMapBottomSheetViewState)Parameters
smartMapthe object that called this delegate method.
stateCurrent bottom sheet state
-
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
smartMapThe object that sent this event
emailThe email address that should be sent to
-
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
smartMapthe object that called this delegate method.
floorIndexthe new visible floor index
buildingRefvisible 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
smartMapthe object that called this delegate method.
floorIndexthe floor index for the user
buildingRefthe building identifier for the user or nil if the user is outside
-
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
smartMapthe 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
smartMapthe 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
smartMapthe 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
smartMapthe 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
errordescribes why navigation fails. See ‘SPNavigationError’ documentation for more details.
-
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
smartMapthe object that called this delegate method.
identifierunique 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
smartMapthe object that called this delegate method.
identifierunique 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
smartMapthe object that called this delegate method.
identifierunique identifier for the live object
inGeofencesarray of geofences that the user is in
statusextra information on the state of the object
-
Undocumented
Declaration
Objective-C
-(BOOL)spSmartMapView:(SPSmartMapView*)smartMap onSearchResultSelected:(SPSmartMapObject*)mapObject;Swift
optional func spSmartMapView(_ smartMap: SPSmartMapView, onSearchResultSelected mapObject: SPSmartMapObject) -> Bool -
Called when a search category search action is exceuted and have the results.
Declaration
Objective-C
- (void)spSmartMapView:(nonnull SPSmartMapView *)smartMap onSearchCategorySelected:(nonnull NSDictionary *)searchAction searchResults: (nonnull NSArray<SPSmartMapObject *> *)searchResults;Swift
optional func spSmartMapView(_ smartMap: SPSmartMapView, onSearchCategorySelected searchAction: [AnyHashable : Any], searchResults: [SPSmartMapObject])Parameters
smartMapthe object that called this delegate method.
searchActionThe search action for category that got selected
searchResultsThe results of category search action
SPSmartMapViewDelegate Protocol Reference