Version:
Popular examples
Map
Geo objects
Balloon and hint
Controls
Hotspots
Clustering
GeoQuery
Behaviors and events
Search on a map
Traffic
User's location
Routing
YMapsML
GeoXML
ObjectManager
Modular system
Panoramas
External modules

Creating connections between custom panoramas

Save as filesEdit on JSFiddle

The API allows you to connect created panoramas to each other and add interactive elements to switch between them. These elements can be standard connection arrows, or special connection markers. You can add an unlimited number of connection elements to the same panorama.

To add a standard connection arrow to a panorama, redefine the getConnectionArrows method in the panorama class. It should return an array of class instances describing the connection from one panorama to another (in the example, this is the ConnectionArrows class). This class must specify the panorama to switch to and the viewing direction for this panorama. Note that you can't change display options for the arrows.

To add a standard transition arrow to a panorama, redefine the getThoroughfares method in the panorama class. It should return an array of class instances describing the transition from one panorama to another (in the example, this is the Thoroughfares class). This class must specify the panorama to transition to and the viewing direction for this panorama. Note that you can't change display options for the arrows.

Note that when adding a connection from one panorama to another, the reverse connection isn't created automatically, and you need to create it yourself.

In this example, we created two custom panoramas and added connections between them using standard arrows. On the first panorama (the one that is displayed when opening the example), we added a marker that connects to a Yandex panorama when clicked. Note that the reverse direction (i.e. switching from the Yandex panorama to the custom panorama) is not possible.

Пишете на JavaScript? У нас есть вакансии
Mon Oct 31 2022 13:07:25 GMT+0300 (Moscow Standard Time)