Class LocatorSearchSource
Basic search source implementation for generic locators.
Implements
Namespace: Esri.ArcGISRuntime.Toolkit.UI.Controls
Assembly: Esri.ArcGISRuntime.Toolkit.WinUI.dll
Syntax
public class LocatorSearchSource : ISearchSource
Constructors
| Improve this Doc View SourceLocatorSearchSource(LocatorTask)
Initializes a new instance of the LocatorSearchSource class. CreateDefaultSourceAsync(CancellationToken) to create a source configured for use with the Esri World Geocoder.
Declaration
public LocatorSearchSource(LocatorTask locator)
Parameters
Type | Name | Description |
---|---|---|
LocatorTask | locator | Locator to be used. |
Properties
| Improve this Doc View SourceDefaultCalloutDefinition
Gets or sets the default callout definition to use with results.
Declaration
public CalloutDefinition? DefaultCalloutDefinition { get; set; }
Property Value
Type | Description |
---|---|
Nullable<CalloutDefinition> |
DefaultSymbol
Gets or sets the default symbol to use when displaying results.
Declaration
public Symbology.Symbol? DefaultSymbol { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Symbology.Symbol> |
DefaultZoomScale
Gets or sets the default zoom scale to be used for results from this source.
Declaration
public double DefaultZoomScale { get; set; }
Property Value
Type | Description |
---|---|
Double |
Remarks
This value should be ignored when the underlying provider (e.g. LocatorTask) provides a viewpoint. Otherwise this zoom scale should be used to create the viewpoint for point results.
DisplayName
Gets or sets the name of the locator. Defaults to the locator's name, or "locator" if not set.
Declaration
public string DisplayName { get; set; }
Property Value
Type | Description |
---|---|
String |
GeocodeParameters
Gets the geocode parameters, which can be used to configure search behavior.
Declaration
public GeocodeParameters GeocodeParameters { get; }
Property Value
Type | Description |
---|---|
GeocodeParameters |
Remarks
"*"
when the Locator is loaded for the first time.
LoadTask
Gets the task used to perform initial locator setup.
Declaration
protected Task LoadTask { get; }
Property Value
Type | Description |
---|---|
Task |
Locator
Gets the underlying locator.
Declaration
public LocatorTask Locator { get; }
Property Value
Type | Description |
---|---|
LocatorTask |
MaximumResults
Gets or sets the maximum number of results to return for a search. Default is 6.
Declaration
public int MaximumResults { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
MaximumSuggestions
Gets or sets the maximum number of suggestions to return. Default is 6.
Declaration
public int MaximumSuggestions { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Placeholder
Gets or sets the placeholder to show when this search source is selected for use.
Declaration
public string Placeholder { get; set; }
Property Value
Type | Description |
---|---|
String |
PreferredSearchLocation
Declaration
public MapPoint? PreferredSearchLocation { get; set; }
Property Value
Type | Description |
---|---|
Nullable<MapPoint> |
SearchArea
Gets or sets the area to be used as a constraint for searches and suggestions.
Declaration
public Geometry.Geometry? SearchArea { get; set; }
Property Value
Type | Description |
---|---|
Nullable<Geometry.Geometry> |
SubtitleAttributeKey
Gets or sets the attribute key to use as the subtitle when returning results. Key must be included in
Declaration
public string SubtitleAttributeKey { get; set; }
Property Value
Type | Description |
---|---|
String |
SuggestParameters
Gets the suggestion parameters, which can be used to configure suggestion behavior.
Declaration
public SuggestParameters SuggestParameters { get; }
Property Value
Type | Description |
---|---|
SuggestParameters |
Remarks
Methods
| Improve this Doc View SourceCreateDefaultSourceAsync(CancellationToken)
Creates a LocatorSearchSource configured for use with the Esri World Geocoder service.
Declaration
public static async Task<LocatorSearchSource> CreateDefaultSourceAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | Token used for cancellation. |
Returns
Type | Description |
---|---|
Task<LocatorSearchSource> |
Remarks
This method will re-use a static LocatorTask instance to improve performance.
NotifyDeselected(SearchResult)
This search source does not track selection state.
Declaration
public virtual void NotifyDeselected(SearchResult result)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | result |
NotifySelected(SearchResult)
This search source does not track selection state.
Declaration
public virtual void NotifySelected(SearchResult result)
Parameters
Type | Name | Description |
---|---|---|
SearchResult | result |
RepeatSearchAsync(String, Envelope, CancellationToken)
Repeats the last search, with results restricted to the current visible area.
Declaration
public virtual async Task<IList<SearchResult>> RepeatSearchAsync(string queryString, Envelope queryExtent, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text to be used for the query. |
Envelope | queryExtent | Extent used to limit the results. |
CancellationToken | cancellationToken | Token used to cancel search. |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning a list of results. |
SearchAsync(SearchSuggestion, CancellationToken)
Gets a list of search results for the given suggestions.
Declaration
public virtual async Task<IList<SearchResult>> SearchAsync(SearchSuggestion suggestion, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
SearchSuggestion | suggestion | Suggestion to use for the search. |
CancellationToken | cancellationToken | Token used to cancel searches. |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning a list of results. |
SearchAsync(String, CancellationToken)
Gets a list of search results for the given query.
Declaration
public virtual async Task<IList<SearchResult>> SearchAsync(string queryString, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text of the query. |
CancellationToken | cancellationToken | Token used to cancel requests (e.g. because the search was changed or canceled). |
Returns
Type | Description |
---|---|
Task<IList<SearchResult>> | Task returning list of search results. |
SuggestAsync(String, CancellationToken)
Gets a list of suggestions for the given query.
Declaration
public virtual async Task<IList<SearchSuggestion>> SuggestAsync(string queryString, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
String | queryString | Text of the query. |
CancellationToken | cancellationToken | Token used to cancel requests (e.g. because the search text has changed). |
Returns
Type | Description |
---|---|
Task<IList<SearchSuggestion>> | Task returning a list of suggestions. |