# Panorama

Base Panorama

## Constructor

#### new Panorama(geometry, material)

Source:
  - panorama/Panorama.js, line 13

##### Parameters:

Name | Type | Description
--- | --- | ---
`geometry` | THREE.Geometry | The geometry for this panorama
`material` | THREE.Material | The material for this panorama

### Methods

#### add(object)

Source:
  - panorama/Panorama.js, line 70

Adding an object To counter the scale.x = -1, it will automatically add an empty object with inverted scale on x

##### Parameters:

Name | Type | Description
--- | --- | ---
`object` | THREE.Object3D | The object to be added

#### dispose()

Source:
  - panorama/Panorama.js, line 667

Dispose panorama

#### fadeIn()

Source:
  - panorama/Panorama.js, line 523

Start fading in animation

##### Fires:

- Panorama#event:enter-fade-complete

#### fadeOut()

Source:
  - panorama/Panorama.js, line 552

Start fading out animation

#### getZoomLevel() → {number}

Source:
  - panorama/Panorama.js, line 263

Get zoom level based on window width

##### Returns:

zoom level indicating image quality

Type
  number

#### link(pano, position, imageScaleopt, imageSrcopt)

Source:
  - panorama/Panorama.js, line 377

Link one-way panorama

##### Parameters:

Name | Type | Attributes | Default | Description
--- | --- | --- | --- | ---
`pano` | Panorama |  |  | The panorama to be linked to
`position` | THREE.Vector3 |  |  | The position of infospot which navigates to the pano
`imageScale` | number | <optional> | `300` | Image scale of linked infospot
`imageSrc` | string | <optional> | `DataImage.Arrow` | The image source of linked infospot

#### onClick(event)

Source:
  - panorama/Panorama.js, line 139

Click event handler

##### Parameters:

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

##### Fires:

- Infospot#event:dismiss

#### onEnter()

Source:
  - panorama/Panorama.js, line 571

This will be called when entering a panorama

##### Fires:

- Panorama#event:enter
- Panorama#event:enter-start

#### onError()

Source:
  - panorama/Panorama.js, line 246

This will be called when panorama loading has error

##### Fires:

- Panorama#event:error

#### onLeave()

Source:
  - panorama/Panorama.js, line 623

This will be called when leaving a panorama

##### Fires:

- Panorama#event:leave

#### onLoad()

Source:
  - panorama/Panorama.js, line 209

This will be called when panorama is loaded

##### Fires:

- Panorama#event:load

#### onProgress()

Source:
  - panorama/Panorama.js, line 228

This will be called when panorama is in progress

##### Fires:

- Panorama#event:progress

#### setContainer(data)

Source:
  - panorama/Panorama.js, line 165

Set container of this panorama

##### Parameters:

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

##### Fires:

- Infospot#event:panolens-container

#### setLinkingImage(url, scale)

Source:
  - panorama/Panorama.js, line 361

Set image of this panorama's linking infospot

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` | string | Url to the image asset
`scale` | number | Scale factor of the infospot

#### toggleInfospotVisibility(isVisible, delay)

Source:
  - panorama/Panorama.js, line 314

Toggle visibility of infospots in this panorama

##### Parameters:

Name | Type | Description
--- | --- | ---
`isVisible` | boolean | Visibility of infospots
`delay` | number | Delay in milliseconds to change visibility

##### Fires:

- Panorama#event:infospot-animation-complete

#### updateTexture(texture)

Source:
  - panorama/Panorama.js, line 299

Update texture of a panorama

##### Parameters:

Name | Type | Description
--- | --- | ---
`texture` | THREE.Texture | Texture to be updated

### Events

#### enter

Source:
  - panorama/Panorama.js, line 600

Enter panorama event

##### Type:

- object

#### enter-complete

Source:
  - panorama/Panorama.js, line 491

Enter panorama and animation complete event

##### Type:

- object

#### enter-fade-complete

Source:
  - panorama/Panorama.js, line 535

Enter panorama fade complete event

##### Type:

- object

#### enter-fade-start

Source:
  - panorama/Panorama.js, line 462

Enter panorama fade in start event

##### Type:

- object

#### enter-start

Source:
  - panorama/Panorama.js, line 580

Enter panorama and animation starting event

##### Type:

- object

#### error

Source:
  - panorama/Panorama.js, line 248

Loading panorama error event

##### Type:

- object

#### infospot-animation-complete

Source:
  - panorama/Panorama.js, line 343

Complete toggling infospot visibility

##### Type:

- object

#### leave

Source:
  - panorama/Panorama.js, line 645

Leave panorama event

##### Type:

- object

#### leave-complete

Source:
  - panorama/Panorama.js, line 478

Leave panorama complete event

##### Type:

- object

#### leave-start

Source:
  - panorama/Panorama.js, line 632

Leave panorama and animation starting event

##### Type:

- object

#### load

Source:
  - panorama/Panorama.js, line 213

Load panorama event

##### Type:

- object

#### panolens-viewer-handler

Source:
  - panorama/Panorama.js, line 675

##### Properties:

Name | Type | Description
--- | --- | ---
`method` | string | Viewer function name
`data` | * | The argument to be passed into the method

On panorama dispose handler

##### Type:

- object

#### panolens-viewer-handler

Source:
  - panorama/Panorama.js, line 428

##### Properties:

Name | Type | Description
--- | --- | ---
`method` | string | Viewer function name
`data` | * | The argument to be passed into the method

Viewer handler event

##### Type:

- object

#### panolens-viewer-handler

Source:
  - panorama/Panorama.js, line 99

##### Properties:

Name | Type | Description
--- | --- | ---
`method` | string | Viewer function name
`data` | * | The argument to be passed into the method

Infospot focus handler event

##### Type:

- object

#### progress

Source:
  - panorama/Panorama.js, line 230

##### Properties:

Name | Type | Description
--- | --- | ---
`progress` | object | The progress object containing loaded and total amount

Loading panorama progress event

##### Type:

- object