Class: Searcher

Searcher

Base class for all searchers

Constructor

new Searcher(options)

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
onSelect Septima.Search.Searcher~selectCallback <optional>
Function to call when a result is selected by the user.
searchDelay int <optional>
0 Delay in ms before executing the search
matchesPhrase string <optional>
"matcher" Phrase used to display matches.
usesGeoFunctions boolean <optional>
false Does the implementation need the geo functions
iconURI boolean <optional>
Does the implementation need the geo functions
blankBehavior string <optional>
"search" "none"|"search"
Source:

Methods

addCustomButtonDef(customButtonDef)

Displays an icon next to each result.
Parameters:
Name Type Description
customButtonDef Septima.Search.Searcher.CustomButtonDef
Source:

createQueryResult() → {Septima.Search.QueryResult}

Create a {Septima.Search.QueryResult}.
Source:
Returns:
Type
Septima.Search.QueryResult

fetchData(query, caller)

This method is called is called by the controller when the driver should fetch data.
This method MUST be implemented by all seachers
A call to this method MUST result in either a call to Septima.Search.Controller.fetchSuccess(Septima.Search.QueryResult) or caller.fetchError()
Parameters:
Name Type Description
query Septima.Search.Query
caller Septima.Search.Controller
Source:

getCentroid(geoJsonObject) → {GeoJsonObject}

Find the centroid
Parameters:
Name Type Description
geoJsonObject geoJsonObject
Source:
Returns:
Type
GeoJsonObject

getPointOnSurface(geoJsonObject) → {GeoJsonObject}

Find a point guaranteed to lie on the surface
Parameters:
Name Type Description
geoJsonObject geoJsonObject
Source:
Returns:
Type
GeoJsonObject

onSelect(result)

This method is called by the controller when a result is selected.
This method MAY be implemented by searchers.
Implementations MUST call this._onSelectCallback(result)
Parameters:
Name Type Description
result Septima.Search.Searcher.Result
Source:

registerTarget(target)

Register a target.
Parameters:
Name Type Description
target string
Source:

translateWktToGeoJsonObject(wkt) → {GeoJsonObject}

Convert a wkt string to a geojson object
Parameters:
Name Type Description
wkt string
Source:
Returns:
Type
GeoJsonObject

Type Definitions

CustomButtonDef

Definition of a button, icon, or link which is presented together with search results
Type:
  • Object
Properties:
Name Type Attributes Description
buttonText string Text or tooltip
buttonImage string URL of image (20*20)
callBack function Called when icon is clicked (callBack(result))
target string <optional>
Name of target
Source:

Result

A search result item created by a searcher
Type:
  • Object
Properties:
Name Type Description
title string The title as displayed in the search result
description string The description as displayed in the search result
geometry object geojson
searcher Septima.Search.Searcher
data object Searcher specific data - See each searcher for details
Source:

selectCallback(result)

A function which is called when a result is selected.
Parameters:
Name Type Description
result Septima.Search.Searcher.Result
Source: