Class: SearchableGeoJson

SearchableGeoJson

Searches a geojson featurecollection

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 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:
  • searchers/local/searchableGeoJson.js, line 13

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:
  • searchers/local/searchableData.js, line 18

descriptionProperty

The name of the property in the data array that should be used as description.
Inherited From:
Source:
  • searchers/local/searchableData.js, line 33

displaynameProperty

The name of the property in the data array that should be used as displayname.
Inherited From:
Source:
  • searchers/local/searchableData.js, line 28

plural

Plural phrase, eg.: "features"
Inherited From:
Source:
  • searchers/local/searchableData.js, line 48

searchProperties

Array of property names in the data array to search in. If not added, all properties will be used
Inherited From:
Source:
  • searchers/local/searchableData.js, line 23

singular

Singular phrase, eg.: "feature"
Inherited From:
Source:
  • searchers/local/searchableData.js, line 43

useAND

Use AND and not OR when multiple terms is added by the user. Set to false to use OR
Inherited From:
Source:
  • searchers/local/searchableData.js, line 38

Methods

getScore() → {Integer}

Get the score for a single string
Inherited From:
Source:
  • searchers/local/searchableData.js, line 189
Returns:
Type
Integer