MMKPanoramaPlayer

@interface MMKPanoramaPlayer : NSObject

Panorama player that is used to open panoramas.

Summary

Instance methods

- (void)openPanoramaWithPanoramaId:(nonnull NSString *)panoramaId;
Opens the panorama with the given ID

- (void)
    openUserPanoramaWithLocalDataSourceWithPanoramaDescription:
        (nonnull MMKPanoramaDescription *)panoramaDescription
                                             tileImageProvider:
                                                 (nonnull id<
                                                     MMKPanoramaTileImageFactory>)
                                                     tileImageProvider
                                             iconImageProvider:
                                                 (nonnull id<
                                                     MMKPanoramaIconImageFactory>)
                                                     iconImageProvider
                                     userPanoramaEventListener:
                                         (nonnull id<
                                             MMKPanoramaUserPanoramaDelegate>)
                                             userPanoramaEventListener;

Opens the panorama from the local datasource

- (void)
    openUserPanoramaWithNetworkDataSourceWithPanoramaDescription:
        (nonnull MMKPanoramaDescription *)panoramaDescription
                                                 tileUrlProvider:
                                                     (nonnull id<
                                                         MMKPanoramaTileUrlProvider>)
                                                         tileUrlProvider
                                                 iconUrlProvider:
                                                     (nonnull id<
                                                         MMKPanoramaIconUrlProvider>)
                                                         iconUrlProvider
                                       userPanoramaEventListener:
                                           (nonnull id<
                                               MMKPanoramaUserPanoramaDelegate>)
                                               userPanoramaEventListener;

Opens the panorama from the network datasource

- (nonnull NSString *)panoramaId;
Opened the panorama with the given ID

- (nonnull MMKPoint *)position;
Geo position of current panorama

- (void)lookAtWithPosition:(nonnull MMKPoint *)position;
Sets the view direction to the center of the given geo position

- (nonnull MMKDirection *)direction;
View direction of the opened panorama

- (void)setDirectionWithDirection:(nonnull MMKDirection *)direction;
Sets the view direction bearing and tilt

- (nonnull MMKSpan *)span;
View span of the opened panorama

- (void)setSpanWithSpan:(nonnull MMKSpan *)span;
Sets the view area span

- (void)reset;
Closes the opened panorama and stops all player actions

- (nonnull NSArray<MMKHistoricalPanorama *> *)historicalPanoramas;

- (void)enableZoom;
Enables player zoom controls

- (void)disableZoom;
Disables player zoom controls

- (BOOL)zoomEnabled;
Checks if zoom controls are enabled

- (void)enableMove;
Shows transition arrows and allows switching panoramas

- (void)disableMove;
Hides transition arrows and disallows switching panoramas

- (BOOL)moveEnabled;
Checks if switching panoramas is enabled

- (void)enableRotation;
Allows the user to rotate panoramas

- (void)disableRotation;
Disallows the user to rotate panoramas

- (BOOL)rotationEnabled;
Checks if player rotation is enabled

- (void)enableMarkers;
Allows markers (house numbers, railway stations, airports) to be shown

- (void)disableMarkers;
Disallows markers (house numbers, railway stations, airports) to be shown

- (BOOL)markersEnabled;
Checks if markers are enabled

- (void)enableCompanies;
Allows companies (company names and icons) to be shown

- (void)disableCompanies;
Disallows companies (company names and icons) to be shown

- (BOOL)companiesEnabled;
Checks if companies are enabled

- (void)addPanoramaChangeListenerWithPanoramaChangeListener:
    (nonnull id<MMKPanoramaChangeDelegate>)panoramaChangeListener;

Adds a panorama change listener

- (void)removePanoramaChangeListenerWithPanoramaChangeListener:
    (nonnull id<MMKPanoramaChangeDelegate>)panoramaChangeListener;

Removes the panorama change listener

- (void)addDirectionChangeListenerWithDirectionChangeListener:
    (nonnull id<MMKPanoramaDirectionChangeDelegate>)directionChangeListener;

Adds direction listener

- (void)removeDirectionChangeListenerWithDirectionChangeListener:
    (nonnull id<MMKPanoramaDirectionChangeDelegate>)directionChangeListener;

Removes the direction listener

