@magiclane/maps-sdk
    Preparing search index...

    Class PositionService

    Position service class

    Index

    Accessors

    • get improvedPosition(): GemImprovedPosition | null

      Gets the latest improved position data available

      Returns GemImprovedPosition | null

      Latest improved position or null if not available

      An exception if it fails

    • get position(): GemPosition | null

      Gets the latest position data available

      Returns GemPosition | null

      Latest position or null if not available

      An exception if it fails

    • get sourceType(): DataSourceType

      Gets the method used to obtain position data

      Returns DataSourceType

      The data source type

      An exception if it fails

    Methods

    • Register a new improved position listener

      Parameters

      • positionUpdatedCallback: (position: GemImprovedPosition) => void

        The callback for improved position updates

      Returns GemPositionListener

      The created position listener

      An exception if it fails

    • Register a new listener for position updates

      Parameters

      • positionUpdatedCallback: (position: GemPosition) => void

        The callback for position updates

      Returns GemPositionListener

      The created position listener

      An exception if it fails

    • Gets the current data source used for position data

      Returns DataSource | null

      The data source or null if none exists

      An exception if it fails

    • Returns GemPosition | null

      Use the position getter instead

    • Removes the current position data source

      Returns void

      An exception if it fails

    • Unregister a position listener

      Parameters

      Returns void

      An exception if it fails

    • Requests location permission and sets live data source

      Returns Promise<boolean>

      Promise resolving to true if permission granted and live data source set successfully

      An exception if it fails

    • Sets an external data source for position data

      Parameters

      Returns GemError

      GemError indicating success or failure

      An exception if it fails

    • Sets the position service current datasource to live

      Returns GemError

      GemError indicating success or failure

      An exception if it fails

    • Requests location permission (Web only)

      Returns Promise<boolean>

      Promise resolving to true if permission granted

      UnimplementedError on iOS/Android