SearchViewController QML Type

Performs searches and manages search state for a SearchView. More...

Since: Esri.ArcGISRuntime 100.13



Detailed Description

Property Documentation

activeSource : var

The currently active search source. All sources are used if this property is null.

automaticConfigurationEnabled : bool

Flag for whether automatic configuration is enabled or not. Determines whether the view will update its configuration based on the attached geoview's geomodel automatically. This includes such properties as queryCenter, queryArea, and eligableForRequery.

Defaults to true.

currentQuery : string

The current user-entered query. This property drives both suggestions and searches.

defaultPlaceholder : string

The string shown in the search view when no user query is entered. Default is "Find a place or address".

eligableForRequery : bool

Flag for whether the user can perform a requery. A requery will perform the search at the same location, but will only look at results that exist within the current extent, ignoring all other results.

geoView : var

The geoView the controller may optionally use for setting results, and for updating the active search area and preferred search location.

queryArea : Geometry

The search area to be used for the current query.

Ignored in most queries, unless the restrictToArea flag is set to true when calling SearchViewController::commitSearch.

This property should be updated as the user navigates the map/scene, or at minimum before calling SearchViewController::commitSearch.

Defaults to null

queryCenter : Point

The center for the search.

This property is used to weigh results in favour of those results closest to the center. This allows results to be local to the active viewpoint.

This should be updated by the view every time the user navigates the map.

Defaults to null.

resultMode : int

The mode which dictates how results are displayed.

With Automatic, if only a single result is found, then this is automatically set as the selected result. Otherwise when there is more than one possible result then the results property is populated with all possible results.

With Multiple, the results property is always populated with all found results (even if there is only 1 result in the list).

With Single, even if multiple results are found, the best result is automatically set as the "selected" result and the results property is never populated.

The default value is Automatic.

[read-only] results : ListModel

The collection of search results from a query.

A result is a ListElement with the following fields.

displayTitlestringThe result heading.
displaySubtitlestringOptional result subheading.
markerImageUrlurlURL of the image to display alongside result.
owningSourceobjectThe search-source this result was created from.
geoElementGeoElementThe optional map location/graphic of this result.
selectionViewpointEnvelopeAn area containing the result.

selectedResult : var

The selected result from the results collection.

Defaults to null.

See also resultMode.

[read-only] sources : ListModel

The collection of search sources to be used.

Each element is a ListElement with a single modelData field, which contains the search source object.

[read-only] suggestions : ListModel

The collection of suggestion results from a query.

A suggestion is a ListElement with the following fields.

displayTitlestringThe suggestion heading.
displaySubtitlestringOptional suggestion subheading.
collectionboolFlag for if the suggestion is a boolean.
markerImageUrlurlURL of the image to display alongside suggestion.
owningSourceobjectThe search-source this suggestion was created from.
suggestionSuggestionResultThe SuggestionResult that populated this ListElement.

Method Documentation

void acceptSuggestion(ListElement searchSuggestion)

Starts a search using the given suggestion result searchSuggestion.

At minimum the searchSuggestion needs two fields. `owningSource`, which points to the search source to perform the search, and `suggestion`, which is a SuggestionResult.

void clearSearch()

Clears the search. This will clear results , suggestions, selectedResult and currentQuery.

void commitSearch(bool restrictToArea)

Starts a search using the current query. When restrictToArea is true then the query will only look for results within the current queryArea.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.