panorama.createPlayer

Static function.

Searches for a panorama near the specified point. If at least one is found, it creates a panorama player with this panorama.

Returns a promise object that will be resolved by the instance of the class panorama.Player or rejected with the error description.

{ vow.Promise } panorama.createPlayer(element, point[, options])

Parameters:

Parameter

Default value

Description

element*

Type: HTMLElement|String

A reference to the HTML element that will contain the player, or the ID of this HTML element.

point*

Type: Number[]

The point for searching for nearby panoramas.

options

Type: Object

Options.

options.direction

'auto'

Type: Number[]|String

Direction of view in the format [bearing, pitch], where bearing – is the azimuth of the direction in degrees, pitch – angle of elevation above the horizon in degrees. A special string value auto means that after opening of the panorama, the direction specified in the panorama's metadata will be applied.

options.layer

'yandex#panorama'

Type: String

The layer to search for panoramas. There are two layers available:

  • yandex#panorama - Land panoramas,
  • yandex#airPanorama - Aerial panoramas.

options.span

'auto'

Type: Number[]|String

The angular dimensions of the field of view in the format [horizontalSpan, verticalSpan], where horizontalSpan – the horizontal field size in degrees, verticalSpan – the vertical field size in degrees.

* Mandatory parameter/option.