# Class: Vector

## vcs.vcm.layer.Vector

Vector Layer for Openlayers, Cesium and Oblique

#### new vcs.vcm.layer.Vector(options)

  Name | Type | Description
  --- | --- | ---
  `options` | vcs.vcm.layer.Vector.Options |

### Subclasses

- vcs.vcm.layer.FeatureStore
- vcs.vcm.layer.GeoJSON
- vcs.vcm.layer.VectorCluster
- vcs.vcm.layer.WFS

### Extends

- vcs.vcm.layer.CommonLayer

### Members

#### altitudeMode{string}

#### classificationType

#### className{string}

  class Name of the Object

#### heightAboveGround{number}

  height above ground for all point vector objects -> altitudeMode must be set to: "relativeToGround" either on the feature (precedence) or the layer

#### hiddenObjectIds{Array.<string>}

  array of object Ids which should be hidden global, if this layer is active

#### name{string}

  unique Name

#### skirt{number}

#### storeyHeight{number}

#### visibility{boolean}

#### zCoordinateEyeOffset{number}

  All point vector objects become billboards in cesium which can contain an eyeOffset see: https://cesiumjs.org/Cesium/Build/Documentation/Billboard.html?classFilter=billboard

### Methods

#### activate(active){Promise} inherited

  Activates or deactivates this layer object, i.e. changes its internal view state and updates the map by calling show

  Name | Type | Description
  --- | --- | ---
  `active` | boolean | false or true activates or deactivates this layer

  ##### Fires:

  - `LAYER_ACTIVATED` (vcs.vcm.layer.Layer) - vcs.vcm.event.EventType.LAYER_ACTIVATED is triggered when a layer is activated.
  - `LAYER_CHANGED` (vcs.vcm.layer.Layer) - vcs.vcm.event.EventType.LAYER_CHANGED is triggered when a layer is activated or deactivated.
  - `LAYER_DEACTIVATED` (vcs.vcm.layer.Layer) - vcs.vcm.event.EventType.LAYER_DEACTIVATED is triggered when a layer is deactivated.

#### addFeatures(features){Array.<string>}

  add features to the vector layer and return an array with their ids. The geometry will be mutated and transformed to EPSG 3857 mercator coordinate system

  Name | Type | Description
  --- | --- | ---
  `features` | Array.<ol.Feature> |

  TODO
    - mechanism to enforce XYZ coordinate layout for internal usage

#### addGenericFeatureProperties(properties) inherited

  Set properties, which are always added to the generic object, eg. for use in balloons

  Name | Type | Description
  --- | --- | ---
  `properties` | Object |

#### clearHiddenObjects() inherited

  clears all the hidden objects

#### clearHighlighting() inherited

  clears all highlighted objects

#### clearStyle() inherited

  Clears the style of this layer

#### dispose() inherited

  disposes of this layer, removes instances from the current maps and the framework

#### getAltitudeMode(){string}

  returns the altitudeMode of the layer

  Deprecated
    - Yes

#### getClassName(){string} inherited

  returns the class name of this object.

  Deprecated
    - Yes

  ##### Returns:

  className

#### getConfigObject(){Object} inherited

#### getExclusiveGroup(){string} inherited

  returns the exclusive group of this layer

  Deprecated
    - Yes

#### getExtent(){vcs.vcm.util.Extent} inherited

  returns the Extent of this layer

  Deprecated
    - Yes

#### getFeatureById(id){ol.Feature}

  returns an feature if found, otherwise null feature geometries are always in EPSG 3857 mercator coordinate system

  Name | Type | Description
  --- | --- | ---
  `id` | string | number |

#### getFeatures(){Array.<ol.Feature>}

  returns an array with features Feature geometries are always in EPSG 3857 mercator coordinate system

#### getFeaturesById(ids){Array.<ol.Feature>}

  returns an array with features feature geometries are always in EPSG 3857 mercator coordinate system

  Name | Type | Description
  --- | --- | ---
  `ids` | Array.<string> |

#### getHeightAboveGround(){number}

  returns the height above ground

  Deprecated
    - Yes

#### getId(){string} inherited

  returns the id of this object

  Deprecated
    - Yes

#### getMaxResolution(){number}

  returns the maximum resolution (exclusive) below which this layer will be visible.

  Deprecated
    - 3.5

#### getMinResolution(){number}

  returns the minimum resolution (inclusive) at which this layer will be visible.

  Deprecated
    - 3.5

#### 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

#### getProjection(){vcs.vcm.util.Projection}

  returns the source Projection

  Deprecated
    - 3.5

#### getScaleByDistance(){Array.<number>}

  returns the scale By Distance

  Deprecated
    - Yes

#### getSource(){ol.source.Vector}

  returns the ol3 vector source

#### getStyle(){vcs.vcm.util.style.VectorStyleItem}

  returns the style of the layer

  Deprecated
    - 3.5

#### getType(){number} inherited

  returns the type of this layer

  Deprecated
    - Yes

#### getVcsMeta(options){vcs.vcm.layer.VcsMeta}

  Returns the layers vcsMeta object

  Name | Type | Description
  --- | --- | ---
  `options` | vcs.vcm.layer.GeoJSON.writeOptions |

