@jibestream-dev/jmap-navigation-kit v1.2.0
Classes
Direction
Returns an English direction, given three waypoints with which to calculate
Kind: global class
new Direction(a, b, c, threshold, uTurnThreshold)
Creates a Direction
Param | Type | Default | Description |
---|---|---|---|
a | jmap.core.Waypoint | The first waypoint in the series of three waypoints | |
b | jmap.core.Waypoint | The second waypoint in the series of three waypoints | |
c | jmap.core.Waypoint | The third waypoint in the series of three waypoints | |
threshold | Number | 20 | The threshold for deciding between forward and left/right |
uTurnThreshold | Number | 45 | The threshold for deciding a U-Turn |
direction.getValue() ⇒ String
- Returns the English direction for the current instance of a Direction
Kind: instance method of Direction
Returns: String - - The English direction for the current instance of a Direction
Access: public
Instruction
Returns an Instruction, given a Direction object
Kind: global class
new Instruction(direction)
Creates an Instruction
Param | Type | Description |
---|---|---|
direction | Direction | The direction that will be used to generate the instruction |
InstructionFactory
Returns an Instruction Factory, which can be used to create an empty or populated Instruction
Kind: global class
new InstructionFactory(direction)
Creates an Instruction
Param | Type | Description |
---|---|---|
direction | Direction | The direction that will be used to generate the instruction |
instructionFactory.createFromDirection(direction) ⇒ Instruction
- Sets the distance of the Instruction, based on two Waypoints
Kind: instance method of InstructionFactory
Returns: Instruction - - The Instruction generated with the specified Direction
Access: public
Param | Type | Description |
---|---|---|
direction | Direction | The direction with which to create the Instruction |
instructionFactory.setSurroundingElements(instruction)
- Sets the surrounding elements of the navigation kit, based on the specified instruction
Kind: instance method of InstructionFactory
Access: public
Param | Type | Description |
---|---|---|
instruction | Instruction | The Instruction with which to calculate the surrounding elements |
instructionFactory.setSurroundingDefinition(instruction)
- Sets the surrounding definition of the specified instruction
Kind: instance method of InstructionFactory
Access: public
Param | Type | Description |
---|---|---|
instruction | Instruction | The instruction that will have its surrounding definition updated |
InstructionFactory.createEmpty() ⇒ Instruction
- Returns an empty Instruction
Kind: static method of InstructionFactory
Returns: Instruction - - The Instruction generated with the specified Direction
Access: public
NavigationKit
Returns a NavigationKit, which can be used to generate Directions and Instructions
Kind: global class
- NavigationKit
- new NavigationKit(control, options)
- instance
- .setAngleThreshold(threshold)
- .setUTurnThreshold([uTurnThreshold])
- .getSurroundingElements(definition) ⇒ Array.<SurroundElements>
- .createInstructionsFromPath(pathPerFloor) ⇒ Array.<Instruction>
- .hasUserVeeredOffRoute(route) ⇒ Number
- .drawPathWithInstructions(pathPerFloor, [pathStyle], [popupStyle], [fontStyle]) ⇒ Object
- static
- .getMovedPoint(origin, angle, distance) ⇒ Array.<Number>
- .doBoundsIntersect(a, b) ⇒ Boolean
- .isSegmentInCircle(p1, p2, circle) ⇒ Boolean
- .segmentInPolygon(segment, gazePolygon) ⇒ Boolean
new NavigationKit(control, options)
Creates a NavigationKit
Param | Type | Description |
---|---|---|
control | JController | The controller for the currently rendered map |
options | Object | The options with which to configure the NavigationKit |
options.visualLimitLeft | Number | How many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements |
options.visualLimitRight | Number | How many degrees clockwise from the gaze direction shall we consider when calculating surrounding elements |
options.layersOfInterest | Array.<String> | That layers that shall be considered when looking for surrounding elements |
options.visualObstacles | Array.<String> | That layers that shall be considered when looking for obstacles |
options.visualRange | Number | How far into the distance a user is able to percieve shapes/icons |
options.angleThreshold | Number | The threshold for deciding between forward and left/right |
navigationKit.setAngleThreshold(threshold)
- Sets the angle threshold for determining whether a direction is straight or left/right
Kind: instance method of NavigationKit
Access: public
Param | Type | Default | Description |
---|---|---|---|
threshold | Number | 20 | The angle threshold for determining whether a direction is straight or left/right |
navigationKit.setUTurnThreshold(uTurnThreshold)
- Sets the angle threshold for determining whether a direction is a U-Turn
Kind: instance method of NavigationKit
Access: public
Param | Type | Default | Description |
---|---|---|---|
uTurnThreshold | Number | 45 | The angle threshold for determining whether a direction is a U-Turn |
navigationKit.getSurroundingElements(definition) ⇒ Array.<SurroundElements>
- Sets the distance of the Instruction, based on two Waypoints
Kind: instance method of NavigationKit
Returns: Array.<SurroundElements> - - The surrounding elements for a given surrounding definition
Access: public
Param | Type | Description |
---|---|---|
definition | SurroundingDefinition | The first waypoint that defines a line |
navigationKit.createInstructionsFromPath(pathPerFloor) ⇒ Array.<Instruction>
- Returns an array of instructions, given a specific path
Kind: instance method of NavigationKit
Returns: Array.<Instruction> - - An array of Instructions, based on the wayfinding path
Access: public
Param | Type | Description |
---|---|---|
pathPerFloor | Array.<Object> | The first waypoint that defines a line |
navigationKit.hasUserVeeredOffRoute(route) ⇒ Number
- Checks if user location is within the threshold from the closest line in the wayfinding path, returns true if outside threshold and false otherwise.
Kind: instance method of NavigationKit
Returns: Number - threshold - Millimeter value used to define acceptable distance from
wayfinding path
Access: public
Param | Type | Description |
---|---|---|
route | Array.<pathPerFloor> | An array of JMapPathPerFloor objects to compare with user's location |
navigationKit.drawPathWithInstructions(pathPerFloor, pathStyle, popupStyle, fontStyle) ⇒ Object
Draws a path on the relevant maps, with instructions on whether to turn left/right/uturn
Kind: instance method of NavigationKit
Returns: Object - The JController associated with this navigation kit
Access: public
Param | Type | Description |
---|---|---|
pathPerFloor | Array.<Object> | An array of JMapPathPerFloor objects to compare with user's location |
pathStyle | jmap.Style | A style object to style the generated path on the map |
popupStyle | jmap.Style | A style object to style the popup element |
fontStyle | jmap.Font | A font object to style the popup elements' text |
NavigationKit.getMovedPoint(origin, angle, distance) ⇒ Array.<Number>
- Returns the position of a point when moved at a specified angle for a specified distance
Kind: static method of NavigationKit
Returns: Array.<Number> - - The new position of the point
Access: public
Param | Type | Description |
---|---|---|
origin | Array.<Number> | The original position of the point |
angle | Number | The angle in whicht the point should be moved |
distance | Number | How far the point should be moved |
NavigationKit.doBoundsIntersect(a, b) ⇒ Boolean
- Returns whether two bounds intersect in any way
Kind: static method of NavigationKit
Returns: Boolean - - Whether the bounds intersect
Access: public
Param | Type | Description |
---|---|---|
a | jmap.Bounds | The first bounding box |
b | jmap.Bounds | The second bounding box |
NavigationKit.isSegmentInCircle(p1, p2, circle) ⇒ Boolean
- Returns whether a segment is partially or fully within a circle
Kind: static method of NavigationKit
Returns: Boolean - - Whether the segment is either partially or fully within the circle
Access: public
Param | Type | Description |
---|---|---|
p1 | Array.<Number> | The first point that defines a segment |
p2 | Array.<Number> | The second point that defines a segment |
circle | jmap.jungle.shape.Circle | The circle shape that we're checking against |
NavigationKit.segmentInPolygon(segment, gazePolygon) ⇒ Boolean
- Returns whether a segment is partially or fully within a polygon
Kind: static method of NavigationKit
Returns: Boolean - - Whether the segment is either partially or fully within the polgon
Access: public
Param | Type | Description |
---|---|---|
segment | Array.<Array> | The segment we are testing with |
gazePolygon | jmap.jungle.shape.Polygon | The polygon we are checking against |
SurroundingDefinition
Returns a SurroundingDefinition
Kind: global class
new SurroundingDefinition(options)
Creates a SurroundingDefinition
Param | Type | Default | Description |
---|---|---|---|
options | Object | The options with which to configure the SurroundingDefinition | |
options.map | global.jmap.core.Map | The map on which the surrounding elements should be generated from | |
options.point | Array.<Number> | The point from which the surrounding elements should be calculated (as x, y) | |
options.gazeDirection | Number | The angle (in degrees) between the x-axis and the gaze direction | |
options.visualRange | Number | 250 | How far a person can see (in pixels) |
options.visualLimitLeft | Number | How many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements | |
options.visualLimitRight | Number | How many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements | |
options.layersOfInterest | Array.<String> | The layers that should be considered when generating the surround elements |
SurroundingElements
Returns a SurroundingElements object
Kind: global class
new SurroundingElements(options)
Creates a SurroundingElements object
Param | Type | Description |
---|---|---|
options | Object | The options with which to configure the SurroundingDefinition |
options.icons | global.jungle.Icon | The icons that were deemed to be a surrounding element |
options.shapes | global.jungle.Shape | The shapes that were deemed to be a surrounding element |
SurroundingIcon
Returns a SurroundingIcon
Kind: global class
new SurroundingIcon(icon, distance, layerName)
Creates a SurroundingIcon
Param | Type | Description |
---|---|---|
icon | global.jungle.Icon | The icon deemed to be a surrounding element |
distance | Number | The distance between the decision point and the icon |
layerName | String | The layer on which the icon is |
SurroundingItem
Returns a SurroundingItem
Kind: global class
new SurroundingItem(distance, layerName)
Creates a SurroundingItem
Param | Type | Description |
---|---|---|
distance | Number | The distance between the decision point and the surrounding item |
layerName | String | The layer on which the surrounding item is |
SurroundingShape
Returns a SurroundingShape
Kind: global class
new SurroundingShape(shape, distance, layerName)
Creates a SurroundingIcon
Param | Type | Description |
---|---|---|
shape | global.jungle.Shape | The shape deemed to be a surrounding element |
distance | Number | The distance between the decision point and the icon |
layerName | String | The layer on which the icon is |