Class: Hotspot

Hotspot(domElement, parentDomElement, view, params, opts)

HTML object positioned at certain coordinates

Constructor

new Hotspot(domElement, parentDomElement, view, params, opts)

Use HotspotContainer#createHotspot instead of this constructor

Parameters:
Name Type Description
domElement Element

Element that will be positioned

Positioning will be done using CSS Transforms when available and with the top and left properties when not.

The top and left properties always position the top left corner of an element. Therefore, the content of domElement must be centered around its top left corner.

parentDomElement Element

Usually the DOM element of a HotspotContainer

view View
params Object
opts Object
Properties
Name Type Description
perspective Object
Properties
Name Type Attributes Default Description
radius Number <optional>
null

Transform hotspot as if it were on the surface of a sphere. The hotspot will then always cover the same part of the 360° image.

This feature will only work on browsers with CSS 3D Transforms.

When radius is enabled the hotspots are automatically centered.

This value represents the radius of the sphere where the hotspot is. Therefore, the smaller this value, the larger the hotspot will appear on the screen.

extraRotations String

This value will be added to the transform CSS rule that places the hotspot in its position.

This enables transforming the hotspot to overlay a certain surface on the panorama. For instance, one possible value would be rotateX(0.5rad) rotateY(-0.1rad).

Methods

domElement() → {Element}

Returns:
Type
Element

hide()

Hide the hotspot

perspective() → {Object}

Returns:

Perspective

Type
Object

position() → {Object}

Returns:

Position params

Type
Object

setPerspective(params)

Parameters:
Name Type Description
params Object

Perspective params

setPosition(params)

Parameters:
Name Type Description
params Object

Position params

show()

Show the hotspot