Warning

This feature is available in the Full MapKit SDK version

YMKPanoramaPlayer

class YMKPanoramaPlayer : NSObject

Panorama player that is used to open panoramas.

Summary

Instance methods

func openPanorama(withPanoramaId panoramaId: String)
Opens the panorama with the given ID

func openUserPanoramaWithLocalDataSource(with panoramaDescription: YMKPanoramaDescription,
                                                tileImageProvider: YMKPanoramaTileImageFactory,
                                                iconImageProvider: YMKPanoramaIconImageFactory,
                                        userPanoramaEventListener: YMKPanoramaUserPanoramaDelegate)
Opens the panorama from the local datasource

func openUserPanoramaWithNetworkDataSource(with panoramaDescription: YMKPanoramaDescription,
                                                    tileUrlProvider: YMKPanoramaTileUrlProvider,
                                                    iconUrlProvider: YMKPanoramaIconUrlProvider,
                                          userPanoramaEventListener: YMKPanoramaUserPanoramaDelegate)
Opens the panorama from the network datasource

func panoramaId() -> String
Opened the panorama with the given ID

func position() -> YMKPoint
Geo position of current panorama

func lookAt(withPosition position: YMKPoint)
Sets the view direction to the center of the given geo position

func direction() -> YMKDirection
View direction of the opened panorama

func setDirectionWith( direction: YMKDirection_)
Sets the view direction bearing and tilt

func span() -> YMKSpan
View span of the opened panorama

func setSpanWith( span: YMKSpan_)
Sets the view area span

func reset()
Closes the opened panorama and stops all player actions

func historicalPanoramas() -> [YMKHistoricalPanorama]

func enableZoom()
Enables player zoom controls

func disableZoom()
Disables player zoom controls

func zoomEnabled() -> Bool
Checks if zoom controls are enabled

func enableMove()
Shows transition arrows and allows switching panoramas

func disableMove()
Hides transition arrows and disallows switching panoramas

func moveEnabled() -> Bool
Checks if switching panoramas is enabled

func enableRotation()
Allows the user to rotate panoramas

func disableRotation()
Disallows the user to rotate panoramas

func rotationEnabled() -> Bool
Checks if player rotation is enabled

func enableMarkers()
Allows markers (house numbers, railway stations, airports) to be shown

func disableMarkers()
Disallows markers (house numbers, railway stations, airports) to be shown

func markersEnabled() -> Bool
Checks if markers are enabled

func enableCompanies()
Allows companies (company names and icons) to be shown

func disableCompanies()
Disallows companies (company names and icons) to be shown

func companiesEnabled() -> Bool
Checks if companies are enabled

func addPanoramaChangeListener(withPanoramaChangeListener panoramaChangeListener: YMKPanoramaChangeDelegate)
Adds a panorama change listener

func removePanoramaChangeListener(withPanoramaChangeListener panoramaChangeListener: YMKPanoramaChangeDelegate)
Removes the panorama change listener

func addDirectionChangeListener(withDirectionChangeListener directionChangeListener: YMKPanoramaDirectionChangeDelegate)
Adds direction listener

func removeDirectionChangeListener(withDirectionChangeListener directionChangeListener: YMKPanoramaDirectionChangeDelegate)
Removes the direction listener

func addSpanChangeListener(withSpanChangeListener spanChangeListener: YMKPanoramaSpanChangeDelegate)
Adds span listener

func removeSpanChangeListener(withSpanChangeListener spanChangeListener: YMKPanoramaSpanChangeDelegate)
Removes span listener

func addCompanyTapListener(withCompanyTapListener companyTapListener: YMKPanoramaCompanyTapDelegate)
Adds company tap listener

func removeCompanyTapListener(withCompanyTapListener companyTapListener: YMKPanoramaCompanyTapDelegate)
Removes company tap listener

func addErrorListenerWithErrorListener( errorListener: YMKPanoramaErrorDelegate_)
Adds error listener

func removeErrorListenerWithErrorListener( errorListener: YMKPanoramaErrorDelegate_)
Removes error listener

func enableLoadingWheel()
Allows showing loading wheels

func disableLoadingWheel()
Disallows showing loading wheels

func loadingWheelEnabled() -> Bool
Checks if loading wheels can be shown while the panorama is opening

