# Class: BalloonInfo

## vcs.vcm.widgets.BalloonInfo

Balloon Info Widget, determines which layers get which balloon `vcs.vcm.util.Balloon` when they are selected

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

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

### Extends

- vcs.vcm.widgets.Widget

### Members

#### active{boolean}

#### className{string}

  class Name of the Object

#### initialized{boolean}

#### name{string}

  unique Name

### Methods

#### addTypeForLayer(layerName, template, minTop, minLeft)

  Adds a balloonType for a specific layer. this function will overwrite

  Name | Type | Default | Description
  --- | --- | --- | ---
  `layerName` | string |  |
  `template` | string | Array.<string> |  | set the html for the balloon, is run through the underscore template engine for the display of attributes http://underscorejs.org/#template template -
  `minTop` | string | balloonHeight+30 | sets the amount of pixels the balloon is to be offsetted in the UP direction (for example: "minTop" : "balloonHeight + 30" )
  `minLeft` | string | 70 | sets the amount of pixels the balloon is to be offsetted in the LEFT direction (for example: "minLeft" : "balloonWidth + 70" )

#### clearBalloon()

  Clears the currently active balloon

#### createBalloonForGenericFeature(genericFeature)

  Create a balloon for the genericFeature according to the configuration of this widget

  Name | Type | Description
  --- | --- | ---
  `genericFeature` | vcs.vcm.widgets.BalloonInfo.GenericFeature | Object literal containing the genericFeature for which to create the balloon

#### getBalloon(){vcs.vcm.util.Balloon}

  Returns the current balloon

  Deprecated
    - 3.5

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

#### hasTypeForLayerName(layerName){boolean}

  Tests whether a specific balloonType was registered for a layerName

  Name | Type | Description
  --- | --- | ---
  `layerName` | string |

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

### Type Definitions

#### vcs.vcm.widgets.BalloonInfo.BalloonType{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `template` | string | Array.<string> | set the html for the balloon, is run through the underscore template engine for the display of attributes http://underscorejs.org/#template template -
  `minTop` | string | sets the amount of pixels the balloon is to be offsetted in the UP direction (for example: "minTop" : "balloonHeight + 30" )
  `minLeft` | string | sets the amount of pixels the balloon is to be offsetted in the LEFT direction (for example: "minLeft" : "balloonWidth + 70" )
  `layerNames` | Array.<string> | the names of the layers for which to use this template and offset (for example: ["myBuildingLayer"] ) in case of ambiguity: layerNames has precendence over layerTypes
  `layerTypes` | Array.<string> | the layer types for which to use this template and offset (for example: ["vcs.vcm.layer.cesium.Buildings"] ) in case of ambiguity: layerNames has precendence over layerTypes

#### vcs.vcm.widgets.BalloonInfo.GenericFeature{Object}

  ##### Properties:

  Name | Type | Description
  --- | --- | ---
  `attributes` | Object | key-value pairs of the attributes, passed to template of the `BalloonType`
  `latitude` | number | latitude
  `longitude` | number | longitude
  `height` | number | height
  `layerName` | string | as reference to the balloonTypes
  `layerClass` | string | as reference to the balloonTypes
  `relativeToGround` | boolean | whether to use the height as relative to ground or absolute (above ellipsoid)