# Class: Query

## vcs.vcm.widgets.Query

Query widget

#### new vcs.vcm.widgets.Query(options)

  Name | Type | Description
  --- | --- | ---
  `options` | vcs.vcm.widgets.Query.Options |

### Extends

- vcs.vcm.widgets.Widget

### Members

#### active{boolean}

#### activeQuery{vcs.vcm.widgets.Query.query}

  The current state of the query widget for the ui to observe. The type is either _free or the name of the used predefined query.

#### className{string}

  class Name of the Object

#### foundFeatures{Array.<vcs.vcm.widgets.WFSObject.Feature>}

  The response is parsed into this array.

  TODO
    - this is not an array of features, but objects. the wfsObject WFS2().readFeatures step does NOT return features

#### initialized{boolean}

#### maximumLevel{number}

  The maximum complexity depth of combination filters allowed

#### name{string}

  unique Name

### Methods

#### addFilter(filterConfig){string}

  Adds a filter to the active query

  Name | Type | Description
  --- | --- | ---
  `filterConfig` | Object | the configuration for one of the filters: 'geometry', 'property' or 'combination'

  ##### Returns:

  the filters id

#### addFilterToCombination(combo, filterConfig){string}

  Adds a second filter to a combination filter

  Name | Type | Description
  --- | --- | ---
  `combo` | vcs.vcm.widgets.query.filter.CombinationFilter |
  `filterConfig` | Object |

  ##### Returns:

  the filter id

#### addToSelectionSet(replace)

  Adds the found features to the select behaviour

  Name | Type | Description
  --- | --- | ---
  `replace` | boolean |

#### cancelRequest()

  Cancels a runnging request

#### clear()

  Clears the found items

#### getAllowedProperties(featureTypeName){Array.<vcs.vcm.cityGML.property.Property>}

  Gets the possible properties, dependent on the type of feature

  Name | Type | Description
  --- | --- | ---
  `featureTypeName` | string |

#### getClassName(){string} inherited

  returns the class name of this object.

  Deprecated
    - Yes

  ##### Returns:

  className

#### getConfigObject(){Object} inherited

#### getId(){string} inherited

  returns the id of this object

  Deprecated
    - Yes

#### getName(){string} inherited

  returns the name of the Object, the name is either given by the config Object or a uuid is generated

  Deprecated
    - Yes

#### getSupportedMaps(){Array.<string>} inherited

  Returns the widgets supported maps

#### isActive(){boolean} inherited

  returns the active state of the widget

  Deprecated
    - v3.6 use the property active directly

  ##### Returns:

  state of the widget

#### isInitialized(){boolean} inherited

  checks if the Widget is already initialized

  Deprecated
    - Yes

  ##### Returns:

  true if all requirements are there

#### isSupported(map){boolean} inherited

  returns true if this widget supports the given map. Should be overriden by the widget

  Name | Type | Description
  --- | --- | ---
  `map` | string | vcs.vcm.maps.Map | the map or className to check for support

#### removeFilter(filter)

  Removes a filter, in case of a combination filter, all its children

  Name | Type | Description
  --- | --- | ---
  `filter` | vcs.vcm.widgets.query.filter.Filter |

#### sendRequest(){Promise}

  Request the features from the wfs

#### setPreset(preset)

  Sets the activeQuery to the preset

  Name | Type | Description
  --- | --- | ---
  `preset` | vcs.vcm.widgets.Query.queryPreset | string | either the preset object or '_free' to activate the free query

#### zoomToFeature(feature)

  Zooms to a single feature contained in the foundFeatures array

  Name | Type | Description
  --- | --- | ---
  `feature` | Object |

#### zoomToFeatures()

  Zooms to the found features

### Type Definitions

#### vcs.vcm.widgets.Query.dateInput{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `year` | number |
  `month` | number |
  `day` | number |

#### vcs.vcm.widgets.Query.queryPreset{Object}

  ##### Properties:

  Name | Type | Argument | Description
  --- | --- | --- | ---
  `name` | string |  |
  `featureType` | string |  |
  `property` | string |  |
  `comparison` | string |  |
  `valueInput` | string | <optional> |
  `dateInput` | vcs.vcm.widgets.Query.dateInput | <optional> |
  `dateInputUpper` | vcs.vcm.widgets.Query.dateInput | <optional> |
  `dateInputLower` | vcs.vcm.widgets.Query.dateInput | <optional> |
  `genericAttributeName` | string | <optional> |
  `allowAdditional` | boolean | undefined | string |  |
  `maximumLevel` | number | <optional> |