Interface MapKit

com.yandex.mapkit

public interface MapKit

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.

Methods

DummyLocationManager createDummyLocationManager()

Creates a manager that functions as a location proxy.

LocationManager createLocationManager()

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

LocationSimulator createLocationSimulator(@NonNull Polyline geometry)

Creates a suspended LocationSimulator object with the given geometry.

TrafficLayer createTrafficLayer(@NonNull MapWindow mapWindow)

Creates the traffic layer.

UserLocationLayer createUserLocationLayer(@NonNull MapWindow mapWindow)

Create layer with the user location icon.

OfflineCacheManager getOfflineCacheManager()
StorageManager getStorageManager()

Returns a manager that handles disk size and IO errors.

String getVersion()

Returns the version of the MapKit bundle.

boolean isValid()

Tells if this MapKit is valid or no.

void onStart()

Notifies MapKit when the application resumes the foreground state.

void onStop()

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

Method Detail

createDummyLocationManager

public DummyLocationManager createDummyLocationManager ()

Creates a manager that functions as a location proxy.

createLocationManager

public LocationManager createLocationManager ()

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

createLocationSimulator

public LocationSimulator createLocationSimulator (@NonNull Polyline geometry)

Creates a suspended LocationSimulator object with the given geometry.

createTrafficLayer

public TrafficLayer createTrafficLayer (@NonNull MapWindow mapWindow)

Creates the traffic layer.

createUserLocationLayer

public UserLocationLayer createUserLocationLayer (@NonNull MapWindow mapWindow)

Create layer with the user location icon.

getOfflineCacheManager

public OfflineCacheManager getOfflineCacheManager ()

Attention.

This feature is not available in the free MapKit version.

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

getStorageManager

public StorageManager getStorageManager ()

Returns a manager that handles disk size and IO errors.

getVersion

public String getVersion ()

Returns the version of the MapKit bundle.

isValid

public boolean isValid ()

Tells if this MapKit is valid or no.

Any other method (except for this one) called on an invalid MapKit will throw java.lang.RuntimeException. An instance 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.

onStart

public void onStart ()

Notifies MapKit when the application resumes the foreground state.

onStop

public void onStop ()

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