func onMemoryWarning()
Called when a memory warning happens

Properties

var logoYMKLogo { get }
Yandex logo object

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

openPanorama(withPanoramaId:)

func openPanorama(withPanoramaId panoramaId: String)

Opens the panorama with the given ID.

Parameters

panoramaId

The panoramaId that specifies the panorama to open. You can get the panoramaId by using the PanoramaService methods.


openUserPanoramaWithLocalDataSource(with:tileImageProvider:iconImageProvider:userPanoramaEventListener:)

func openUserPanoramaWithLocalDataSource(with panoramaDescription: YMKPanoramaDescription,
                                                tileImageProvider: YMKPanoramaTileImageFactory,
                                                iconImageProvider: YMKPanoramaIconImageFactory,
                                        userPanoramaEventListener: YMKPanoramaUserPanoramaDelegate)

Opens the panorama from the local datasource.

The class maintains a strong reference to the object in the 'tileImageProvider' parameter until it (the class) is invalidated.

The class maintains a strong reference to the object in the 'iconImageProvider' parameter until it (the class) is invalidated.

The class does not retain the object in the 'userPanoramaEventListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

panoramaDescription

Initialize this struct to open panorama

tileImageProvider

The tile datasource

iconImageProvider

The icon datasource

userPanoramaEventListener

The user panorama notification listener


openUserPanoramaWithNetworkDataSource(with:tileUrlProvider:iconUrlProvider:userPanoramaEventListener:)

func openUserPanoramaWithNetworkDataSource(with panoramaDescription: YMKPanoramaDescription,
                                                    tileUrlProvider: YMKPanoramaTileUrlProvider,
                                                    iconUrlProvider: YMKPanoramaIconUrlProvider,
                                          userPanoramaEventListener: YMKPanoramaUserPanoramaDelegate)

Opens the panorama from the network datasource.

The class maintains a strong reference to the object in the 'tileUrlProvider' parameter until it (the class) is invalidated.

The class maintains a strong reference to the object in the 'iconUrlProvider' parameter until it (the class) is invalidated.

The class does not retain the object in the 'userPanoramaEventListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

panoramaDescription

Initialize this struct to open panorama

tileUrlProvider

The network tile datasource

iconUrlProvider

The netwokr icon datasource

userPanoramaEventListener

The user panorama notification listener


panoramaId()

func panoramaId() -> String

Opened the panorama with the given ID.

Returns

PanoramaId of the currently opened panorama. Empty if no
panorama is open.


position()

func position() -> YMKPoint

Geo position of current panorama.

Returns

Geo position of the currently opened panorama. Empty if no
panorama is open.


lookAt(withPosition:)

func lookAt(withPosition position: YMKPoint)

Sets the view direction to the center of the given geo position.

Parameters

position

The position to look at.


direction()

func direction() -> YMKDirection

View direction of the opened panorama.

Returns

View direction of the opened panorama. Empty if no panorama
is open.


setDirectionWith(_:)

func setDirectionWith( direction: YMKDirection_)

Sets the view direction bearing and tilt.

Parameters

direction

View direction.


span()

func span() -> YMKSpan

View span of the opened panorama.

Returns

Current view span of the opened panorama. May be different
from the span provided by the setSpan(span) method.


setSpanWith(_:)

func setSpanWith( span: YMKSpan_)

Sets the view area span. Invalid values are adjusted by the player to the closest valid values.

Parameters

span

View area span. May be adjusted by the player.


reset()

func reset()

Closes the opened panorama and stops all player actions.


historicalPanoramas()

func historicalPanoramas() -> [YMKHistoricalPanorama]

Returns

panoramas published earlier at the current panorama position.
Result is updated on the YMKPanoramaChangeDelegate callback


enableZoom()

func enableZoom()

Enables player zoom controls.


disableZoom()

func disableZoom()

Disables player zoom controls.


zoomEnabled()

func zoomEnabled() -> Bool

Checks if zoom controls are enabled.


enableMove()

func enableMove()

Shows transition arrows and allows switching panoramas.


disableMove()

func disableMove()

Hides transition arrows and disallows switching panoramas.


moveEnabled()

func moveEnabled() -> Bool

Checks if switching panoramas is enabled.


enableRotation()

func enableRotation()

Allows the user to rotate panoramas.


