# Infospot

Information spot attached to panorama

## Constructor

#### new Infospot(scaleopt, imageSrcopt, animatedopt)

Source:
  - infospot/Infospot.js, line 14

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`scale` | number | <optional> | `300` | Default scale
`imageSrc` | string | <optional> | `PANOLENS.DataImage.Info` | Image overlay info
`animated` | boolean | <optional> | `true` | Enable default hover animation

### Methods

#### addHoverElement(el, deltaopt)

Source:
  - infospot/Infospot.js, line 478

Add hovering element by cloning an element

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`el` | HTMLDOMElement |  |  | Element to be cloned and displayed
`delta` | number | <optional> | `40` | Vertical delta to the infospot

#### addHoverText(text, deltaopt)

Source:
  - infospot/Infospot.js, line 449

Add hovering text element

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`text` | string |  |  | Text to be displayed
`delta` | number | <optional> | `40` | Vertical delta to the infospot

#### dispose()

Source:
  - infospot/Infospot.js, line 659

Dispose

#### enableRaycast(enabledopt)

Source:
  - infospot/Infospot.js, line 559

Enable raycasting

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`enabled` | boolean | <optional> | `true` |

#### focus(durationopt, easingopt)

Source:
  - infospot/Infospot.js, line 643

Focus camera center to this infospot

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`duration` | number | <optional> | `1000` | Duration to tween
`easing` | function | <optional> | `TWEEN.Easing.Exponential.Out` | Easing function

#### getContainer() → {HTMLElement}

Source:
  - infospot/Infospot.js, line 151

Get container

##### Returns:

- The container of this infospot

Type
  HTMLElement

#### hide(delayopt)

Source:
  - infospot/Infospot.js, line 603

Hide infospot

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`delay` | number | <optional> | `0` | Delay time to hide

#### lockHoverElement()

Source:
  - infospot/Infospot.js, line 528

Lock hovering element

#### onClick(event)

Source:
  - infospot/Infospot.js, line 164

This will be called by a click event Translate and lock the hovering element if any

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | object | Event containing mouseEvent with clientX and clientY

#### onDismiss(event)

Source:
  - infospot/Infospot.js, line 183

Dismiss current element if any

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | object | Dismiss event

#### onDualEyeEffect(event)

Source:
  - infospot/Infospot.js, line 300

On dual eye effect handler Creates duplicate left and right element

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | object | panolens-dual-eye-effect event

#### onHover(event)

Source:
  - infospot/Infospot.js, line 201

This will be called by a mouse hover event Translate the hovering element if any

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | object | Event containing mouseEvent with clientX and clientY

#### onHoverEnd()

Source:
  - infospot/Infospot.js, line 263

This will be called on a mouse hover end Sets cursor style to 'default', hide the element and scale down the infospot

#### onHoverStart(event)

Source:
  - infospot/Infospot.js, line 210

This will be called on a mouse hover start Sets cursor style to 'pointer', display the element and scale up the infospot

##### Parameters:

Name | Type | Description
--- | --- | ---
`event` | object |

#### removeHoverElement()

Source:
  - infospot/Infospot.js, line 498

Remove hovering element

#### setContainer(data)

Source:
  - infospot/Infospot.js, line 120

Set infospot container

##### Parameters:

Name | Type | Description
--- | --- | ---
`data` | HTMLElement | object | Data with container information

#### setCursorHoverStyle()

Source:
  - infospot/Infospot.js, line 436

Set cursor css style on hover

#### setElementStyle(type, element, value)

Source:
  - infospot/Infospot.js, line 403

Set vendor specific css

##### Parameters:

Name | Type | Description
--- | --- | ---
`type` | string | CSS style name
`element` | HTMLElement | The element to be modified
`value` | string | Style value

#### setFocusMethod()

Source:
  - infospot/Infospot.js, line 626

Set focus event handler

#### setText(text)

Source:
  - infospot/Infospot.js, line 421

Set hovering text content

##### Parameters:

Name | Type | Description
--- | --- | ---
`text` | string | Text to be displayed

#### show(delayopt)

Source:
  - infospot/Infospot.js, line 579

Show infospot

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`delay` | number | <optional> | `0` | Delay time to show

#### translateElement(x, y)

Source:
  - infospot/Infospot.js, line 355

Translate the hovering element by css transform

##### Parameters:

Name | Type | Description
--- | --- | ---
`x` | number | X position on the window screen
`y` | number | Y position on the window screen

#### unlockHoverElement()

Source:
  - infospot/Infospot.js, line 543

Unlock hovering element

### Events

#### dismiss

Source:
  - panorama/Panorama.js, line 145

Dimiss event

##### Type:

- object

#### panolens-container

Source:
  - panorama/Panorama.js, line 185

##### Properties:

Name | Type | Description
--- | --- | ---
`container` | HTMLElement | The container of this panorama

Set container event

##### Type:

- object

#### panolens-dual-eye-effect

Source:
  - viewer/Viewer.js, line 568

##### Properties:

Name | Type | Description
--- | --- | ---
`mode` | MODES | Current display mode

Dual eye effect event

##### Type:

- object

#### panolens-dual-eye-effect

Source:
  - viewer/Viewer.js, line 530

##### Properties:

Name | Type | Description
--- | --- | ---
`mode` | MODES | Current display mode

Dual eye effect event

##### Type:

- object