WayfindingManager
Properties
locationRepository
Type | Read-Only | Default | Description |
---|---|---|---|
LocationRepository | YES | - |
Methods
addEventListener
addEventListener ( type : string, listener: function ) : null
Adds a listener to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
computePath
async computePath(path: Path): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
path | Path | Yes | - |
Returns:
Type: Promise<void, Error>
drawPathSection
async drawPathSection(pathSection: PathSection, options = null: DotPathSectionDrawerOptions, animated = true: boolean): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
pathSection | Path | Yes | - | |
options | ?DotPathSectionDrawerOptions | No | null | Drawer options to be used for that pathSection instead of using default ones |
animated | boolean | No | true |
Returns:
Type: Promise<void, Error>
getUserDistanceFromPath
async getUserDistanceFromPath(path: Path): Promise<number, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
path | Path | Yes | - |
Returns:
Type: Promise<number, Error>
getUserDistanceFromPathSection
async getUserDistanceFromPathSection(pathSection: PathSection): Promise<number, Error>
Get the user distance from the pathSection.
If the user is not on the same ground than the pathSection then it will return Infinity.
Note that this will not test if the user can go to that path section.
This method is intended to be used at close range to check if the path need redraw.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
pathSection | Path | Yes | - |
Returns:
Type: Promise<number, Error>
getUserGpsPosition
async getUserDistanceFromPathSection(pathSection: PathSection): Promise<?{floor: ?FloorObject, utm: {E: number, N: number, alt: number}}, Error>
Returns:
Type: Promise<?{floor: ?FloorObject, utm: {E: number, N: number, alt: number}}, Error>
getUserPathSectionProgress
async getUserPathSectionProgress(pathSection: PathSection): Promise<{ distanceFromPathSection: number, progress: number }, Error>
Get the user progress on the pathSection and the distance from it.
If the user is not on the same ground than the pathSection then it will return Infinity distance and 0 progress.
Note that this will not test if the user can go to that path section.
This method is intended to be used at close range to check if the path need redraw.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
pathSection | Path | Yes | - |
Returns:
The distance from path section (see getUserDistanceFromPathSection)
and the progress
representing the progression from 0 to 1.
Note if distanceFromPathSection
is equal to Infinity
then progress
will be equals to 0.
Type: Promise<{ distanceFromPathSection: number, progress: number }, Error>
getUserUtmPosition
async getUserDistanceFromPathSection(pathSection: PathSection): Promise<?{floor: ?FloorObject, gps: {lat: number, long: number, alt: number}}, Error>
Returns:
Type: Promise<?{floor: ?FloorObject, gps: {lat: number, long: number, alt: number}}, Error>
hasEventListener
hasEventListener( type : string, listener: function ) : boolean
Checks if listener is added to an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of event to listen to. |
listener | function | Yes | The function that gets called when the event is fired. |
Returns:
Type: null
removeEventListener
removeEventListener ( type : string, listener: function ) : null
Removes a listener from an event type.
Parameters:
Name | Type | Required | Description |
---|---|---|---|
type | string | Yes | The type of the listener that gets removed. |
listener | function | Yes | The listener function that gets removed. |
Returns:
Type: null
removePath
async removePath(path: Path): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
path | Path | Yes | - |
Returns:
Type: Promise<void, Error>
removePathSection
async removePathSection(pathSection: PathSection): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
pathSection | Path | Yes | - |
Returns:
Type: Promise<void, Error>
setUserAdsumPosition
async setUserAdsumPosition(position: {x: number, y: number, z: number}, floor = null: ?FloorObject, isWorldPosition = false: boolean): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
position | {x: number, y: number, z: number} | Yes | - | |
floor | ?FloorObject | No | null | |
isWorldPosition | boolean | no | false |
Returns:
Type: Promise<void, Error>
setUserAzimuthHeading
async setUserAzimuthHeading(azimuth: number): Promise<void, Error>
Rotates the user object by setting the azimuth angle.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
azimuth | number | Yes | - | Azimuth angle in degrees |
Returns:
Type: Promise<void, Error>
setUserGpsPosition
async setUserGpsPosition(gpsPosition: {lat: number, long: number, alt: number}, floor = null: ?FloorObject): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
gpsPosition | {lat: number, long: number, alt: number} | Yes | - | |
floor | ?FloorObject | No | null |
Returns:
Type: Promise<void, Error>
setUserUtmPosition
async setUserUtmPosition(utmPosition: {E: number, N: number, alt: number}, floor = null: ?FloorObject): Promise<void, Error>
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
utmPosition | {E: number, N: number, alt: number} | Yes | - | |
floor | ?FloorObject | No | null |
Returns:
Type: Promise<void, Error>
Events
WAYFINDING_EVENTS.user.position.didChanged
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.floor | ?FloorObject |