---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/panorama.createPlayer.md
  - https://yandex.com/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/panorama.createPlayer.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/jsapi-v2-1/doc/en/llms.txt

# 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](https://yandex.com/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/panorama.Player.md) or rejected with the error description.

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

**Parameters:**

#|
|| **Parameter** | **Default value** | **Description**  ||
|| [`element`](#param-element)[*](*star) | — | Type: HTMLElement\|String

A reference to the HTML element that will contain the player, or the ID of this HTML element. ||
|| [`point`](#param-point)[*](*star) | — | Type: Number[]

The point for searching for nearby panoramas. ||
|| [`options`](#param-options) | — | Type: Object

Options. ||
|| [`options.direction`](#param-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`](#param-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`](#param-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.

[*star]: Mandatory parameter/option.