YMKMap

@interface YMKMap : NSObject

The object that is used to interact with the map.

Summary

Instance methods

- (nonnull YMKCameraPosition *)cameraPositionWithGeometry:
    (nonnull YMKGeometry *)geometry;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and { tilt} camera parameters || || ##- (nonnull _[YMKCameraPosition](./YMKCameraPosition.md)_ \*)     [cameraPositionWithGeometry](#camerapositionwithgeometryfocusrect):(nonnull _[YMKGeometry](./YMKGeometry.md)_ \*)geometry                      focusRect:(nullable _[YMKScreenRect](./YMKScreenRect.md)_ \*)focusRect;## Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and { tilt} camera parameters

- (nonnull YMKCameraPosition *)
    cameraPositionWithGeometry:(nonnull YMKGeometry *)geometry
                     focusRect:(nullable YMKScreenRect *)focusRect
                       azimuth:(nullable NSNumber *)azimuth;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and { tilt} camera parameters || || ##- (nonnull _[YMKCameraPosition](./YMKCameraPosition.md)_ \*)     [cameraPositionWithGeometry](#camerapositionwithgeometryfocusrectazimuthtilt):(nonnull _[YMKGeometry](./YMKGeometry.md)_ \*)geometry                      focusRect:(nullable _[YMKScreenRect](./YMKScreenRect.md)_ \*)focusRect                        azimuth:(nullable NSNumber \*)azimuth                           tilt:(nullable NSNumber \*)tilt;## Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and { tilt} camera parameters

- (nonnull YMKVisibleRegion *)visibleRegionWithCameraPosition:
    (nonnull YMKCameraPosition *)cameraPosition;

- (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition;
Changes the camera position

- (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition
                     animation:(nullable YMKAnimation *)animation;

Changes the camera position

- (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition
                     animation:(nullable YMKAnimation *)animation
                cameraCallback:(nullable YMKMapCameraCallback)cameraCallback;

Changes the camera position

- (void)addInputListenerWithInputListener:
    (nonnull id<YMKMapInputListener>)inputListener;

Adds input listeners

- (void)removeInputListenerWithInputListener:
    (nonnull id<YMKMapInputListener>)inputListener;

Removes input listeners

- (void)addCameraListenerWithCameraListener:
    (nonnull id<YMKMapCameraListener>)cameraListener;

Adds camera listeners

- (void)removeCameraListenerWithCameraListener:
    (nonnull id<YMKMapCameraListener>)cameraListener;

Removes camera listeners

- (void)setMapLoadedListenerWithMapLoadedListener:
    (nullable id<YMKMapLoadedListener>)mapLoadedListener;

Sets a map loaded listener

- (void)addTapListenerWithTapListener:
    (nonnull id<YMKLayersGeoObjectTapListener>)tapListener;

Adds a tap listener that is used to obtain brief geo object info

- (void)removeTapListenerWithTapListener:
    (nonnull id<YMKLayersGeoObjectTapListener>)tapListener;

Removes a tap listener that is used to obtain brief geo object info

- (void)deselectGeoObject;
Resets the currently selected geo object

- (void)selectGeoObjectWithSelectionMetaData:
    (nonnull YMKGeoObjectSelectionMetadata *)selectionMetaData;

Selects a geo object with the specified objectId in the specified layerId

- (void)addIndoorStateListenerWithIndoorStateListener:
    (nonnull id<YMKIndoorStateListener>)indoorStateListener;

Subscribe to indoor state change events

- (void)removeIndoorStateListenerWithIndoorStateListener:
    (nonnull id<YMKIndoorStateListener>)indoorStateListener;

Unsubscribe from indoor state change events

- (BOOL)setMapStyleWithStyle:(nonnull NSString *)style;
Applies JSON style transformations to the map

- (BOOL)setMapStyleWithId:(NSInteger)id style:(nonnull NSString *)style;
Applies JSON style transformations to the map

- (void)resetMapStyles;
Resets all JSON style transformations applied to the map

- (void)set2DModeWithEnable:(BOOL)enable;
Forces the map to be flat

- (nonnull YMKRootMapObjectCollection *)addMapObjectLayerWithLayerId:
    (nonnull NSString *)layerId;

Creates a new independent map object collection linked to the specified layer ID

- (nonnull YMKProjection *)projection;
Provides map projection

- (void)wipe;
Erases tiles, caches, etc

- (nonnull YMKLayer *)
    addTileLayerWithLayerId:(nonnull NSString *)layerId
               layerOptions:(nonnull YMKLayerOptions *)layerOptions
       createTileDataSource:
           (nonnull YMKCreateTileDataSource)createTileDataSource;

Adds tile layer

Properties

@property (nonatomic, readonly, nonnull) YMKCameraPosition *cameraPosition;

@property (nonatomic, readonly, nonnull) YMKVisibleRegion *visibleRegion;

@property (nonatomic, readonly, nonnull) YMKCameraBounds *cameraBounds;

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isNightModeEnabled) BOOL nightModeEnabled;

If enabled, night mode will reduce map brightness and improve contrast

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isZoomGesturesEnabled) BOOL zoomGesturesEnabled;

Enable/disable zoom gestures, for example: - pinch - double tap (zoom in) - tap with two fingers (zoom out)

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isScrollGesturesEnabled) BOOL scrollGesturesEnabled;

