Interface LocationManager
Package world.mappable.mapkit.location
All known Subinterfaces:
DummyLocationManager, LocationSimulator
interface LocationManager
Handles location updates and changes.
Summary
Methods
Type and modifiers |
Method and Description |
void |
subscribeForLocationUpdates(@NonNull SubscriptionSettings subscriptionSettings, |
void |
requestSingleUpdate(@NonNull LocationListener locationListener) |
void |
unsubscribe(@NonNull LocationListener locationListener) |
void |
suspend() |
void |
resume() |
Methods
subscribeForLocationUpdates
void subscribeForLocationUpdates(@NonNull SubscriptionSettings subscriptionSettings, |
Subscribe for location update events.
If the listener was already subscribed to updates from the LocationManager, subscription settings will be updated.
The class does not retain the object in the 'locationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
Parameters |
|
|
Subscription settings. |
|
Location update listener. |
requestSingleUpdate
void requestSingleUpdate(@NonNull LocationListener locationListener) |
Subscribe to a single location update.
If the listener was already subscribed to location updates, the previous subscription will be removed.
The class does not retain the object in the 'locationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
Parameters |
|
|
Location update listener. |
unsubscribe
void unsubscribe(@NonNull LocationListener locationListener) |
Unsubscribe from location update events.
Can be called for either [mapkit.location.LocationManager#subscribeForLocationUpdates(SubscriptionSettings,
LocationListener)](./LocationManager.md#subscribeforlocationupdatessubscriptionsettings-
locationlistener) or mapkit.location.LocationManager#requestSingleUpdate(LocationListener). For mapkit.location.LocationManager#requestSingleUpdate(LocationListener), if an event was already received, mapkit.location.LocationManager#unsubscribe(LocationListener) does not have any effect. If the listener is already unsubscribed, the method call is ignored.
The class does not retain the object in the 'locationListener' parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a class.
Parameters |
|
|
Listener passed to either [mapkit.location.LocationManager#subscribeForLocationUpdates(SubscriptionSettings, |
suspend
void suspend() |
Stops updates for all subscriptions until resume() is called.
resume
void resume() |
Resumes updates stopped by a suspend() call.