LocatorSearchSource
require(["esri/widgets/Search/LocatorSearchSource"], function(LocatorSearchSource) { /* code goes here */ });esri/widgets/Search/LocatorSearchSourceThe following properties define a source pointing to a Locator that may be used to geocode locations with a Search widget instance.
Constructors
- new LocatorSearchSource(properties)
- Parameter:properties Objectoptional
See the properties for a list of all the properties that may be passed into the constructor.
Property Overview
| Name | Type | Summary | Class | |
|---|---|---|---|---|
| Boolean | Indicates whether to automatically navigate to the selected result once selected. more details | more details | SearchSource | |
| String[] | A string array which limits the results to one or more categories. more details | more details | LocatorSearchSource | |
| String | Constricts search results to a specified country code. more details | more details | LocatorSearchSource | |
| Object | This property replaces the now deprecated | more details | SearchSource | |
| Object | Sets the sources for local | more details | LocatorSearchSource | |
| Number | When reverse geocoding a result, use this distance in meters. more details | more details | LocatorSearchSource | |
| Locator | The locator task used to search. more details | more details | LocatorSearchSource | |
| Number | Indicates the maximum number of search results to return. more details | more details | SearchSource | |
| Number | Indicates the maximum number of suggestions to return for the widget's input. more details | more details | SearchSource | |
| Number | Indicates the minimum number of characters required before querying for a suggestion. more details | more details | SearchSource | |
| String | The name of the source for display. more details | more details | LocatorSearchSource | |
| String[] | Specifies the fields returned with the search results. more details | more details | SearchSource | |
| String | Used as a hint for the source input text. more details | more details | LocatorSearchSource | |
| Boolean | Indicates whether to display a Popup when a selected result is clicked. more details | more details | SearchSource | |
| PopupTemplate | The popup template used to display search results. more details | more details | SearchSource | |
| String | Specify this to prefix the user's input of the search text. more details | more details | SearchSource | |
| Boolean | Indicates whether to show a graphic on the map for the selected source using the resultSymbol. more details | more details | SearchSource | |
| Symbol | The symbol used to display the result. more details | more details | SearchSource | |
| String | A template string used to display multiple fields in a defined order when results are displayed. more details | more details | LocatorSearchSource | |
| String | The field name of the Single Line Address Field in the REST services directory for the locator service. more details | more details | LocatorSearchSource | |
| String | Specify this to add a suffix to the user's input for the search value. more details | more details | SearchSource | |
| Boolean | Indicates whether to display suggestions as the user enters input text in the widget. more details | more details | LocatorSearchSource | |
| Boolean | Indicates whether to constrain the search results to the view's extent. more details | more details | SearchSource | |
| Number | The set zoom scale for the resulting search result. more details | more details | LocatorSearchSource |
Property Details
Indicates whether to automatically navigate to the selected result once selected.
- Default Value:true
- categoriesString[]
A string array which limits the results to one or more categories. For example,
Populated Placeorairport. Only applicable when using the World Geocode Service.- See also:
- countryCodeString
Constricts search results to a specified country code. For example,
USfor United States orSEfor Sweden. Only applies to the World Geocode Service.- See also:
- Since: ArcGIS API for JavaScript 4.4
This property replaces the now deprecated
searchQueryParams,suggestQueryParams, andsearchExtentproperties. Please see the object specification table below for details.
- localSearchOptionsObject
Sets the sources for local
distanceandminScalefor searching. See the object specification table below for details.
- locationToAddressDistanceNumber
When reverse geocoding a result, use this distance in meters.
- Default Value:1500
- locatorLocator
The locator task used to search. This is required and defaults to the World Geocoding Service.
Indicates the maximum number of search results to return.
- Default Value:6
Indicates the maximum number of suggestions to return for the widget's input.
- Default Value:6
Indicates the minimum number of characters required before querying for a suggestion.
- Default Value:1
- nameString
The name of the source for display.
Specifies the fields returned with the search results.
- placeholderString
Used as a hint for the source input text.
Indicates whether to display a Popup when a selected result is clicked.
- popupTemplatePopupTemplate inherited
The popup template used to display search results. If no popup is needed, set the source's popupTemplate to
null.This property should be set in instances where there is no existing PopupTemplate configured. For example, feature sources will default to any existing popupTemplate configured on the layer.
Specify this to prefix the user's input of the search text.
Indicates whether to show a graphic on the map for the selected source using the resultSymbol.
The symbol used to display the result.
- searchTemplateString
A template string used to display multiple fields in a defined order when results are displayed.
Example:locatorLayerSource.searchTemplate = "{County}, {State}";
- singleLineFieldNameString
The field name of the Single Line Address Field in the REST services directory for the locator service. Common values are
SingleLineandSingleLineFieldName.
Specify this to add a suffix to the user's input for the search value.
- suggestionsEnabledBoolean
Indicates whether to display suggestions as the user enters input text in the widget.
- Default Value:true
Indicates whether to constrain the search results to the view's extent.
- Default Value:false
- zoomScaleNumber
The set zoom scale for the resulting search result. This scale is automatically honored.
- Default Value:true
Method Overview
| Name | Return Type | Summary | Class | |
|---|---|---|---|---|
| LocatorSearchSource | Creates a deep clone of this object. more details | more details | LocatorSearchSource | |
| * | Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. more details | more details | LocatorSearchSource | |
| Object | Converts an instance of this class to its ArcGIS portal JSON representation. more details | more details | LocatorSearchSource |
Method Details
- clone(){LocatorSearchSource}
Creates a deep clone of this object.
Returns:Type Description LocatorSearchSource A clone of the new LocatorSearchSource instance.
- fromJSON(json){*}static
Creates a new instance of this class and initializes it with values from a JSON object generated from a product in the ArcGIS platform. The object passed into the input
jsonparameter often comes from a response to a query operation in the REST API or a toJSON() method from another ArcGIS product. See the Using fromJSON() topic in the Guide for details and examples of when and how to use this function.Parameter:json ObjectA JSON representation of the instance in the ArcGIS format. See the ArcGIS REST API documentation for examples of the structure of various input JSON objects.
Returns:Type Description * Returns a new instance of this class.
- toJSON(){Object}
Converts an instance of this class to its ArcGIS portal JSON representation. See the Using fromJSON() topic in the Guide for more information.
Returns:Type Description Object The ArcGIS portal JSON representation of an instance of this class.