Skip to content

Find the Shortest Path/Distance between destinations using ESRI API and Plugins

License

Notifications You must be signed in to change notification settings

dhana29/Shortest-Path-Distance-Using-ESRI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shortest-Path-Distance-Using-ESRI

Find the Shortest Path/Distance between destinations using ESRI API and Plugins

In this repository I discussed about to find the shortest path and direction between one location to another using ESRI

  • Enter the Source and Destination address
  • Options to add stops between address
  • Options to select speed units
    • KM
    • MI
  • Options to different type travel selection
    • Driving Distance/Time
    • Rural Driving Distance/Time
    • Trucking Distance/Time
    • Walking Distance/Time
  • Options to select travel options now or later
    • Leave now
    • Depart at
    • Time Unspecified

Select the address in option 1 and option 2 (Note: If you would like to add more destinations click ADD to add destination address)

Code description - (doji/javascript)

  • Initialize map object using "esri/map" class and setup the base attributes based on the requirement.
 
var map = new Map("map", {
          basemap: "streets",
          center:[-98.56,39.82],
          zoom: 4
        });
  • Initialize direction object using "esri/dijit/Directions" class and add the routeTaskUrl
 
  var directions = new Directions({
          var directions = new Directions({
          map: map,
          routeTaskUrl: "https://utility.arcgis.com/usrsvcs/appservices/srsKxBIxJZB0pTZ0/rest/services/World/Route/NAServer/Route_World"
        },"dir");
        directions.startup();
      });
      
  • Initiate direction by
directions.startup();

Add the proxy handler to handle communications with the Routind and Direction Service

About

Find the Shortest Path/Distance between destinations using ESRI API and Plugins

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published