With the ArcGIS Maps SDK for JavaScript, you can perform routing. Routing is the process of finding routes and directions and performing advanced analyses on street networks. The routing service can solve complex network problems such as creating an optimized route to visit many destinations, finding the closest facility, identifying a service area around a location, or servicing a set of orders with a fleet of vehicles. It can also create a travel cost matrix and find the best place to locate a new facility.
There are several ways to perform routing. RouteLayer is a layer for visualizing and solving routes. A solved route includes turn-by-turn directions, and can be stored and retrieved from ArcGIS Online or Enterprise, either as a portal item, or as part of a webmap.
The route module uses ArcGIS Server network analysis services to calculate routes between two or more locations and optionally get driving directions. Network analysis services allow you to solve simple routing problems as well as complex ones that take into account multiple stops, barriers, and time windows.
The Directions widget provides a way to calculate directions
between two or more input locations with a RouteLayer,
using ArcGIS Online and custom Network Analysis Route services. Similar to how route
works, this widget generates a
route finding a least-cost path between multiple points using a specified routing service. The resulting directions
are displayed with detailed turn-by-turn instructions.
Introduction to routing and directions
Introduction to routing and directions.
Directions widget
Directions widget sample.
RouteLayer
RouteLayer sample.