disableRotation()

func disableRotation()

Disallows the user to rotate panoramas.


rotationEnabled()

func rotationEnabled() -> Bool

Checks if player rotation is enabled.


enableMarkers()

func enableMarkers()

Allows markers (house numbers, railway stations, airports) to be shown.


disableMarkers()

func disableMarkers()

Disallows markers (house numbers, railway stations, airports) to be shown.


markersEnabled()

func markersEnabled() -> Bool

Checks if markers are enabled.


enableCompanies()

func enableCompanies()

Allows companies (company names and icons) to be shown.


disableCompanies()

func disableCompanies()

Disallows companies (company names and icons) to be shown.


companiesEnabled()

func companiesEnabled() -> Bool

Checks if companies are enabled.


addPanoramaChangeListener(withPanoramaChangeListener:)

func addPanoramaChangeListener(withPanoramaChangeListener panoramaChangeListener: YMKPanoramaChangeDelegate)

Adds a panorama change listener.

The class does not retain the object in the 'panoramaChangeListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

panoramaChangeListener

Panorama change listener.


removePanoramaChangeListener(withPanoramaChangeListener:)

func removePanoramaChangeListener(withPanoramaChangeListener panoramaChangeListener: YMKPanoramaChangeDelegate)

Removes the panorama change listener.

Parameters

panoramaChangeListener

The panorama change listener to remove.


addDirectionChangeListener(withDirectionChangeListener:)

func addDirectionChangeListener(withDirectionChangeListener directionChangeListener: YMKPanoramaDirectionChangeDelegate)

Adds direction listener.

The class does not retain the object in the 'directionChangeListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

directionChangeListener

Panorama direction listener.


removeDirectionChangeListener(withDirectionChangeListener:)

func removeDirectionChangeListener(withDirectionChangeListener directionChangeListener: YMKPanoramaDirectionChangeDelegate)

Removes the direction listener.

Parameters

directionChangeListener

The panorama direction listener to remove.


addSpanChangeListener(withSpanChangeListener:)

func addSpanChangeListener(withSpanChangeListener spanChangeListener: YMKPanoramaSpanChangeDelegate)

Adds span listener.

The class does not retain the object in the 'spanChangeListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

spanChangeListener

Panorama span listener.


removeSpanChangeListener(withSpanChangeListener:)

func removeSpanChangeListener(withSpanChangeListener spanChangeListener: YMKPanoramaSpanChangeDelegate)

Removes span listener.

Parameters

spanChangeListener

The span listener to remove.


addCompanyTapListener(withCompanyTapListener:)

func addCompanyTapListener(withCompanyTapListener companyTapListener: YMKPanoramaCompanyTapDelegate)

Adds company tap listener.

The class does not retain the object in the 'companyTapListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

companyTapListener

Company tap listener.


removeCompanyTapListener(withCompanyTapListener:)

func removeCompanyTapListener(withCompanyTapListener companyTapListener: YMKPanoramaCompanyTapDelegate)

Removes company tap listener.

Parameters

companyTapListener

The company tap listener to remove.


addErrorListenerWithErrorListener(_:)

func addErrorListenerWithErrorListener( errorListener: YMKPanoramaErrorDelegate_)

Adds error listener.

The class does not retain the object in the 'errorListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.

Parameters

errorListener

Listeners that notify when a panorama failed to open.


removeErrorListenerWithErrorListener(_:)

func removeErrorListenerWithErrorListener( errorListener: YMKPanoramaErrorDelegate_)

Removes error listener.

Parameters

errorListener

The listener to remove.


enableLoadingWheel()

func enableLoadingWheel()

Allows showing loading wheels.


disableLoadingWheel()

func disableLoadingWheel()

Disallows showing loading wheels.


loadingWheelEnabled()

func loadingWheelEnabled() -> Bool

Checks if loading wheels can be shown while the panorama is opening.


onMemoryWarning()

func onMemoryWarning()

Called when a memory warning happens.


Properties

var logo: YMKLogo { get }

Yandex logo object.


isValid

var isValid: Bool { get }

Tells if this object is valid or no. Any method called on an invalid object will throw an exception. The object becomes invalid only on UI thread, and only when its implementation depends on objects already destroyed by now. Please refer to general docs about the interface for details on its invalidation.