SitumMapsLibrary

@objc
public class SitumMapsLibrary : NSObject, SitumMap

Class used to load the wayfinding module on a given view

  • Settings variable used to configure the module with all needed parameters.

    Declaration

    Swift

    public private(set) var settings: LibrarySettings?
  • Initializes the library and checks the user’s credentials.

    Declaration

    Swift

    @available(*, deprecated, renamed: "init", message: "Please use ")
    @objc
    public convenience init(containedBy view: UIView, controlledBy viewController: UIViewController)

    Parameters

    view

    View object that will contain the wayfinding UI

    viewController

    View controller associated with the containing view

  • Designated initializer

    Use this to create an instance of the SitumMapsLibrary.

    After that, load it into memory with the load() method.

    Declaration

    Swift

    @objc
    public init(containedBy view: UIView, controlledBy viewController: UIViewController, withSettings settings: LibrarySettings)
  • try to load the module. This method can throw an exception if needed parameters are not set. See init method to know how to properly configure an instance.

    Declaration

    Swift

    @objc
    public func load() throws
  • Sets the credentials that will be used to authenticate when “load(buildingWithId:, logWith:)” is called

    Declaration

    Swift

    @available(*, deprecated, message: "Use property on LibrarySettings instance instead")
    @objc
    public func setCredentials(_ credentials: Credentials)
  • Loads the Wayfinding UI in the assigned view and shows the selected building. If no Credentials have been set, this method will throw an exception.

    Declaration

    Swift

    @available(*, deprecated, message: "Use load instead")
    @objc
    public func load(buildingWithId buildingId: String?) throws

    Parameters

    buildingId

    Id of the building to be load

  • Loads the Wayfinding UI in the assigned view using the provided map and shows the selected building. If no Credentials have been set, this method will throw an exception.

    Declaration

    Swift

    @available(*, deprecated, message: "Use load instead")
    @objc
    public func load(buildingWithId buildingId: String?, googleMapsMap gMap: GMSMapView?) throws

    Parameters

    buildingId

    Id of the building to be load

    googleMapsMap

    Map to be used to present info

  • Stops Stum Navigation

    Declaration

    Swift

    @objc
    public func stopNavigation()
  • Stops Situm Positioning

    Declaration

    Swift

    @objc
    public func stopPositioning()
  • Provides the GMSMapView instance used inside the Wayfinding view

    Declaration

    Swift

    @available(*, deprecated, message: "Use LibrarySettings.getGoogleMap instead")
    public func getGoogleMap() -> GMSMapView?

    Return Value

    A GMSMapView instance which is the same being used by the Wayfinding controller

  • Retrieve the properties the module has been loaded with.

    Declaration

    Swift

    @objc
    public func getSettings() -> LibrarySettings?
  • Allows setting a closure with a custom exit segue that will be executed when the “Go back” button is pressed. You may also include operations to be done before closing the wayfinding view. If no callback is set, the wayfinding view will try to exit using NavigationController method: popViewController(animated: Bool)

    Declaration

    Swift

    public func setOnBackPressedCallback(_ callback: @escaping (_ sender: Any) -> Void)

    Parameters

    callback

    Closure used to perform the exit segue from the wayfinding view

  • Sets an interceptor to read or modify the location request before is actually used to start positioning. Multiple interceptors can be add and they will be executed in the same order as they were set.

    Declaration

    Swift

    public func addLocationRequestInterceptor(_ interceptor: @escaping (SITLocationRequest) -> Void)

    Parameters

    interceptor

    Closure that will be executed with the location request as its parameter before starting the positioning

  • Sets an interceptor to read or modify the directions request before is actually used to start guiding Multiple interceptors can be add and they will be executed in the same order as they were set.

    Declaration

    Swift

    public func addDirectionsRequestInterceptor(_ interceptor: @escaping (SITDirectionsRequest) -> Void)

    Parameters

    interceptor

    Closure that will be executed with the directions request as its parameter before starting the guidance

  • Sets an interceptor to read or modify the navigation request before is actually used to obtain a route Multiple interceptors can be add and they will be executed in the same order as they were set.

    Declaration

    Swift

    public func addNavigationRequestInterceptor(_ interceptor: @escaping (SITNavigationRequest) -> Void)

    Parameters

    interceptor

    Closure that will be executed with the navigation request as its parameter before starting the navigation