1.2.0 • Published 6 years ago

@jibestream-dev/jmap-navigation-kit v1.2.0

Weekly downloads
35
License
ISC
Repository
github
Last release
6 years ago

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

ParamTypeDefaultDescription
ajmap.core.WaypointThe first waypoint in the series of three waypoints
bjmap.core.WaypointThe second waypoint in the series of three waypoints
cjmap.core.WaypointThe third waypoint in the series of three waypoints
thresholdNumber20The threshold for deciding between forward and left/right
uTurnThresholdNumber45The 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

ParamTypeDescription
directionDirectionThe 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

ParamTypeDescription
directionDirectionThe 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

ParamTypeDescription
directionDirectionThe 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

ParamTypeDescription
instructionInstructionThe 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

ParamTypeDescription
instructionInstructionThe 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

new NavigationKit(control, options)

Creates a NavigationKit

ParamTypeDescription
controlJControllerThe controller for the currently rendered map
optionsObjectThe options with which to configure the NavigationKit
options.visualLimitLeftNumberHow many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements
options.visualLimitRightNumberHow many degrees clockwise from the gaze direction shall we consider when calculating surrounding elements
options.layersOfInterestArray.<String>That layers that shall be considered when looking for surrounding elements
options.visualObstaclesArray.<String>That layers that shall be considered when looking for obstacles
options.visualRangeNumberHow far into the distance a user is able to percieve shapes/icons
options.angleThresholdNumberThe 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

ParamTypeDefaultDescription
thresholdNumber20The 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

ParamTypeDefaultDescription
uTurnThresholdNumber45The 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

ParamTypeDescription
definitionSurroundingDefinitionThe 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

ParamTypeDescription
pathPerFloorArray.<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

ParamTypeDescription
routeArray.<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

ParamTypeDescription
pathPerFloorArray.<Object>An array of JMapPathPerFloor objects to compare with user's location
pathStylejmap.StyleA style object to style the generated path on the map
popupStylejmap.StyleA style object to style the popup element
fontStylejmap.FontA 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

ParamTypeDescription
originArray.<Number>The original position of the point
angleNumberThe angle in whicht the point should be moved
distanceNumberHow 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

ParamTypeDescription
ajmap.BoundsThe first bounding box
bjmap.BoundsThe 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

ParamTypeDescription
p1Array.<Number>The first point that defines a segment
p2Array.<Number>The second point that defines a segment
circlejmap.jungle.shape.CircleThe 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

ParamTypeDescription
segmentArray.<Array>The segment we are testing with
gazePolygonjmap.jungle.shape.PolygonThe polygon we are checking against

SurroundingDefinition

Returns a SurroundingDefinition

Kind: global class

new SurroundingDefinition(options)

Creates a SurroundingDefinition

ParamTypeDefaultDescription
optionsObjectThe options with which to configure the SurroundingDefinition
options.mapglobal.jmap.core.MapThe map on which the surrounding elements should be generated from
options.pointArray.<Number>The point from which the surrounding elements should be calculated (as x, y)
options.gazeDirectionNumberThe angle (in degrees) between the x-axis and the gaze direction
options.visualRangeNumber250How far a person can see (in pixels)
options.visualLimitLeftNumberHow many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements
options.visualLimitRightNumberHow many degrees counter-clockwise from the gaze direction shall we consider when calculating surrounding elements
options.layersOfInterestArray.<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

ParamTypeDescription
optionsObjectThe options with which to configure the SurroundingDefinition
options.iconsglobal.jungle.IconThe icons that were deemed to be a surrounding element
options.shapesglobal.jungle.ShapeThe shapes that were deemed to be a surrounding element

SurroundingIcon

Returns a SurroundingIcon

Kind: global class

new SurroundingIcon(icon, distance, layerName)

Creates a SurroundingIcon

ParamTypeDescription
iconglobal.jungle.IconThe icon deemed to be a surrounding element
distanceNumberThe distance between the decision point and the icon
layerNameStringThe layer on which the icon is

SurroundingItem

Returns a SurroundingItem

Kind: global class

new SurroundingItem(distance, layerName)

Creates a SurroundingItem

ParamTypeDescription
distanceNumberThe distance between the decision point and the surrounding item
layerNameStringThe layer on which the surrounding item is

SurroundingShape

Returns a SurroundingShape

Kind: global class

new SurroundingShape(shape, distance, layerName)

Creates a SurroundingIcon

ParamTypeDescription
shapeglobal.jungle.ShapeThe shape deemed to be a surrounding element
distanceNumberThe distance between the decision point and the icon
layerNameStringThe layer on which the icon is
1.2.0

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago