Directions widget

The Directions widget allows users to calculate turn-specific directions between two or more locations. Calculating a route generates an output data source that other widgets can use.

Examples

Use this widget to support app design requirements such as the following:

  • You want city planners to calculate walking times from residential neighborhoods to public parks.
  • You want emergency medical teams to plan routes to medical centers.
  • You want supply chain managers to estimate when a truck needs to leave in order to arrive on time.

Usage notes

This widget requires a connection to a Map widget.

By default, the widget uses the ArcGIS World Route Service and the units defined in your account settings. Available tools vary depending on the route URL you provide in the widget settings. When you include the widget in an app, the default route settings provide users with the following tools for calculating directions:

  • Add a stop—Add a stop on the route. By default, the widget includes two stops. When there are three or more stops, users can use Remove stop to delete stops. Drag stops vertically to change their order. Search for an address or place-name to configure a stop.
  • Reverse stops—Reverse the order of all stops.
  • Time and distance—Choose a method of transportation, and whether to calculate the fastest route by distance or time. For example, selecting Driving Time calculates the most time-efficient route between two points, while selecting Driving Distance for the same two stops calculates the shortest route by distance.
  • Departure—Choose to include a specific departure time when calculating the route.
  • Save and Save As—Save the resulting route as an ArcGIS Online item. Provide a name and choose a folder location for the new feature layer. Once you save the layer, you can click Save to update it or click View layer details to go to its item page.

Settings

The Directions widget includes the following settings:

  • Select a Map widget—Select a map widget.
  • Route Settings—Add a routing utility service. The widget settings list the URL for the ArcGIS World Route Service as an example.
  • Search settings—Add search sources and customize search options.
    • Locator source—Optionally, add sources for searching content other than the default. Specify the following settings for each:
      • Locator URL—Add a geocoding utility service.
      • Label—Add a label for the locator source.
      • Hint—Customize the hint text that appears in the search box when users choose to search with a single source.
    • Hint for multiple search sources—Customize the hint text that appears in the search box when users choose to search with multiple sources.
    • Maximum suggestions per source—Limit the number of searches that appear in the suggestion box for each locator source.
    • Use current location—Include a suggestion option to search for a stop based on the user's current location.

Interaction options

The Directions widget can interact with other widgets through data actions. Certain widgets, including the Map, List, and Table widgets, can target the Directions widget with the Directions From and Directions To data actions, which you can turn on in the Action tab of those widgets' settings.

You can use the directions data actions to allow users to determine a route's start or end point by selecting a point feature on a map or from a table or list. To do this with a map, add a Map widget and Directions widget to an app, then go to the Action tab of the Map widget's settings and turn on Directions From and Directions To under Data action. When the user selects a feature on the map and clicks the Actions button in the pop-up, enabled data actions appear in a menu.