panorama.Base

Extends IPanorama.

Constructor | Methods

Constructor

panorama.Base()

Initializes the panorama with default parameters.

Example:

function Panorama () {
    ymaps.panorama.Base.call(this);
    // Making sure that everything is all right with our panorama.
    this.validate();
}

ymaps.util.defineClass(Panorama, ymaps.panorama.Base, {
    getPosition: function () {
        // Let's put our panorama at the center of the coordinate system.
        return [0, 0, 0];
    },

    getCoordSystem: function () {
        return ymaps.coordSystem.cartesian;
    },

    getAngularBBox: function () {
        // We'll make our panorama fully spherical.
        return [0.5 * Math.PI, 2 * Math.PI, -0.5 * Math.PI, 0];
    },

    getTileSize: function () {
        return [512, 512];
    },

    getTileLevels: function () {
        // Our panorama will have just one image.
        return [{
            getTileUrl: function (x, y) {
                return '/' + x + '/' + y + '.jpg';
            },

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

Methods

Name

Returns

Description

getAngularBBox()

Overriding this method is required.

getConnectionArrows()

IPanoramaConnectionArrow[]

Returns an empty array, as if the panorama doesn't have any connection arrows.

getConnectionMarkers()

IPanoramaConnectionMarker[]

Returns an empty array, as if the panorama doesn't have any connection markers.

getConnections()

IPanoramaConnectionMarker[]

Alert

This method is deprecated.

This method is deprecated. Override panorama.Base.getConnectionMarkers.

getCoordSystem()

ICoordSystem

Returns the geographical coordinate system.

getDefaultDirection()

Number[]

Returns the direction of "north" to the horizon.

getDefaultSpan()

Number[]

Returns the field of view is 130 by 80 degrees in radians.

getGraph()

null

Returns null, as if there aren't any quick transitions for the panorama graph.

getMarkers()

IPanoramaMarker[]

Returns an empty array, as if the panorama doesn't have any markers.

getName()

String

Returns empty string.

getPosition()

Overriding this method is required.

getThoroughfares()

IPanoramaConnectionArrow[]

Warning

This method is deprecated.

This method is deprecated. Override panorama.Base.getConnectionArrows.

getTileLevels()

Overriding this method is required.

getTileSize()

Overriding this method is required.

validate()

Checks the consistency and validity of data returned by methods of the panorama object. Conditions that this method verifies:

  • positions of all objects have three components (including height);
  • the tile size must be a power of two (for example, 128, 256, or 512 pixels);
  • the panorama is a full circle (i.e. the width of the angular area must be 2π);
  • each zoom level for the panorama image contains an integral number of tiles horizontally (this isn't required vertically).
    If calling this method generates an error for the panorama object, we cannot guarantee the stability of the panorama player with this panorama.

Methods details

getAngularBBox

{} getAngularBBox()

Overriding this method is required.

getConnectionArrows

{IPanoramaConnectionArrow[]} getConnectionArrows()

Returns an empty array, as if the panorama doesn't have any connection arrows.

getConnectionMarkers

{IPanoramaConnectionMarker[]} getConnectionMarkers()

Returns an empty array, as if the panorama doesn't have any connection markers.

getConnections

{IPanoramaConnectionMarker[]} getConnections()

This method is deprecated. Override panorama.Base.getConnectionMarkers.

**This method is deprecated. **

Returns an empty array, as if the panorama doesn't have any connections.

getCoordSystem

{ICoordSystem} getCoordSystem()

Returns the geographical coordinate system.

getDefaultDirection

{Number[]} getDefaultDirection()

Returns the direction of "north" to the horizon.

getDefaultSpan

{Number[]} getDefaultSpan()

Returns the field of view is 130 by 80 degrees in radians.

getGraph

{null} getGraph()

Returnsnull, as if there aren't any quick transitions for the panorama graph.

getMarkers

{IPanoramaMarker[]} getMarkers()

Returns an empty array, as if the panorama doesn't have any markers.

getName

{String} getName()

Returns empty string.

getPosition

{} getPosition()

Overriding this method is required.

getThoroughfares

{IPanoramaConnectionArrow[]} getThoroughfares()

This method is deprecated. Override panorama.Base.getConnectionArrows.

**This method is deprecated. **

Returns an empty array, as if the panorama doesn't have any transitions.

getTileLevels

{} getTileLevels()

Overriding this method is required.

getTileSize

{} getTileSize()

Overriding this method is required.

validate

{} validate()

Checks the consistency and validity of data returned by methods of the panorama object. Conditions that this method verifies:

  • positions of all objects have three components (including height);
  • the tile size must be a power of two (for example, 128, 256, or 512 pixels);
  • the panorama is a full circle (i.e. the width of the angular area must be 2π);
  • each zoom level for the panorama image contains an integral number of tiles horizontally (this isn't required vertically).
    If calling this method generates an error for the panorama object, we cannot guarantee the stability of the panorama player with this panorama.