The Search widget enables you to find locations in the scene. Unlike the Search widget in a 2D app, it does not support feature search. By default, the widget uses the geocoding service from your organization or portal. You can also add more geocoding services.
Configure the Search widget
The widget configuration window allows you to specify the geocoding services you want the widget to work with.
- Hover over the Search widget and click the Show or hide button to show or hide this widget in your app.
- Hover over the widget and click the Configure this widget button to open the configuration properties dialog box.
- By default, the widget uses the geocoding service from your organization or portal. Click Add Search Source, to add more geocoding services.
There are two options: Geocoder and Feature Layer.
- Choose Feature Layer.
- Click an option to choose a layer and click OK to close the window.
- 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 check box if needed.
- Optionally check the Only search in current map extent check 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 code to limit the search area if applicable. See Geocode coverage for a country 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 check box if needed. It allows you to define when to enable the local search by setting the map scale and specifying 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 check box if needed.
- Under General Settings, set the placeholder text for geocoders.
- By default, a pop-up appears when the location is found on the scene. Uncheck the box if you don't want a pop-up to appear.
- Click OK to close the configuration window.
Use the Search widget
When you type a place-name in the search box, suggestions appear as you type. If an arrow appears in the search box, you can search on all sources, or click the arrow and choose a locator from the drop-down list.
A pop-up appears at the location of the place-name and displays any available attribute information.