Class: IWElectronicHorizon

IWElectronicHorizon

A class representing the Electronic Horizon

This class is part of the module horizon.


new IWElectronicHorizon()

Creates an Electronic Horizon and matches any given object position on it

Methods


getClosestSegment()

Gets the closest segement
Returns:
Type
Array

getContexts()

Returns the list of requested contexts mapped to IW internal names.
Returns:
Type
Array

getCreationTimestamp()

Returns the time the latest horizon was created as a Unix timestamp.
Returns:
Type
Number

getCurrentLocation()

Returns the current location
Returns:
Type
Object

getDistanceToHorizonEnd()

Returns the distance to the horizon end, in meters.
Returns:
Type
Number

getEvent()

Returns the event to be triggered for the match
Returns:
Type
Object

getHorizon(position, heading, speed, parameterObject)

Gets the horizon items ahead of the position. Triggers the Horizon Matched event when done
Parameters:
Name Type Description
position IWCoordinate
heading Number N-CW bearing
speed Number
parameterObject Object

getHorizonRequestedTimestamp()

Returns the time the horizon was requested
Returns:
Type
Number

getLatestHorizonTotalLength()

Returns the total length of the current horizon.
Returns:
Type
Number

getLength()

Gets the requested length of the horizon
Returns:
Type
Number

getParameterObject()

Gets the parameter object to be sent back with the event
Returns:
Type
Object

getPath()

Returns the most probable route as an array of polylines.
Returns:
Type
Array

getPOIs()

Returns the list of all the Points of Interest for the current horizon as an array of points.
Returns:
Type
Array

getReasonsForRecalculating()

Gets the reasons for recalculating
Returns:
Type
Array

getTunnels()

Returns the segments of tunnels ahead
Returns:
Type
Array

setClosestSegment(closestSegment)

Sets the latest closest segment
Parameters:
Name Type Description
closestSegment Array
Returns:
Type
void

setCreationTimestamp(timestamp)

Sets the time the latest horizon was created as a Unix timestamp.
Parameters:
Name Type Description
timestamp Number
Returns:
Type
void

setCurrentLocation(currentLocation)

Sets the current position on the horizon
Parameters:
Name Type Description
currentLocation Object
Returns:
Type
void

setDistanceToHorizonEnd(latestHorizonTotalLength)

Sets the total length of the current horizon.
Parameters:
Name Type Description
latestHorizonTotalLength Number in meters
Returns:
Type
void

setDistanceToHorizonEnd(distanceToHorizonEnd)

Sets the distance to the end of horizon - updated each time the position is updated.
Parameters:
Name Type Description
distanceToHorizonEnd Number in meters
Returns:
Type
void

setEvent(event)

Sets the event to be triggered to the user
Parameters:
Name Type Description
event Object
Returns:
Type
void

setHorizonRequestedTimestamp(horizonRequestedTimestamp)

Sets the time the horizon was requested
Parameters:
Name Type Description
horizonRequestedTimestamp Number
Returns:
Type
void

setLatestHorizon(latestHorizon)

Sets the latest retrieved horizon, in its original form as retrieved from the server
Parameters:
Name Type Description
latestHorizon Object
Returns:
Type
void

setLatestHorizonTotalLength(latestHorizonTotalLength)

Sets the latest retrieved horizon's total length
Parameters:
Name Type Description
latestHorizonTotalLength Number
Returns:
Type
void

setParameterObject(parameterObject)

Sets the parameter object to be sent back with the event
Parameters:
Name Type Description
parameterObject Object
Returns:
Type
void

setPath(path)

Sets the path ahead.
Parameters:
Name Type Description
path Array
Returns:
Type
void

setPOIs(POIs)

Sets the time the latest horizon was created as a Unix timestamp.
Parameters:
Name Type Description
POIs Array
Returns:
Type
void

setReasonsForRecalculating(reasonsForRecalculating)

Sets the reasons for recalculating
Parameters:
Name Type Description
reasonsForRecalculating Array
Returns:
Type
void

setTunnels(tunnels)

Sets the tunnels ahead
Parameters:
Name Type Description
tunnels Array
Returns:
Type
void