- (void)addSpanChangeListenerWithSpanChangeListener:
    (nonnull id<MMKPanoramaSpanChangeDelegate>)spanChangeListener;

Adds span listener

- (void)removeSpanChangeListenerWithSpanChangeListener:
    (nonnull id<MMKPanoramaSpanChangeDelegate>)spanChangeListener;

Removes span listener

- (void)addCompanyTapListenerWithCompanyTapListener:
    (nonnull id<MMKPanoramaCompanyTapDelegate>)companyTapListener;

Adds company tap listener

- (void)removeCompanyTapListenerWithCompanyTapListener:
    (nonnull id<MMKPanoramaCompanyTapDelegate>)companyTapListener;

Removes company tap listener

- (void)addErrorListenerWithErrorListener:
    (nonnull id<MMKPanoramaErrorDelegate>)errorListener;

Adds error listener

- (void)removeErrorListenerWithErrorListener:
    (nonnull id<MMKPanoramaErrorDelegate>)errorListener;

Removes error listener

- (void)enableLoadingWheel;
Allows showing loading wheels

- (void)disableLoadingWheel;
Disallows showing loading wheels

- (BOOL)loadingWheelEnabled;
Checks if loading wheels can be shown while the panorama is opening

- (void)onMemoryWarning;
Called when a memory warning happens

Properties

@property (nonatomic, readonly, nonnull) MMKLogo *logo;
Mappable logo object

@property (nonatomic, readonly, getter=isValid) BOOL valid;
Tells if this object is valid or no

Instance methods

openPanoramaWithPanoramaId:

- (void)openPanoramaWithPanoramaId:(nonnull NSString *)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.


openUserPanoramaWithLocalDataSourceWithPanoramaDescription:tileImageProvider:iconImageProvider:userPanoramaEventListener:

- (void)
    openUserPanoramaWithLocalDataSourceWithPanoramaDescription:
        (nonnull MMKPanoramaDescription *)panoramaDescription
                                             tileImageProvider:
                                                 (nonnull id<
                                                     MMKPanoramaTileImageFactory>)
                                                     tileImageProvider
                                             iconImageProvider:
                                                 (nonnull id<
                                                     MMKPanoramaIconImageFactory>)
                                                     iconImageProvider
                                     userPanoramaEventListener:
                                         (nonnull id<
                                             MMKPanoramaUserPanoramaDelegate>)
                                             userPanoramaEventListener;

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


openUserPanoramaWithNetworkDataSourceWithPanoramaDescription:tileUrlProvider:iconUrlProvider:userPanoramaEventListener:

- (void)
    openUserPanoramaWithNetworkDataSourceWithPanoramaDescription:
        (nonnull MMKPanoramaDescription *)panoramaDescription
                                                 tileUrlProvider:
                                                     (nonnull id<
                                                         MMKPanoramaTileUrlProvider>)
                                                         tileUrlProvider
                                                 iconUrlProvider:
                                                     (nonnull id<
                                                         MMKPanoramaIconUrlProvider>)
                                                         iconUrlProvider
                                       userPanoramaEventListener:
                                           (nonnull id<
                                               MMKPanoramaUserPanoramaDelegate>)
                                               userPanoramaEventListener;

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

- (nonnull NSString *)panoramaId;

Opened the panorama with the given ID.

Returns

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


position

- (nonnull MMKPoint *)position;

Geo position of current panorama.

Returns

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


lookAtWithPosition:

- (void)lookAtWithPosition:(nonnull MMKPoint *)position;

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

Parameters

position

The position to look at.


direction

- (nonnull MMKDirection *)direction;

View direction of the opened panorama.

Returns

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


setDirectionWithDirection:

- (void)setDirectionWithDirection:(nonnull MMKDirection *)direction;

Sets the view direction bearing and tilt.

Parameters

direction

View direction.


span

- (nonnull MMKSpan *)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.


setSpanWithSpan:

- (void)setSpanWithSpan:(nonnull MMKSpan *)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.


reset

- (void)reset;

Closes the opened panorama and stops all player actions.


historicalPanoramas

- (nonnull NSArray<MMKHistoricalPanorama *> *)historicalPanoramas;

Returns

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


enableZoom

