Skip To Content

Directions widget

The Directions widget provides a quick and efficient method of calculating turn-based directions between two or more locations. This widget uses both a network route service and geocoder service.

License:

The ArcGIS Online Network Analysis Services require an ArcGIS Online for Organizations subscription. If you choose to work with this by default, specify a valid user name and password for ArcGIS Online. Each successful request to the service incurs service credits taken from your subscription. In addition, if you have an ArcGIS Server Network Analysis service, you can also specify the URL.

License:

The ArcGIS Online Real-Time Traffic Map Services require an ArcGIS Online for Organizations subscription. If you choose to work with this, specify a valid user name and password for ArcGIS Online. Each successful request to the service incurs service credits taken from your subscription.

Tip:

If you want to share your secure service item with the public, for example, as part of a public web app, store the credentials with the item so the public is not required to log in to get to your app. See ArcGIS Server web services for more information.

Configure the Directions widget

The Directions widget can be set to open automatically when apps start. To do so, click the yellow dot on the widget to turn it to green.

To configure the Directions widget, click the edit icon edit icon on the widget to open the configuration options dialog box.

  1. By default, the Route, Geocoder, Travel Modes, and Traffic Layer URLs are from your ArcGIS Online organization or the Utility Services of Portal for ArcGIS.

    If you want the Directions widget to be publicly accessible, set the proxy for each URL.

  2. Update the geocoder options. Default values populate from the services.
    1. Checking Auto complete allows the search text box to fill in possible addresses automatically by querying the geocoder service.
    2. The Search delay parameter controls how long the user interface waits after the last key is pressed to attempt to update the list of candidate locations.
    3. The Max locations controls the number of suggested locations returned from the geocoder service at a time.
    4. The minimum number of characters required to query for suggested locations is specified by the Min characters parameter.
    5. The Placeholder text displays in the address lookup text box when no text has been entered.
  3. Update the routing options. Default values populate from the services.
    1. The Directions language is the culture code (for example, en_US for American English, de_DE for German). Output is customized for the specified locale, if available.
    2. Control the verbosity of the directions by changing the Directions output type parameter.
    3. The Directions length units are the units of measure used when computing direction distances.
    4. The Impedance attribute is the network attribute used for impedance. For example, set it to Time for quickest route and Length for shortest drive if the service has these attributes available. With an empty array, it defaults to the default of the service.
  4. Click OK to close the dialog box.

Use the Directions widget

Caution:

Using the ArcGIS Online Network Analysis Services consumes credits. Verify that you are signed in to your organization with privileges to perform network analysis.

  1. Click the directions icon to open the Directions widget.
  2. Enter the start and end destinations.
    • You can type the addresses in the fields, which may autocomplete addresses and locations, depending on the configuration.
    • You can add destinations by clicking the Add destinations by clicking the map icon to enable it, and clicking the map.
  3. Optionally, add more destinations by clicking Add destination. Each destination can also be dragged onto the map.
  4. Select a travel mode from the drop-down list.
    Travel mode
  5. Click Show More Options to display more options. Checking Return to start automatically calculates directions from the last destination to the first destination as part of the results. Checking Use traffic factors in real-time impedance from a traffic service when calculating the least-cost path between two destinations. Toggle between MI (miles) and KM (kilometers) to control the units used to report distances in the generated set of directions. Toggle between Fastest and Shortest to choose your preferred route.
  6. Click Get Directions.

The map updates to display the route and directions display in the Directions widget.

Get directions

Each turn in the directions list is interactive. Click a turn to zoom to that location on the map. The route leading to that turn also highlights on the map.

Directions with highlighted turn

Clicking the print icon Print icon opens the directions in a new window for printing.

To clear the current set of directions from the map, click Clear below the destinations list.