Class: Select

ol.control. Select


new Select( [options])

Select Control. A control to select features by attributes

Parameters:
Name Type Argument Description
options Object <optional>
Properties
Name Type Argument Default Description
className string

control class name

target Element | undefined

Specify a target if you want the control to be rendered outside of the map's viewport.

source ol.source.Vector | Array.<ol.source.Vector>

the source to search in

selectLabel string <optional>
select

select button label

addLabel string <optional>
add

add button label

caseLabel string <optional>
case sensitive

case checkbox label

allLabel string <optional>
match all

match all checkbox label

attrPlaceHolder string <optional>
attribute
valuePlaceHolder string <optional>
value
Fires:
  • event:select

Extends

Members


operationsList

List of operators / translation

Inherited From:

Methods


_escape(search)

Escape string for regexp

Parameters:
Name Type Description
search string
Inherited From:
Returns:
Type
string

_selectFeatures(result, features, condition, all, usecase)

Selection features in a list of features

Parameters:
Name Type Description
result Array.<ol.Feature>

the current list of features

features Array.<ol.Feature>

to test in

condition Object
Properties
Name Type Description
attr string

attribute name

op string

operator

val any

value to test

all boolean

all conditions must be valid

usecase boolean

use case or not when testing strings

Inherited From:

addCondition(options)

Add a new condition

Parameters:
Name Type Description
options *
Properties
Name Type Description
attr string

attribute name

op string

operator

val string

attribute value


doSelect(options)

Select features by attributes

Parameters:
Name Type Description
options *
Properties
Name Type Description
sources Array.<ol.source.Vector> | undefined

source to apply rules, default the select sources

useCase bool

case sensitive, default checkbox state

matchAll bool

match all conditions, , default checkbox state

conditions Array.<conditions>

array of conditions

Overrides:
Fires:
  • event:select

getConditions()

Get the condition list


getConditionsString()

Get the conditions as string


getFeatures()

Get feature collection to search in

Inherited From:
Returns:
Type
ol.Collection.<ol.Feature>

getSources()

Get vector source

Inherited From:
Returns:
Type
Array.<ol.source.Vector>

removeCondition(i)

Remove the ith condition

Parameters:
Name Type Description
i int

condition index


setConditions()

Set the condition list


setFeatures(features)

Set feature collection to search in

Parameters:
Name Type Description
features ol.Collection.<ol.Feature>
Inherited From:

setSources(source)

Set the current sources

Parameters:
Name Type Description
source ol.source.Vector | Array.<ol.source.Vector> | undefined
Inherited From: