# Class: StyleItem

## vcs.vcm.util.style.StyleItem

An abstract style definition which can be applied to a layer

#### new vcs.vcm.util.style.StyleItem(options)

  Name | Type | Description
  --- | --- | ---
  `options` | vcs.vcm.util.style.StyleItem.Options |

### Subclasses

- vcs.vcm.util.style.DeclarativeStyleItem
- vcs.vcm.util.style.VectorStyleItem

### Members

#### cesiumStyle{Cesium.Cesium3DTileStyle}

  The 3D representation of this style

#### legend{Array.<vcs.vcm.util.style.StyleItem.LegendEntry>}

  Legend entries

#### name{string} {number}

  The name of the style

#### style{ol.style.Style} {ol.StyleFunction}

  The 2D representation of this style

#### styleChanged{Cesium.Event}

  Fired on style updates

  TODO
    - this is not yet the case for all vector style properties

### Methods

#### getOptions(sections){vcs.vcm.util.style.VectorStyleItem.Options|vcs.vcm.util.style.DeclarativeStyleItem.Options}

  Gets the options for this style item to be used in a config or vcsMeta

  Name | Type | Description
  --- | --- | ---
  `sections` | Object.<string, boolean> |

#### getReference(){vcs.vcm.util.style.Reference}

  gets a reference to this style by its name. should only be used for static styles, aka styles already part of the config

### Type Definitions

#### vcs.vcm.util.style.StyleItem.LegendEntry{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `color` | string | the color to display
  `name` | string | Object.<string, string> | the name to display for the given color

#### vcs.vcm.util.style.StyleItem.Options{Object}

  ##### Properties:

  Name | Type | Argument | Default | Description
  --- | --- | --- | --- | ---
  `type` | string | undefined |  |  | used in configuration to differentiate vector from declarative styles
  `name` | string | undefined |  |  | unique name
  `id` | string | number | undefined |  |  | unique id to use instead of the name
  `title` | string | Object.<string, string> | undefined |  |  | name/id is used when none is specifies
  `legend` | Array.<vcs.vcm.util.style.StyleItem.LegendEntry> | undefined |  |  |
  `colorBlendMode` | number | <optional> | Cesium.Cesium3DTileColorBlendMode.HIGHLIGHT | colorBlendMode for 3D Tiledataset @see https://cesiumjs.org/Cesium/Build/Documentation/Cesium3DTileColorBlendMode.html