YMKMapKit

class YMKMapKit : NSObject

Примечание

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

func setUserIdWithId(_ id: String)
Sets the user id

func setLocationManagerWith( locationManager: YMKLocationManager_)
Sets single global location manager that is used by every module in MapKit by default

func resetLocationManagerToDefault()
Resets the global location manager to a default one, that is a location manager that is created by YMKMapKit::createLocationManager call

func onStart()
Notifies MapKit when the application resumes the foreground state

func onStop()
Notifies MapKit when the application pauses and goes to the background

func createLocationManager() -> YMKLocationManager
Creates a manager that allows to listen for device location updates

func createLocationManager(with activityType: YRTLocationActivityType) -> YMKLocationManager
Creates a manager that allows to listen for device location updates, uses activityType as a hint

func createLocationSimulator(withGeometry geometry: YMKPolyline) -> YMKLocationSimulator
Creates a suspended LocationSimulator object with the given geometry

func createLocationSimulator() -> YMKLocationSimulator
Creates a suspended LocationSimulator object

func createDummyLocationManager() -> YMKDummyLocationManager
Creates a manager that functions as a location proxy

func createTrafficLayer(with mapWindow: YMKMapWindow) -> YMKTrafficLayer
Creates the traffic layer

func createRoadEventsManager() -> YMKRoadEventsManager
Creates a manager that allows to interact with road events

func createRouteRoadEventsLayer(with mapWindow: YMKMapWindow,
                                 styleProvider: YMKRoadEventsLayerStyleProvider) -> YMKRoadEventsLayer
Creates the road events layer that will draw road events on the route

func createUserLocationLayer(with mapWindow: YMKMapWindow) -> YMKUserLocationLayer
Create layer with the user location icon

Properties

var offlineCacheManagerYMKOfflineCacheManager { get }
Returns a manager that handles offline maps, search index and road graph

var storageManagerYMKStorageManager { get }
Returns a manager that handles disk size and IO errors

var version: String { get }
Returns the version of the MapKit bundle

var isValid: Bool { get }
Tells if this object is valid or no

Instance methods

setUserIdWithId(_:)

func setUserIdWithId(_ id: String)

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


setLocationManagerWith(_:)

func setLocationManagerWith( locationManager: YMKLocationManager_)

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 YMKDummyLocationManager. Application can change location manager at any moment, all MapKit modules will start receiving new location immediately.


resetLocationManagerToDefault()

func resetLocationManagerToDefault()

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


onStart()

func onStart()

Notifies MapKit when the application resumes the foreground state.


onStop()

func onStop()

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


createLocationManager()

func createLocationManager() -> YMKLocationManager

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


createLocationManager(with:)

func createLocationManager(with activityType: YRTLocationActivityType) -> YMKLocationManager

Creates a manager that allows to listen for device location updates, uses activityType as a hint.


createLocationSimulator(withGeometry:)

func createLocationSimulator(withGeometry geometry: YMKPolyline) -> YMKLocationSimulator

Creates a suspended LocationSimulator object with the given geometry.


createLocationSimulator()

func createLocationSimulator() -> YMKLocationSimulator

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


createDummyLocationManager()

func createDummyLocationManager() -> YMKDummyLocationManager

Creates a manager that functions as a location proxy.


createTrafficLayer(with:)

func createTrafficLayer(with mapWindow: YMKMapWindow) -> YMKTrafficLayer

Creates the traffic layer.


createRoadEventsManager()

func createRoadEventsManager() -> YMKRoadEventsManager

Creates a manager that allows to interact with road events.


createRouteRoadEventsLayer(with:styleProvider:)

func createRouteRoadEventsLayer(with mapWindow: YMKMapWindow,
                                 styleProvider: YMKRoadEventsLayerStyleProvider) -> YMKRoadEventsLayer

Creates the road events layer that will draw road events on the route.

The class maintains a strong reference to the object in the 'styleProvider' parameter until it (the class) is invalidated.

Parameters

mapWindow

Map window to attach road events layer

styleProvider

Provides icons and styles for road events depending on their properties


createUserLocationLayer(with:)

func createUserLocationLayer(with mapWindow: YMKMapWindow) -> YMKUserLocationLayer

Create layer with the user location icon.


Properties

offlineCacheManager

var offlineCacheManager: YMKOfflineCacheManager { get }

Примечание

This feature is not available in the free MapKit version.

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


storageManager

var storageManager: YMKStorageManager { get }

Returns a manager that handles disk size and IO errors.


version

var version: String { get }

Returns the version of the MapKit bundle.


isValid

var isValid: Bool { get }

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.


Предыдущая
Следующая