Enable/disable scroll gestures, such as the pan gesture

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isTiltGesturesEnabled) BOOL tiltGesturesEnabled;

Enable/disable tilt gestures, such as parallel pan with two fingers

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isRotateGesturesEnabled) BOOL rotateGesturesEnabled;

Enable/disable rotation gestures, such as rotation with two fingers

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isFastTapEnabled) BOOL fastTapEnabled;

Removes the 300 ms delay in emitting a tap gesture

@property (nonatomic, assign, unsafe_unretained, readwrite) YMKMapType mapType;
Sets the base map type

@property (nonatomic, readonly, nonnull) YMKRootMapObjectCollection *mapObjects;

@property (nonatomic, readonly, nonnull) YMKLogo *logo;
Yandex logo object

@property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
    NSNumber *poiLimit;

Limits the number of visible basemap POIs

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isIndoorEnabled) BOOL indoorEnabled;

Enables/disables indoor plans on the map

@property (nonatomic, assign, unsafe_unretained, readwrite) YMKMapMode mode;
Selects one of predefined map style modes optimized for particular use case(transit, driving, etc)

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isHdModeEnabled) BOOL hdModeEnabled;

Enables hd mode of displayed content

@property (nonatomic, assign, unsafe_unretained, readwrite,
          getter=isAwesomeModelsEnabled) BOOL awesomeModelsEnabled;

Enables rich textured 3d content on basemap

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

Instance methods

cameraPositionWithGeometry:

- (nonnull YMKCameraPosition *)cameraPositionWithGeometry:
    (nonnull YMKGeometry *)geometry;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and {``` tilt} camera parameters.

If {``` focusRect} is not provided, the current focus rect is used (or the full view if no focus rect is set).

If {``` azimuth} is not provided, the current {``` cameraPosition.azimuth} is used.

If {``` tilt} is not provided, the current {``` cameraPosition.tilt} is used.

- returns: The computed camera position.

cameraPositionWithGeometry:focusRect:

- (nonnull YMKCameraPosition *)
    cameraPositionWithGeometry:(nonnull YMKGeometry *)geometry
                     focusRect:(nullable YMKScreenRect *)focusRect;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and {``` tilt} camera parameters.

If {``` focusRect} is not provided, the current focus rect is used (or the full view if no focus rect is set).

If {``` azimuth} is not provided, the current {``` cameraPosition.azimuth} is used.

