Search widget
(Added at v1.2)
The Search widget enables end users to find locations or search features on the map. By default, the widget uses the geocoding service from your organization or portal and displays searchable layers configured in the map, if available. See Configure feature search for more information. Further, you can add more geocoding services or configure specific layers within your map to be searchable using the widget's configuration window.
The following methods of finding a location are supported, given that they are supported in the geocoding services:
- Place-name
- Point of interest
- Address
- UTM Coordinates
- Coordinates in a spatial reference specified by a well-known ID (WKID)
The supported format is: X, Y: WKID. For example: -13046165.572, 4036389.847 : 102100.
If using ArcGIS World Geocoding Service as the search source, the Search widget also allows users to directly input coordinates to locate the point on the map. Supported coordinates include those listed in the Search for Coordinates topic.
The following layers are searchable with Query capability enabled:
- Hosted feature layers
- ArcGIS Server feature service layers
- ArcGIS Server map service layers
Configuring the Search widget
The widget configuration window allows you to specify the geocoding services and searchable layers you want the widget to work with.
- Hover over the Search widget and click the small eye icon to show or hide this widget in your application.
- Hover over the widget and click the Configure this widget button to open the configuration window.
Note:
If you need to add the widget to the app first, click a widget placeholder on the Widget tab. In the Choose Widget window that opens, select the widget and click OK.
- By default, the widget uses the geocoding service from your organization or portal and displays searchable layers configured in the map, if available. All the existing search sources are listed on the table. You can add new search sources or modify the existing ones. You'll add new search sources first.
- Click Add Search Source. There are two options: Geocoder and Feature Layer.
- Choose Feature Layer.
- Select from the three options: Map, ArcGIS Online, or Service URL, and click OK to close the window.
Caution:
The Service URL option has limitations when the URL you provide is not from the current map. For example, some feature actions on the pop-up, such as editing and showing an attribute table, are unavailable if the result is a graphic. - The new layer source is automatically listed on the table. You can change the searchable layer name in the Name text box.
- Optionally type the text in the Placeholder Text text box.
- Click the pencil icon to add search fields. This opens the Set Search Fields window. Choose one or multiple fields. Numerical fields and string fields, including coded domains, are searchable. Click OK to close the window. You should see all the selected fields listed in the Search Fields text box.
- Click the drop-down list to choose the display field in the search suggestion.
Caution:
A geocode service must meet the following requirements to support the suggest operation:
- The address locator from which the geocode service was published must support suggestions. Only address locators created using ArcGIS 10.3 for Desktop and later can support suggestions. See the Create Address Locator geoprocessing tool help topic for more information.
- The geocode service must have the Suggest capability enabled. Only geocode services published using ArcGIS 10.3 for Server or later support the Suggest capability.
- By default, 6 is the maximum suggestions returned for a searchable layer. Change it if necessary.
- By default, 6 is the maximum results returned for a searchable layer. Change it if necessary.
- Be default, zoom scale is defined as 1:50,000. Change it if necessary.
- Optionally check the Exact Match box if needed.
- Optionally check the Only search in current map extent box if needed.
- Choose Geocoder.
- The new Geocoder source is automatically listed on the table.
- Click the Set button to open the Set Geocoder URL window.
- Provide a valid URL for the geocoding service you want to use, click Validate to load the service, choose the service, and click OK.
The geocoder URL is automatically added in the Geocoder URL text box. You can change the geocoder name in the Geocode Name text box.
- Optionally type text in the Placeholder Text text box.
- Optionally type the country or region code to limit the search area if applicable. See Geocode coverage for a code list.
- By default, 6 is the maximum suggestions and results returned. Change it if necessary.
- Define the scale to zoom to when geocoder does not return an extent.
Caution:
The zoom scale set in the widget only takes effect when the result does not have an associated extent. If the result returns an extent, it will be ignored. - Check the Enable local search box if needed . It allows you to define when to enable the local search by setting the map scale and specify a search distance around the current map center so the candidates closest to the location are returned first.
- Optionally check the Only search in current map extent box if needed.
- Repeat step 4 to add more feature layers and geocoder search sources.
- To modify the existing search sources, click the source on the table.
- Under General Settings, set the placeholder text for searching all of the layers and geocoders.
- By default, the pop-up displays when the feature or location is found on the map. Uncheck the box to disable the pop-up.
- Click OK to close the configuration window.
Using the Search widget
- When you enter a place-name or a keyword in the search box, you see suggestions as you type. If you see an arrow in the search box, you can search on all sources, or click the arrow and choose a locator or layer from the drop-down list.
A pop-up appears at the location of the place-name or the feature and displays any available attribute information.
- Click the ellipsis … button under the low right of the pop up, a list of actions displays including adding or removing a marker from the map. If the Directions widget presents in the app, you can set Directions from Here or Directions to here to open the Directions widget automatically.