Class MyRoute

MyRoute Example class. 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 vg.imagePath (by default "../media"), which contains:

  • image for route style: 2d_track_blue_boomerang.png
  • images for pins for start, end of route and change floor

  • Defined in: <application/mapviewer/js/MyRoute.js>
Class Summary
Constructor Attributes Constructor Name and Description
 
MyRoute(mapviewer, routeData,)

Method Summary

Class Detail

MyRoute(mapviewer, routeData,)

pRouteData will 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"
}
Parameters:
{vg.mapviewer.Mapviewer} mapviewer
{object} routeData,
result of vg.mapviewer.Mapviewer.computeRoute()
See:
vg.mapviewer.Mapviewer.html#computeRoute

Method Detail

  • getInitialFloor()
    returns the floor name of the first floor of the route
  • getInitialViewpointPosition()
    returns the floor name of the first floor of the route
  • hide()
    Hides the route if visible
  • {Boolean} isValid()
    Determine if the object has been succesfully created AND is currently valid.
    Returns:
    {Boolean} True if the object is valid, otherwise false.
  • remove()
    removes the route
  • show()
    Display the route if hidden