Interface Player

com.yandex.mapkit.places.panorama

public interface Player

Panorama player that is used to open panoramas.

Methods

void addDirectionChangeListener(@NonNull DirectionChangeListener directionChangeListener)

Adds direction listener.

void addErrorListener(@NonNull ErrorListener errorListener)

Adds error listener.

void addPanoramaChangeListener(@NonNull PanoramaChangeListener panoramaChangeListener)

Adds a panorama change listener.

void addSpanChangeListener(@NonNull SpanChangeListener spanChangeListener)

Adds span listener.

Direction direction()

View direction of the opened panorama.

void disableLoadingWheel()

Disallows showing loading wheels.

void disableMarkers()

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

void disableMove()

Hides transition arrows and disallows switching panoramas.

void disableRotation()

Disallows the user to rotate panoramas.

void disableZoom()

Disables player zoom controls.

void enableLoadingWheel()

Allows showing loading wheels.

void enableMarkers()

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

void enableMove()

Shows transition arrows and allows switching panoramas.

void enableRotation()

Allows the user to rotate panoramas.

void enableZoom()

Enables player zoom controls.

Logo getLogo()

Yandex logo object.

List< HistoricalPanorama > historicalPanoramas()
boolean isValid()

Tells if this Player is valid or no.

boolean loadingWheelEnabled()

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

void lookAt(@NonNull Point position)

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

boolean markersEnabled()

Checks if markers are enabled.

boolean moveEnabled()

Checks if switching panoramas is enabled.

void onMemoryWarning()

Called when a memory warning happens.

void openPanorama(@NonNull String panoramaId)

Opens the panorama with the given ID.

String panoramaId()

Opened the panorama with the given ID.

Point position()

Geo position of current panorama.

void removeDirectionChangeListener(@NonNull DirectionChangeListener directionChangeListener)

Removes the direction listener.

void removeErrorListener(@NonNull ErrorListener errorListener)

Removes error listener.

void removePanoramaChangeListener(@NonNull PanoramaChangeListener panoramaChangeListener)

Removes the panorama change listener.

void removeSpanChangeListener(@NonNull SpanChangeListener spanChangeListener)

Removes span listener.

void reset()

Closes the opened panorama and stops all player actions.

boolean rotationEnabled()

Checks if player rotation is enabled.

void setDirection(@NonNull Direction direction)

Sets the view direction bearing and tilt.

void setSpan(@NonNull Span span)

Sets the view area span.

Span span()

View span of the opened panorama.

boolean zoomEnabled()

Checks if zoom controls are enabled.

Method Detail

addDirectionChangeListener

public void addDirectionChangeListener (@NonNull DirectionChangeListener directionChangeListener)

Adds direction listener.

Parameters:
directionChangeListener

Panorama direction listener.

addErrorListener

public void addErrorListener (@NonNull ErrorListener errorListener)

Adds error listener.

Parameters:
errorListener

Listeners that notify when a panorama failed to open.

addPanoramaChangeListener

public void addPanoramaChangeListener (@NonNull PanoramaChangeListener panoramaChangeListener)

Adds a panorama change listener.

Parameters:
panoramaChangeListener

Panorama change listener.

addSpanChangeListener

public void addSpanChangeListener (@NonNull SpanChangeListener spanChangeListener)

Adds span listener.

Parameters:
spanChangeListener

Panorama span listener.

direction

public Direction direction ()

View direction of the opened panorama.

Returns:

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

disableLoadingWheel

public void disableLoadingWheel ()

Disallows showing loading wheels.

disableMarkers

public void disableMarkers ()

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

disableMove

public void disableMove ()

Hides transition arrows and disallows switching panoramas.

disableRotation

public void disableRotation ()

Disallows the user to rotate panoramas.

disableZoom

public void disableZoom ()

Disables player zoom controls.

enableLoadingWheel

public void enableLoadingWheel ()

Allows showing loading wheels.

enableMarkers

public void enableMarkers ()

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

enableMove

public void enableMove ()

Shows transition arrows and allows switching panoramas.

enableRotation

public void enableRotation ()

Allows the user to rotate panoramas.

enableZoom

public void enableZoom ()

Enables player zoom controls.

historicalPanoramas

public List< HistoricalPanorama > historicalPanoramas ()

Returns:

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

isValid

public boolean isValid ()

Tells if this Player is valid or no.

Any other method (except for this one) called on an invalid Player will throw java.lang.RuntimeException. An instance 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.

loadingWheelEnabled

public boolean loadingWheelEnabled ()

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

lookAt

public void lookAt (@NonNull Point position)

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

Parameters:
position

The position to look at.

markersEnabled

public boolean markersEnabled ()

Checks if markers are enabled.

moveEnabled

public boolean moveEnabled ()

Checks if switching panoramas is enabled.

onMemoryWarning

public void onMemoryWarning ()

Called when a memory warning happens.

openPanorama

public void openPanorama (@NonNull String panoramaId)

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.

panoramaId

public String panoramaId ()

Opened the panorama with the given ID.

Returns:

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

position

public Point position ()

Geo position of current panorama.

Returns:

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

removeDirectionChangeListener

public void removeDirectionChangeListener (@NonNull DirectionChangeListener directionChangeListener)

Removes the direction listener.

Parameters:
directionChangeListener

The panorama direction listener to remove.

removeErrorListener

public void removeErrorListener (@NonNull ErrorListener errorListener)

Removes error listener.

Parameters:
errorListener

The listener to remove.

removePanoramaChangeListener

public void removePanoramaChangeListener (@NonNull PanoramaChangeListener panoramaChangeListener)

Removes the panorama change listener.

Parameters:
panoramaChangeListener

The panorama change listener to remove.

removeSpanChangeListener

public void removeSpanChangeListener (@NonNull SpanChangeListener spanChangeListener)

Removes span listener.

Parameters:
spanChangeListener

The span listener to remove.

reset

public void reset ()

Closes the opened panorama and stops all player actions.

rotationEnabled

public boolean rotationEnabled ()

Checks if player rotation is enabled.

setDirection

public void setDirection (@NonNull Direction direction)

Sets the view direction bearing and tilt.

Parameters:
direction

View direction.

setSpan

public void setSpan (@NonNull Span span)

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.

span

public Span span ()

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.

zoomEnabled

public boolean zoomEnabled ()

Checks if zoom controls are enabled.