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 a geocoder service.

License:

The ArcGIS Online network analysis services require an ArcGIS Online organization 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 organization 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 access your app. See ArcGIS Server web services for more information.

Configure the Directions widget

This widget can be set to open automatically when an app starts. To enable this feature, click the Open this widget automatically when the app starts button Open this widget automatically when the app starts on the widget, which turns it dark green.

  1. Hover over the widget and click the Configure this widget button Configure this widget to open the configuration properties dialog box.
  2. By default, the route, geocoder, travel modes, and traffic layer URLs are from your organization or the utility services of Portal for ArcGIS. The travel modes and traffic layer URLs are optional. If the former is not specified, you will still see the default travel modes with the route URL when using the widget. If the latter is not specified, you will not see the traffic options when using the widget.

    Tip:

    The example URLs that are unavailable in the Travel Modes URL and Traffic Layer URL text boxes can be used to enable default travel modes and traffic layers.

  3. Update Geocoder options. Default values from the services populate the options.
    1. Check Auto complete to have the search text box fill in possible addresses automatically by querying the geocoder service.
    2. Use Search delay to control how long the UI pauses before updating the list of candidate locations after the last key is pressed.
    3. Maximum suggestions controls the number of suggested locations returned from the geocoder service.
    4. Minimum characters determines the minimum number of characters required to query for suggested locations.
    5. The Placeholder text displays in the address lookup text box when no text has been entered.
  4. Update Route options. Default values from the services populate the options.
    1. 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. Use Directions output type to control the verbosity of the directions.
    3. Directions length units are the units of measure used when computing direction distances.
    4. Impedance attribute is the network attribute used for impedance. For example, set it to Time for the quickest route or Length for the shortest drive if the service has these attributes available. With an empty array, it defaults to the default of the service.
  5. Under Preset stops, preset the start and end points by typing the addresses or places in the text box.
  6. 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.

Note:
Now you can open the Directions widget by clicking the Open route button in the pop-up, where a route is generated by the Plan Routes tool from the Analysis widget. Make sure the Include route layers box is checked when running the Plan Routes tool.

  1. Click the directions icon to open the Directions widget.
  2. Enter the start and end destinations if they are not preset.
    • Type the addresses in the fields, which may autocomplete addresses and locations, depending on the configuration.
    • Add destinations by clicking the icon Add destinations by clicking the map to enable it, and clicking the map.
  3. Optionally click the Reverse directions button to reorder the origin and destination.
  4. Optionally add more destinations by clicking Add. Each destination can also be dragged onto the map. Note that the Reverse directions button does not appear when there are more than two destinations.
  5. Optionally click the barriers icon and start to draw lines or polygons on the map to create barriers.
  6. Select a travel mode from the drop-down list if applicable. The default mode is Driving Time.
    Travel mode
  7. If the specified travel mode is time-based and supports live traffic data—for example, Driving Time—choose a departure option of Leave Now or Depart At. If you choose Depart At, select a departure time and date. The departure time is set in the time zone of the place of departure.
  8. Click Options to display more options. Check Return to start to create a round-trip route. If available, check Show traffic to factor real-time traffic conditions into the total time of your route. Toggle between MI (miles) and KM (kilometers) to control the units used to report distances in the generated set of directions.
  9. Click Get Directions.

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

  10. 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
  11. Click the print icon Print to open the directions in a new window for printing.
  12. To clear the current set of directions from the map, click Clear next to Get Directions.