Class YMKMapKit

Provides access to all services in the SDK.

Initialize the MapKit factory before using this class.

Note: MapKit holds listener/delegate objects by weak references. You need to have strong references to them somewhere in the client code.

Instance Methods

- createDummyLocationManager

Creates a manager that functions as a location proxy.

- createLocationManager

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

- createLocationSimulatorWithGeometry:

Creates a suspended LocationSimulator object with the given geometry.

- createTrafficLayerWithMapWindow:

Creates the traffic layer.

- createUserLocationLayerWithMapWindow:

Create layer with the user location icon.

- onStart

Notifies MapKit when the application resumes the foreground state.

- onStop

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

- setCompletionHandler:forBackgroundURLSession:

Sets completion handler for background URL session.

Class Methods

+ mapKit

Gets the MapKit instance.

+ setApiKey:

Sets the API key for MapKit SDK. Call this before [YMKMapKit mapKit] and [YMKMapKit sharedInstance].

+ setLocale:

Sets locale for MapKit SDK. Call this before [YMKMapKit mapKit] and [YMKMapKit sharedInstance].

+ sharedInstance

Properties

offlineCacheManager
storageManager

Returns a manager that handles disk size and IO errors.

valid

Tells if this object is valid or no.

version

Returns the version of the MapKit bundle.

Method Detail

-createDummyLocationManager

- (nonnull YMKDummyLocationManager *)createDummyLocationManager

Creates a manager that functions as a location proxy.

-createLocationManager

- (nonnull YMKLocationManager *)createLocationManager

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

-createLocationSimulatorWithGeometry:

- (nonnull YMKLocationSimulator *)createLocationSimulatorWithGeometry:(nonnull YMKPolyline *)geometry 

Creates a suspended LocationSimulator object with the given geometry.

-createTrafficLayerWithMapWindow:

- (nonnull YMKTrafficLayer *)createTrafficLayerWithMapWindow:(nonnull YMKMapWindow *)mapWindow 

Creates the traffic layer.

-createUserLocationLayerWithMapWindow:

- (nonnull YMKUserLocationLayer *)createUserLocationLayerWithMapWindow:(nonnull YMKMapWindow *)mapWindow 

Create layer with the user location icon.

+mapKit

+ (nonnull instancetype)mapKit

Gets the MapKit instance.

-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.

+setApiKey:

+ (void)setApiKey:(nonnull NSString *)apiKey 

Sets the API key for MapKit SDK. Call this before [YMKMapKit mapKit] and [YMKMapKit sharedInstance].

-setCompletionHandler:forBackgroundURLSession:

- (void)setCompletionHandler:(nonnull void(^)(void))completionHandler
     forBackgroundURLSession:(nonnull NSString *)identifier 

Sets completion handler for background URL session.

+setLocale:

+ (void)setLocale:(nullable NSString *)locale 

Sets locale for MapKit SDK. Call this before [YMKMapKit mapKit] and [YMKMapKit sharedInstance].

+sharedInstance

+ (nonnull instancetype)sharedInstance

Property Detail

offlineCacheManager

(assign, readonly) YMKOfflineCacheManager * offlineCacheManager

Attention.

This feature is not available in the free MapKit version.

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

storageManager

(assign, readonly) YMKStorageManager * storageManager

Returns a manager that handles disk size and IO errors.

valid

(assign, 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.

version

(assign, readonly) NSString * version

Returns the version of the MapKit bundle.