new Route(viewer, routeData, optionsopt)
It allows the rendering of a route if available from computeRoute().
Creates a route object to simplify the display of line routes, start/end/change floor icons.
It uses for the media directory the value of options.imagePath (by default "../media"), which contains:
- image for route style: track_arrow.png (in previous versions: 2d_track_blue_boomerang.png)
- image for floor transtion tags: track_floor_change_tag.png
- images for pins for start, end of route and change floor: track_*.png
- images for transit instructions: transit_instruction_*.png
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
viewer |
visioweb.Mapviewer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
routeData |
Object | result of visioweb.Mapviewer.computeRoute() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Properties
|
Example
routeData should have the form
{
"name" : "Route Result",
"src" : "LG002",
"dst" : "LG011",
"status" : "200",
"legs" :[
{
"dataset" : "L",
"points" : [{ "lat" : "5.1980516","lon" : "45.2789357" }, ... ]
}
, ...
],
"length": "62.7925949"
}
Members summary
Name | Description |
---|---|
finalFloor | The route's final floor's name |
initialFloor | The route's initial floor's name |
Methods summary
Name | Description |
---|---|
getViewpointPosition | computes a viewpoint to see either the start point, the end point, the first part or the last part of the route, or the whole route. |
hide | Hides the route if visible |
hideLinks | Hide the links between floors |
isValid | Determine if the object has been succesfully created AND is currently valid. |
remove | removes the route and its links |
show | Display the route if hidden |
showLinks | Display the links between floors |
Members detail
(static) finalFloor :string
The route's final floor's name
- Default Value:
- false
(static) initialFloor :string
The route's initial floor's name
- Default Value:
- false
Methods detail
getViewpointPosition(mode) → {object}
computes a viewpoint to see either the start point, the end point, the first part or the last part of the route, or the whole route.
Parameters:
Name | Type | Description |
---|---|---|
mode |
string | 'start', 'end', 'initialFloor', 'finalFloor', 'wholeRoute'. Default: 'initialFloor'. |
Returns:
a camera position (x,y,radius)
- Type
- object
hide()
Hides the route if visible
hideLinks()
Hide the links between floors
- Since:
- 1.7.14
isValid() → {Boolean}
Determine if the object has been succesfully created AND is currently
valid.
Returns:
True if the object is valid, otherwise false.
- Type
- Boolean
remove()
removes the route and its links
show() → {Promise}
Display the route if hidden
Returns:
utility to delay further actions to next frame, thus making sure route objects are loaded and displayed.
- Type
- Promise
showLinks()
Display the links between floors
- Since:
- 1.7.14