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 must leave 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.
  • General settings—Configure general settings.
    • Show runtime layers in layer lists—Show route layers created by the Directions widget in the layer lists of other widgets, such as the Map Layers widget, the Legend widget, and the Map widget Layers tool.

Interaction options

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

You can use the directions data actions to allow users to determine a route's start point, end point, or multiple points along a route by selecting point features.

To do this with a table, add a Table widget and a Directions widget to an app, then go to the Action tab of the Table widget's settings and turn on Directions From, Directions To, and Plan route under Data action. When the user selects features in the table and clicks the Actions button on the widget panel, the enabled data actions appear in a drop-down menu.