panorama.Base.createPanorama

Static function.

Returns panorama instance.

{ IPanorama } panorama.Base.createPanorama(params)

Parameters:

Parameter

Default value

Description

params*

Type: Object

Panorama parameters.

params.angularBBox*

Type: Number[]

Angular

params.coordSystem

Type: ICoordSystem

Coordinate system that the panorama position is set in. By default, it uses coordSystem.geo.

params.name

''

Type: String

Name of the panorama.

params.position*

Type: Number[]

The position of the panorama.

params.tileLevels*

Type: IPanoramaTileLevel[]

Array of panorama image detail levels.

params.tileSize*

Type: Number[]

Size of the panorama image tiles.

* Mandatory parameter/option.

Example:

var player = new ymaps.panorama.Player(
    'player',
    ymaps.panorama.Base.createPanorama({
        coordSystem: ymaps.coordSystem.cartesian,
        // Let's put our panorama in the center of the coordinate system.
        position: [0, 0],
        name: 'My panorama',
        // We'll make our panorama fully spherical.
        angularBBox: [0.5 * Math.PI, 2 * Math.PI, -0.5 * Math.PI, 0],
        tileSize: [512, 512],
        tileLevels: [{
            getTileUrl: function (x, y) {
                return '/' + x + '/' + y + '.jpg';
           },

            getImageSize: function () {
                return [4096, 2048];
            }
        }]
    })
);