#### getZCoordinateEyeOffset(){number}

  returns the amount of meters the features are being pulled forward in the direction of the viewer (in 3D)

  Deprecated
    - Yes

#### getZIndex(){number}

  returns the zIndex of the layer

  Deprecated
    - Yes

#### hideObjects(toHide) inherited

  hides a number of objects

  Name | Type | Description
  --- | --- | ---
  `toHide` | Array.<(string|number)> | A list of Object Ids which will be hidden

#### highlight(toHighlight) inherited

  highlights a number of building objects with the given color

  Name | Type | Description
  --- | --- | ---
  `toHighlight` | Object.<string, (vcs.vcm.util.style.VectorStyleItem|Cesium.Color|ol.style.Style)> |

#### isActive(){boolean} inherited

  checks if the layer is active

  Deprecated
    - Yes

#### isExclusive(){boolean} inherited

  returns whether this layer can only be used exclusive

  Deprecated
    - Yes

#### isIconManagerInUse(){boolean} inherited

  returns whether this layer is used by the iconmanager

  Deprecated
    - Yes

#### isInitialized(){boolean} inherited

  returns true if the layer is initialized

  Deprecated
    - Yes

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

  checks if the currently active map supports this layer

  Name | Type | Description
  --- | --- | ---
  `map` | vcs.vcm.maps.Map |

#### removeAllFeatures()

  removes all features from the vector layer

#### removeFeaturesById(ids)

  removes features from the vector layer

  Name | Type | Description
  --- | --- | ---
  `ids` | Array.<(string|number)> |

#### setHighlightStyle(style)

  sets the highlightstyle of this layer

  Name | Type | Description
  --- | --- | ---
  `style` | ol.style.Style | ol.StyleFunction | vcs.vcm.util.style.VectorStyleItem |

#### setProjection(projection)

  Sets a new source Projection for the layer. All features added hereafter are assumed to be in this projection

  Name | Type | Description
  --- | --- | ---
  `projection` | vcs.vcm.util.Projection |

  Deprecated
    - 3.5

#### setStyle(style, silent) inherited

  Sets the style based on a styleName on a layer

  Name | Type | Description
  --- | --- | ---
  `style` | string | ol.style.Style | ol.StyleFunction | vcs.vcm.util.style.StyleItem |
  `silent` | boolean |

#### showObjects(unHide) inherited

  unHides a number of objects

  Name | Type | Description
  --- | --- | ---
  `unHide` | Array.<(string|number)> | A list of Object Ids which will be unHidden

#### unHighlight(toUnHighlight) inherited

  unhighlights a number of building objects

  Name | Type | Description
  --- | --- | ---
  `toUnHighlight` | Array.<string> | Array with IDS to unhighlight

### Type Definitions

#### vcs.vcm.layer.Vector.Options{vcs.vcm.layer.Layer.Options}

  ##### Properties:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `projection` | vcs.vcm.util.Projection.Options |  |  |
  `maxResolution` | number |  |  |
  `minResolution` | number |  |  |
  `dontUseTerrainForOblique` | boolean | <optional> | false |
  `zCoordinateEyeOffset` | number | <optional> | 0 | The distance (m) by which the vector objects are being pulled towards the viewer (3D only)
  `altitudeMode` | string | <optional> | 'relativeToGround' | Either "relativeToGround", "clampToGround" or 'none'
  `heightAboveGround` | number |  |  | The height above ground that point features are displayed -> altitudeMode should be relativeToGround
  `scaleByDistance` | Cesium.NearFarScalar |  |  | Array with 4 numbers by which features are being scaled based on distance (3D only) see here
  `balloonHeightOffset` | number | <optional> | 10 |
  `zIndex` | number | <optional> | 10 |
  `highlightStyle` | vcs.vcm.layer.Vector.StyleOptions | vcs.vcm.util.style.VectorStyleItem | undefined |  |  |
  `isDynamic` | boolean |  |  | if true, the cesium synchronizers are destroyed on map change
  `skirt` | number | undefined |  |  | default skirt value to use for extruded features
  `storeyHeight` | number | undefined |  |  | default storey height to use for extruded features to draw storey lines
  `classificationType` | string | undefined | <optional> | 'terrain' | the cesium classification type for this layer. one of 'both', 'terrain' or 'cesium3DTile'

#### vcs.vcm.layer.Vector.StyleOptions{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `image` | olx.style.IconOptions | olx.style.CircleOptions | undefined |
  `stroke` | olx.style.StrokeOptions | undefined |
  `fill` | olx.style.FillOptions | undefined |

  Deprecated
    - Yes

### Events

#### LAYER_ACTIVATED inherited

  vcs.vcm.event.EventType.LAYER_ACTIVATED is triggered when a layer is activated.

  ##### Type:

  - vcs.vcm.layer.Layer

#### LAYER_CHANGED inherited

  vcs.vcm.event.EventType.LAYER_CHANGED is triggered when a layer is activated or deactivated.

  ##### Type:

  - vcs.vcm.layer.Layer

#### LAYER_DEACTIVATED inherited

  vcs.vcm.event.EventType.LAYER_DEACTIVATED is triggered when a layer is deactivated.

  ##### Type:

  - vcs.vcm.layer.Layer