- (void)enableZoom;

Enables player zoom controls.


disableZoom

- (void)disableZoom;

Disables player zoom controls.


zoomEnabled

- (BOOL)zoomEnabled;

Checks if zoom controls are enabled.


enableMove

- (void)enableMove;

Shows transition arrows and allows switching panoramas.


disableMove

- (void)disableMove;

Hides transition arrows and disallows switching panoramas.


moveEnabled

- (BOOL)moveEnabled;

Checks if switching panoramas is enabled.


enableRotation

- (void)enableRotation;

Allows the user to rotate panoramas.


disableRotation

- (void)disableRotation;

Disallows the user to rotate panoramas.


rotationEnabled

- (BOOL)rotationEnabled;

Checks if player rotation is enabled.


enableMarkers

- (void)enableMarkers;

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


disableMarkers

- (void)disableMarkers;

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


markersEnabled

- (BOOL)markersEnabled;

Checks if markers are enabled.


enableCompanies

- (void)enableCompanies;

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


disableCompanies

- (void)disableCompanies;

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


companiesEnabled

- (BOOL)companiesEnabled;

Checks if companies are enabled.


addPanoramaChangeListenerWithPanoramaChangeListener:

- (void)addPanoramaChangeListenerWithPanoramaChangeListener:
    (nonnull id<MMKPanoramaChangeDelegate>)panoramaChangeListener;

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.


removePanoramaChangeListenerWithPanoramaChangeListener:

- (void)removePanoramaChangeListenerWithPanoramaChangeListener:
    (nonnull id<MMKPanoramaChangeDelegate>)panoramaChangeListener;

Removes the panorama change listener.

Parameters

panoramaChangeListener

The panorama change listener to remove.


addDirectionChangeListenerWithDirectionChangeListener:

- (void)addDirectionChangeListenerWithDirectionChangeListener:
    (nonnull id<MMKPanoramaDirectionChangeDelegate>)directionChangeListener;

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.


removeDirectionChangeListenerWithDirectionChangeListener:

- (void)removeDirectionChangeListenerWithDirectionChangeListener:
    (nonnull id<MMKPanoramaDirectionChangeDelegate>)directionChangeListener;

Removes the direction listener.

Parameters

directionChangeListener

The panorama direction listener to remove.


addSpanChangeListenerWithSpanChangeListener:

- (void)addSpanChangeListenerWithSpanChangeListener:
    (nonnull id<MMKPanoramaSpanChangeDelegate>)spanChangeListener;

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.


removeSpanChangeListenerWithSpanChangeListener:

- (void)removeSpanChangeListenerWithSpanChangeListener:
    (nonnull id<MMKPanoramaSpanChangeDelegate>)spanChangeListener;

Removes span listener.

Parameters

spanChangeListener

The span listener to remove.


addCompanyTapListenerWithCompanyTapListener:

- (void)addCompanyTapListenerWithCompanyTapListener:
    (nonnull id<MMKPanoramaCompanyTapDelegate>)companyTapListener;

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.


removeCompanyTapListenerWithCompanyTapListener:

- (void)removeCompanyTapListenerWithCompanyTapListener:
    (nonnull id<MMKPanoramaCompanyTapDelegate>)companyTapListener;

Removes company tap listener.

Parameters

companyTapListener

The company tap listener to remove.


addErrorListenerWithErrorListener:

- (void)addErrorListenerWithErrorListener:
    (nonnull id<MMKPanoramaErrorDelegate>)errorListener;

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:

- (void)removeErrorListenerWithErrorListener:
    (nonnull id<MMKPanoramaErrorDelegate>)errorListener;

Removes error listener.

Parameters

errorListener

The listener to remove.


enableLoadingWheel

- (void)enableLoadingWheel;

Allows showing loading wheels.


disableLoadingWheel

- (void)disableLoadingWheel;

Disallows showing loading wheels.


loadingWheelEnabled

- (BOOL)loadingWheelEnabled;

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


onMemoryWarning

- (void)onMemoryWarning;

Called when a memory warning happens.


Properties

@property (nonatomic, readonly, nonnull) MMKLogo *logo;

Mappable logo object.


valid

@property (nonatomic, readonly, getter=isValid) BOOL valid;

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.