Class: SearchableGeoJson

SearchableGeoJson

Searches a geojson featurecollection

Constructor

new SearchableGeoJson(options)

Parameters:
Name Type Description
options Object SearchableGeoJson expects these properties:
Properties
Name Type Description
data object featurecollection or a function that returns a featurecollection.
searchProperties Array.<string> Array of property names in the data array to search in. If not added, all properties will be used
displaynameProperty string The name of the property in the data array that should be used as displayname
descriptionProperty string The name of the property in the data array that should be used as description
useAND boolean Use AND and not OR when multiple terms is added by the user. Default true
Source:

Extends

Members

data

Array of data or a function that returns an array of data. If data is a function it will be called each time fetchData is called. This way the client could change the data on the fly and not keep them static. This could be used when adding an external filter.
Inherited From:
Source:

descriptionProperty

The name of the property in the data array that should be used as description.
Inherited From:
Source:

displaynameProperty

The name of the property in the data array that should be used as displayname.
Inherited From:
Source:

plural

Plural phrase, eg.: "features"
Inherited From:
Source:

searchProperties

Array of property names in the data array to search in. If not added, all properties will be used
Inherited From:
Source:

singular

Singular phrase, eg.: "feature"
Inherited From:
Source:

useAND

Use AND and not OR when multiple terms is added by the user. Set to false to use OR
Inherited From:
Source:

Methods

getDescription() → {String}

Used for getting the description
Overrides:
Source:
Returns:
Type
String

getDisplayname() → {String}

Used for getting the displayname
Overrides:
Source:
Returns:
Type
String

getScore() → {Integer}

Get the score for a single string
Inherited From:
Source:
Returns:
Type
Integer

match() → {Integer}

Method that defines what to search in
Overrides:
Source:
Returns:
Type
Integer