- Summary
- Methods
- setUserId
- setLocationManager
- resetLocationManagerToDefault
- onStart
- onStop
- createLocationManager
- createLocationManager
- createLocationSimulator
- createLocationSimulator
- createDummyLocationManager
- getOfflineCacheManager
- getStorageManager
- createTrafficLayer
- createRoadEventsManager
- createRouteRoadEventsLayer
- createUserLocationLayer
- getVersion
- isValid
Package com.yandex.mapkit
Interface MapKit
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.
Summary
Methods
Type and modifiers |
Method and Description |
void |
setUserId(@NonNull java.lang.String id) |
void |
setLocationManager(@NonNull LocationManager locationManager) |
void |
resetLocationManagerToDefault() |
void |
onStart() |
void |
onStop() |
createLocationManager() |
|
createLocationManager(@NonNull LocationActivityType activityType) |
|
createLocationSimulator(@NonNull Polyline geometry) |
|
createLocationSimulator() |
|
createDummyLocationManager() |
|
getOfflineCacheManager() |
|
getStorageManager() |
|
createTrafficLayer(@NonNull MapWindow mapWindow) |
|
createRoadEventsManager() |
|
createRouteRoadEventsLayer(@NonNull MapWindow mapWindow, |
|
createUserLocationLayer(@NonNull MapWindow mapWindow) |
|
java.lang.String |
getVersion() |
boolean |
isValid() |
Methods
setUserId
void setUserId(@NonNull java.lang.String id) |
Sets the user id.
Don't use this method directly. Use MapKitFactory.setUserId
instead
Parameters |
|
|
User id is your own identifier for all mapkit requests |
setLocationManager
void setLocationManager(@NonNull LocationManager 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 mapkit.location.DummyLocationManager. 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 mapkit.MapKit#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 |
Creates a manager that allows to listen for device location updates.
createLocationManager
@NonNull |
Creates a manager that allows to listen for device location updates, uses activityType as a hint.
createLocationSimulator
@NonNull |
Creates a suspended LocationSimulator object with the given geometry.
createLocationSimulator
@NonNull |
Creates a suspended LocationSimulator object.
Geometry must be set manually.
createDummyLocationManager
@NonNull |
Creates a manager that functions as a location proxy.
getOfflineCacheManager
@NonNull |
Returns a manager that handles offline maps, search index and road graph.
Note
This feature is not available in the free MapKit version.
getStorageManager
@NonNull |
Returns a manager that handles disk size and IO errors.
createTrafficLayer
@NonNull |
Creates the traffic layer.
createRoadEventsManager
@NonNull |
Creates a manager that allows to interact with road events.
createRouteRoadEventsLayer
@NonNull |
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 |
|
|
Map window to attach road events layer |
|
Provides icons and styles for road events depending on their properties |
createUserLocationLayer
@NonNull |
Create layer with the user location icon.
getVersion
@NonNull |
Returns the version of the MapKit bundle.
isValid
boolean isValid() |
Tells if this MapKit is valid or not.
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.