Skip to main content

@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

PropertyModifiersTypeDescription
onSearchCompletedreadonlyGAEvent<SmartSearchCompletedEventArgs>Triggered when the search action completed with a new result
onSearchFailedreadonlyGAEvent<SmartSearchFailedEventArgs>Triggered when the search fails

Constructors

ConstructorModifiersDescription
(constructor)(httpClient, id, options)Constructs a new instance of the Smartsearch.

Methods

MethodModifiersDescription
Search(q)Request the autocomplete for the search