@mapgear/geoapps > SmartSearch
SmartSearch class
Provides access to the usage of the Smartsearch functionality in GeoApps
Signature:export declare class SmartSearch
Example
An example of the usage:
geoapps.Initialize("<tenantUrl>");
// Initialize the smart search
const smartsearch = geoapps.AddSmartSearch("<smartsearchId>");
// Bind to the search events
smartsearch.onSearchCompleted.add((evt) => {
// Shows the resulting search array
console.log(evt.Result);
});
// Perform the search
smartsearch.Search("searchstring");
Events
| Property | Modifiers | Type | Description |
|---|---|---|---|
| onSearchCompleted | readonly | GAEvent<SmartSearchCompletedEventArgs> | Triggered when the search action completed with a new result |
| onSearchFailed | readonly | GAEvent<SmartSearchFailedEventArgs> | Triggered when the search fails |
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(httpClient, id, options) | Constructs a new instance of the Smartsearch. |
Methods
| Method | Modifiers | Description |
|---|---|---|
| Search(q) | Request the autocomplete for the search |