If {``` tilt} is not provided, the current {``` cameraPosition.tilt} is used.

- returns: The computed camera position.

cameraPositionWithGeometry:focusRect:azimuth:

- (nonnull YMKCameraPosition *)
    cameraPositionWithGeometry:(nonnull YMKGeometry *)geometry
                     focusRect:(nullable YMKScreenRect *)focusRect
                       azimuth:(nullable NSNumber *)azimuth;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and {``` tilt} camera parameters.

If {``` focusRect} is not provided, the current focus rect is used (or the full view if no focus rect is set).

If {``` azimuth} is not provided, the current {``` cameraPosition.azimuth} is used.

If {``` tilt} is not provided, the current {``` cameraPosition.tilt} is used.

- returns: The computed camera position.

cameraPositionWithGeometry:focusRect:azimuth:tilt:

- (nonnull YMKCameraPosition *)
    cameraPositionWithGeometry:(nonnull YMKGeometry *)geometry
                     focusRect:(nullable YMKScreenRect *)focusRect
                       azimuth:(nullable NSNumber *)azimuth
                          tilt:(nullable NSNumber *)tilt;

Calculates a camera position that projects the specified geometry into the given { focusRect}, using the provided { azimuth} and {``` tilt} camera parameters.

If {``` focusRect} is not provided, the current focus rect is used (or the full view if no focus rect is set).

If {``` azimuth} is not provided, the current {``` cameraPosition.azimuth} is used.

If {``` tilt} is not provided, the current {``` cameraPosition.tilt} is used.

- returns: The computed camera position.

visibleRegionWithCameraPosition:

- (nonnull YMKVisibleRegion *)visibleRegionWithCameraPosition:
    (nonnull YMKCameraPosition *)cameraPosition;

Returns

The map region that is visible from the given camera
position. Region IS bounded by latitude limits [-90, 90] and IS NOT
bounded by longitude limits [-180, 180]. If the longitude exceeds its
limits, we see the world's edge and another instance of the world
beyond this edge.


moveWithCameraPosition:

