MMKMapKit

@interface MMKMapKit : NSObject

Note

MapKit holds listener/delegate objects by weak references.

Provides access to all services in the SDK.

Initialize the MapKit factory before using this class.

You need to have strong references to them somewhere in the client code.

Summary

Instance methods

- (void)setUserIdWithId:(nonnull NSString *)id;
Sets the user id

- (void)setLocationManagerWithLocationManager:
    (nonnull MMKLocationManager *)locationManager;

Sets single global location manager that is used by every module in MapKit by default

- (void)resetLocationManagerToDefault;
Resets the global location manager to a default one, that is a location manager that is created by MMKMapKit::createLocationManager call

- (void)onStart;
Notifies MapKit when the application resumes the foreground state

- (void)onStop;
Notifies MapKit when the application pauses and goes to the background

- (nonnull MMKLocationManager *)createLocationManager;
Creates a manager that allows to listen for device location updates

- (nonnull MMKLocationSimulator *)createLocationSimulatorWithGeometry:
    (nonnull MMKPolyline *)geometry;

Creates a suspended LocationSimulator object with the given geometry

- (nonnull MMKLocationSimulator *)createLocationSimulator;
Creates a suspended LocationSimulator object

- (nonnull MMKDummyLocationManager *)createDummyLocationManager;
Creates a manager that functions as a location proxy

- (nonnull MMKOffscreenMapWindow *)
    createOffscreenMapWindowWithWidth:(NSInteger)width
                               height:(NSInteger)height;

Creates an OffscreenMapWindow

- (nonnull MMKOffscreenMapWindow *)
    createOffscreenMapWindowWithWidth:(NSInteger)width
                               height:(NSInteger)height
                    customScaleFactor:(float)customScaleFactor;

Creates an OffscreenMapWindow with custom scale factor The scale factor is equal to the number of pixels per device-independent point

- (nonnull MMKTrafficLayer *)createTrafficLayerWithMapWindow:
    (nonnull MMKMapWindow *)mapWindow;

Creates the traffic layer

- (nonnull MMKRoadEventsManager *)createRoadEventsManager;
Creates a manager that allows to interact with road events

- (nonnull MMKUserLocationLayer *)createUserLocationLayerWithMapWindow:
    (nonnull MMKMapWindow *)mapWindow;

Create layer with the user location icon

Properties

@property (nonatomic, readonly, nonnull)
    MMKOfflineCacheManager *offlineCacheManager;

Returns a manager that handles offline maps, search index and road graph

@property (nonatomic, readonly, nonnull) MMKStorageManager *storageManager;
Returns a manager that handles disk size and IO errors

@property (nonatomic, readonly, nonnull) NSString *version;
Returns the version of the MapKit bundle

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

Instance methods

setUserIdWithId:

- (void)setUserIdWithId:(nonnull NSString *)id;

Sets the user id. Don't use this method directly. Use MapKitFactory.setUserId instead

Parameters

id

User id is your own identifier for all mapkit requests


setLocationManagerWithLocationManager:

- (void)setLocationManagerWithLocationManager:
    (nonnull MMKLocationManager *)locationManager;

Sets single global location manager that is used by every module in MapKit by default. The provided location manager must have async implementation in it. Any location manager created by MapKit has async implementation. To provide your own source of location please use MMKDummyLocationManager. Application can change location manager at any moment, all MapKit modules will start receiving new location immediately.


resetLocationManagerToDefault

- (void)resetLocationManagerToDefault;

Resets the global location manager to a default one, that is a location manager that is created by MMKMapKit::createLocationManager call.


onStart

- (void)onStart;

Notifies MapKit when the application resumes the foreground state.


onStop

- (void)onStop;

Notifies MapKit when the application pauses and goes to the background.


createLocationManager

- (nonnull MMKLocationManager *)createLocationManager;

Creates a manager that allows to listen for device location updates.


createLocationSimulatorWithGeometry:

- (nonnull MMKLocationSimulator *)createLocationSimulatorWithGeometry:
    (nonnull MMKPolyline *)geometry;

Creates a suspended LocationSimulator object with the given geometry.


createLocationSimulator

- (nonnull MMKLocationSimulator *)createLocationSimulator;

Creates a suspended LocationSimulator object. Geometry must be set manually.


createDummyLocationManager

- (nonnull MMKDummyLocationManager *)createDummyLocationManager;

Creates a manager that functions as a location proxy.


createOffscreenMapWindowWithWidth:height:

- (nonnull MMKOffscreenMapWindow *)
    createOffscreenMapWindowWithWidth:(NSInteger)width
                               height:(NSInteger)height;

Creates an OffscreenMapWindow


createOffscreenMapWindowWithWidth:height:customScaleFactor:

- (nonnull MMKOffscreenMapWindow *)
    createOffscreenMapWindowWithWidth:(NSInteger)width
                               height:(NSInteger)height
                    customScaleFactor:(float)customScaleFactor;

Creates an OffscreenMapWindow with custom scale factor The scale factor is equal to the number of pixels per device-independent point.


createTrafficLayerWithMapWindow:

- (nonnull MMKTrafficLayer *)createTrafficLayerWithMapWindow:
    (nonnull MMKMapWindow *)mapWindow;

Creates the traffic layer.


createRoadEventsManager

- (nonnull MMKRoadEventsManager *)createRoadEventsManager;

Creates a manager that allows to interact with road events.


createUserLocationLayerWithMapWindow:

- (nonnull MMKUserLocationLayer *)createUserLocationLayerWithMapWindow:
    (nonnull MMKMapWindow *)mapWindow;

Create layer with the user location icon.


Properties

offlineCacheManager

@property (nonatomic, readonly, nonnull)
    MMKOfflineCacheManager *offlineCacheManager;

Note

This feature is not available in the free MapKit version.

Returns a manager that handles offline maps, search index and road graph.


storageManager

@property (nonatomic, readonly, nonnull) MMKStorageManager *storageManager;

Returns a manager that handles disk size and IO errors.


version

@property (nonatomic, readonly, nonnull) NSString *version;

Returns the version of the MapKit bundle.


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.