In this blog, we’ll look at how directions and routing is implemented with Google, and how it is done with ArcGIS.
Once you have signed up for your Developer account, create an ArcGIS Online hosted proxy for routing which you’ll use when you build your app.
Now let’s look at how you can create and display directions and a route between two predefined locations.
To use the widget, simply initialize it with the routeServiceUrl pointing to the ArcGIS Online hosted proxy that you created in the Getting Started step, and then add it to the View UI. The API has convenient UI placement tools and other goodies; the below code adds the widget in the top right corner.
You can play around with the directions widget using the SDK sample.
See the SDK’s routing sample to learn more about RouteTask.