back | source
Displaying recommended route
  1. Use a DOM object as placeholder to contain route details
  2. Add a starting point using a marker object
    map.Route.add(new longdo.Marker(
      { lon: 100.538316, lat: 13.764953 },
      { title: 'Victory monument', detail: 'I\'m here' }
    • lon,lat: latitude and longitude
    • title: Message that will appear on the header of the popup
    • detail: Message that will appear on the detail of the popup
  3. The step number 2 can be repeated to add more points
    map.Route.add({ lon: 100, lat: 15 });
  4. search() for routing;

Displaying routes based on user's choice
  1. Create placeholder element
  2. Based on user's choice
    • enableContextMenu: if set to true,the destination menu will be shown on right mouse click
    • auto: for enabling/disabling automatic route search

Other functions
  1. Don't use traffic infomation
  2. Show travel time on the map line
  3. Don't take tollway
    map.Route.enableRoute(longdo.RouteType.Tollway, false);
  4. Travel by motorcycle
    map.Route.enableRestrict(longdo.RouteRestrict.Bike, true);

  5. More information: if you want the program to continue running after finished calculating the route, then you can use the event Guide Complete to archive it Example