public class LostLocationEngine
extends com.mapbox.services.android.telemetry.location.LocationEngine
implements com.mapzen.android.lost.api.LostApiClient.ConnectionCallbacks, com.mapzen.android.lost.api.LocationListener
| Constructor and Description |
|---|
LostLocationEngine(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Activate the location engine which will connect whichever location provider you are using.
|
void |
deactivate()
Disconnect the location engine which is useful when you no longer need location updates or requesting the users
LocationEngine.getLastLocation(). |
android.location.Location |
getLastLocation()
Returns the Last known location if the location provider is connected and location permissions are granted.
|
static com.mapbox.services.android.telemetry.location.LocationEngine |
getLocationEngine(android.content.Context context) |
boolean |
isConnected()
Check if your location provider has been activated/connected.
|
com.mapbox.services.android.telemetry.location.LocationEngine.Type |
obtainType() |
void |
onConnected()
Invoked when the location provider has connected.
|
void |
onConnectionSuspended()
Invoked when the location provider connection has been suspended.
|
void |
onLocationChanged(android.location.Location location)
Invoked when the Location has changed.
|
void |
removeLocationUpdates()
Dismiss ongoing location update to the location provider.
|
void |
requestLocationUpdates()
Request location updates to the location provider.
|
addLocationEngineListener, getFastestInterval, getInterval, getPriority, getSmallestDisplacement, isBetterLocation, removeLocationEngineListener, setFastestInterval, setInterval, setPriority, setSmallestDisplacementpublic static com.mapbox.services.android.telemetry.location.LocationEngine getLocationEngine(android.content.Context context)
public void activate()
LocationEngine.requestLocationUpdates().activate in class com.mapbox.services.android.telemetry.location.LocationEnginepublic void deactivate()
LocationEngine.getLastLocation(). Before deactivating, you'll need to stop request user location updates
using LocationEngine.removeLocationUpdates().deactivate in class com.mapbox.services.android.telemetry.location.LocationEnginepublic boolean isConnected()
isConnected in class com.mapbox.services.android.telemetry.location.LocationEnginepublic void onConnected()
onConnected in interface com.mapzen.android.lost.api.LostApiClient.ConnectionCallbackspublic void onConnectionSuspended()
onConnectionSuspended in interface com.mapzen.android.lost.api.LostApiClient.ConnectionCallbacks@Nullable public android.location.Location getLastLocation()
getLastLocation in class com.mapbox.services.android.telemetry.location.LocationEnginepublic void requestLocationUpdates()
requestLocationUpdates in class com.mapbox.services.android.telemetry.location.LocationEnginepublic com.mapbox.services.android.telemetry.location.LocationEngine.Type obtainType()
obtainType in class com.mapbox.services.android.telemetry.location.LocationEnginepublic void removeLocationUpdates()
removeLocationUpdates in class com.mapbox.services.android.telemetry.location.LocationEnginepublic void onLocationChanged(android.location.Location location)
onLocationChanged in interface com.mapzen.android.lost.api.LocationListenerlocation - the new location