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 new 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 new 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.
- Locator source—Optionally, add sources for searching content other than the default. Specify the following settings for each: