WayfindingManager
Properties
locationRepository
Type | Read-Only | Default | Description |
---|---|---|---|
LocationRepository | YES | new LocationRepository() |
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
getUserDistanceFromPath(path: Path): number
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
path | Path | Yes | - |
Returns:
Type: number
getUserDistanceFromPathSection
getUserDistanceFromPathSection(pathSection: PathSection): number
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: number
getUserGpsPosition
getUserDistanceFromPathSection(pathSection: PathSection): ?{floor: ?FloorObject, utm: {E: number, N: number, alt: number}}
Returns:
Type: ?{floor: ?FloorObject, utm: {E: number, N: number, alt: number}}
getUserPathSectionProgress
getUserPathSectionProgress(pathSection: PathSection): { distanceFromPathSection: number, progress: number }
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: { distanceFromPathSection: number, progress: number }
getUserUtmPosition
getUserDistanceFromPathSection(pathSection: PathSection): ?{floor: ?FloorObject, gps: {lat: number, long: number, alt: number}}
Returns:
Type: ?{floor: ?FloorObject, gps: {lat: number, long: number, alt: number}}
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>
reset
reset () : WayfindingManager
Stop any running draw and remove all paths.
Returns:
Type: WayfindingManager
setUserAzimuthHeading
setUserAzimuthHeading(azimuth: number): WayfindingManager
Rotates the user object by setting the azimuth angle.
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
azimuth | number | Yes | - | Azimuth angle in degrees |
Returns:
Type: WayfindingManager
setUserAdsumPosition
setUserAdsumPosition(position: {x: number, y: number, z: number}, floor = null: ?FloorObject, isWorldPosition = false: boolean): WayfindingManager
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
position | {x: number, y: number, z: number} | Yes | - | |
floor | ?FloorObject | No | null | |
isWorldPosition | boolean | no | false |
Returns:
Type: WayfindingManager
setUserGpsPosition
setUserGpsPosition(gpsPosition: {lat: number, long: number, alt: number}, floor = null: ?FloorObject): WayfindingManager
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
gpsPosition | {lat: number, long: number, alt: number} | Yes | - | |
floor | ?FloorObject | No | null |
Returns:
Type: WayfindingManager
setUserUtmPosition
setUserUtmPosition(utmPosition: {E: number, N: number, alt: number}, floor = null: ?FloorObject): WayfindingManager
Parameters:
Name | Type | Required | Default | Description |
---|---|---|---|---|
utmPosition | {E: number, N: number, alt: number} | Yes | - | |
floor | ?FloorObject | No | null |
Returns:
Type: WayfindingManager
Events
WAYFINDING_EVENTS.user.position.didChanged
The listener will receive the following parameters
Listener Parameters:
Name | Type | Description |
---|---|---|
data | object | |
data.floor | ?FloorObject |