- (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition;

Changes the camera position. Can cancel a previous unfinished movement.

null}, the camera position changes instantly. - see: mapkit.Animation for more details. - parameter: cameraCallback A function that receives a boolean indicating whether the camera action completed successfully. Invoked when: <ul> <li>The camera action is cancelled (for example, due to a new camera movement request), in which case { false} is passed.

  • The camera action finishes successfully, in which case {``` true} is passed.
  • Parameters

    animation

    Defines animation parameters. If {


    moveWithCameraPosition:animation:

    - (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition
                         animation:(nullable YMKAnimation *)animation;

    Changes the camera position. Can cancel a previous unfinished movement.

    null}, the camera position changes instantly. - see: mapkit.Animation for more details. - parameter: cameraCallback A function that receives a boolean indicating whether the camera action completed successfully. Invoked when: <ul> <li>The camera action is cancelled (for example, due to a new camera movement request), in which case { false} is passed.

  • The camera action finishes successfully, in which case {``` true} is passed.
  • Parameters

    animation

    Defines animation parameters. If {


    moveWithCameraPosition:animation:cameraCallback:

    - (void)moveWithCameraPosition:(nonnull YMKCameraPosition *)cameraPosition
                         animation:(nullable YMKAnimation *)animation
                    cameraCallback:(nullable YMKMapCameraCallback)cameraCallback;

    Changes the camera position. Can cancel a previous unfinished movement.

    null}, the camera position changes instantly. - see: mapkit.Animation for more details. - parameter: cameraCallback A function that receives a boolean indicating whether the camera action completed successfully. Invoked when: <ul> <li>The camera action is cancelled (for example, due to a new camera movement request), in which case { false} is passed.

  • The camera action finishes successfully, in which case {``` true} is passed.
  • Parameters

    animation

    Defines animation parameters. If {


    addInputListenerWithInputListener:

    - (void)addInputListenerWithInputListener:
        (nonnull id<YMKMapInputListener>)inputListener;

    Adds input listeners.

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


    removeInputListenerWithInputListener:

    - (void)removeInputListenerWithInputListener:
        (nonnull id<YMKMapInputListener>)inputListener;

    Removes input listeners.


    addCameraListenerWithCameraListener:

    - (void)addCameraListenerWithCameraListener:
        (nonnull id<YMKMapCameraListener>)cameraListener;

    Adds camera listeners.

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


    removeCameraListenerWithCameraListener:

    - (void)removeCameraListenerWithCameraListener:
        (nonnull id<YMKMapCameraListener>)cameraListener;

    Removes camera listeners.


    setMapLoadedListenerWithMapLoadedListener:

    - (void)setMapLoadedListenerWithMapLoadedListener:
        (nullable id<YMKMapLoadedListener>)mapLoadedListener;

    Sets a map loaded listener.

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


    addTapListenerWithTapListener:

    - (void)addTapListenerWithTapListener:
        (nonnull id<YMKLayersGeoObjectTapListener>)tapListener;

    Adds a tap listener that is used to obtain brief geo object info.

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


    removeTapListenerWithTapListener:

    - (void)removeTapListenerWithTapListener:
        (nonnull id<YMKLayersGeoObjectTapListener>)tapListener;

    Removes a tap listener that is used to obtain brief geo object info.


    deselectGeoObject

    - (void)deselectGeoObject;

    Resets the currently selected geo object.


    selectGeoObjectWithSelectionMetaData:

    - (void)selectGeoObjectWithSelectionMetaData:
        (nonnull YMKGeoObjectSelectionMetadata *)selectionMetaData;

    Selects a geo object with the specified objectId in the specified layerId. If the object is not currently on the screen, it is selected anyway, but the user will not actually see that. You need to move the camera in addition to this call to be sure that the selected object is visible for the user. GeoObjectSelectionMetadata can be extracted from the geo object's metadata container when the user taps on a geo object.


    addIndoorStateListenerWithIndoorStateListener:

    - (void)addIndoorStateListenerWithIndoorStateListener:
        (nonnull id<YMKIndoorStateListener>)indoorStateListener;

    Subscribe to indoor state change events.

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


    removeIndoorStateListenerWithIndoorStateListener:

    - (void)removeIndoorStateListenerWithIndoorStateListener:
        (nonnull id<YMKIndoorStateListener>)indoorStateListener;

    Unsubscribe from indoor state change events.


    setMapStyleWithStyle:

    - (BOOL)setMapStyleWithStyle:(nonnull NSString *)style;

    Applies JSON style transformations to the map. Same as setMapStyle(0, style). Affects VectorMap and Hybrid map types. Set to empty string to clear previous styling. Returns true if the style was successfully parsed, and false otherwise. If the returned value is false, the current map style remains unchanged.


    setMapStyleWithId:style:

    - (BOOL)setMapStyleWithId:(NSInteger)id style:(nonnull NSString *)style;

    Applies JSON style transformations to the map. Replaces previous styling with the specified ID (if such exists). Stylings are applied in an ascending order. Affects VectorMap and Hybrid map types. Set to empty string to clear previous styling with the specified ID. Returns true if the style was successfully parsed, and false otherwise. If the returned value is false, the current map style remains unchanged.


    resetMapStyles

    - (void)resetMapStyles;

    Resets all JSON style transformations applied to the map.


    set2DModeWithEnable:

    - (void)set2DModeWithEnable:(BOOL)enable;

    Forces the map to be flat. true - All loaded tiles start showing the "flatten out" animation; all new tiles do not start 3D animation. false - All tiles start showing the "rise up" animation.


    addMapObjectLayerWithLayerId:

    - (nonnull YMKRootMapObjectCollection *)addMapObjectLayerWithLayerId:
        (nonnull NSString *)layerId;

    Creates a new independent map object collection linked to the specified layer ID. Sublayers will be added after corresponding sublayers of the topmost layer.


    projection

    - (nonnull YMKProjection *)projection;

    Provides map projection


    wipe

    - (void)wipe;

    Erases tiles, caches, etc. Does not trigger the next frame generation.


    addTileLayerWithLayerId:layerOptions:createTileDataSource:

    - (nonnull YMKLayer *)
        addTileLayerWithLayerId:(nonnull NSString *)layerId
                   layerOptions:(nonnull YMKLayerOptions *)layerOptions
           createTileDataSource:
               (nonnull YMKCreateTileDataSource)createTileDataSource;

    Adds tile layer.


    Properties

    cameraPosition

    @property (nonatomic, readonly, nonnull) YMKCameraPosition *cameraPosition;

    Returns

    Current camera position. Target position must be within
    latitude [-90, 90] and longitude [-180, 180].


    visibleRegion

    @property (nonatomic, readonly, nonnull) YMKVisibleRegion *visibleRegion;

    Returns

    The map region that is currently visible. Region IS bounded
    by latitude limits [-90, 90] and IS NOT bounded by longitude limits
    [-180, 180]. If the longitude exceeds its limits, we see the world's
    edge and another instance of the world beyond this edge.


    cameraBounds

    @property (nonatomic, readonly, nonnull) YMKCameraBounds *cameraBounds;


    nightModeEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isNightModeEnabled) BOOL nightModeEnabled;

    If enabled, night mode will reduce map brightness and improve contrast.


    zoomGesturesEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isZoomGesturesEnabled) BOOL zoomGesturesEnabled;

    Enable/disable zoom gestures, for example: - pinch - double tap (zoom in) - tap with two fingers (zoom out)


    scrollGesturesEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isScrollGesturesEnabled) BOOL scrollGesturesEnabled;

    Enable/disable scroll gestures, such as the pan gesture.


    tiltGesturesEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isTiltGesturesEnabled) BOOL tiltGesturesEnabled;

    Enable/disable tilt gestures, such as parallel pan with two fingers.


    rotateGesturesEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isRotateGesturesEnabled) BOOL rotateGesturesEnabled;

    Enable/disable rotation gestures, such as rotation with two fingers.


    fastTapEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isFastTapEnabled) BOOL fastTapEnabled;

    Removes the 300 ms delay in emitting a tap gesture. However, a double-tap will emit a tap gesture along with a double-tap.


    mapType

    @property (nonatomic, assign, unsafe_unretained, readwrite) YMKMapType mapType;

    Sets the base map type.


    mapObjects

    @property (nonatomic, readonly, nonnull) YMKRootMapObjectCollection *mapObjects;

    Returns

    List of map objects associated with the map. The layerId for
    this collection can be retrieved via LayerIds.mapObjectsLayerId


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

    Yandex logo object.


    poiLimit

    @property (nonatomic, assign, unsafe_unretained, readwrite, nullable)
        NSNumber *poiLimit;

    Limits the number of visible basemap POIs.

    Optional property, can be nil.


    indoorEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isIndoorEnabled) BOOL indoorEnabled;

    Enables/disables indoor plans on the map. Disabled by default.


    mode

    @property (nonatomic, assign, unsafe_unretained, readwrite) YMKMapMode mode;

    Selects one of predefined map style modes optimized for particular use case(transit, driving, etc). Resets json styles set with setMapStyle. MapMode.Map by deafult.


    hdModeEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isHdModeEnabled) BOOL hdModeEnabled;

    Enables hd mode of displayed content


    awesomeModelsEnabled

    @property (nonatomic, assign, unsafe_unretained, readwrite,
              getter=isAwesomeModelsEnabled) BOOL awesomeModelsEnabled;

    Enables rich textured 3d content on basemap.


    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.


    Следующая