Package com.esri.arcgisruntime.location
Class RouteTrackerLocationDataSource
- java.lang.Object
-
- com.esri.arcgisruntime.location.LocationDataSource
-
- com.esri.arcgisruntime.location.RouteTrackerLocationDataSource
-
public final class RouteTrackerLocationDataSource extends LocationDataSource
A location data source that uses a route tracker and a generic location data source to output locations snapped to a route.This data source will pass the locations from the
LocationDataSource.LocationChangedEvent
event to theRouteTracker.trackLocationAsync(Location)
. TheTrackingStatus.getDisplayLocation()
will then be returned in this data source's locationChanged event. The output locations will be snapped to the route when "on route".- Since:
- 100.9.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.esri.arcgisruntime.location.LocationDataSource
LocationDataSource.ErrorChangedEvent, LocationDataSource.ErrorChangedListener, LocationDataSource.HeadingChangedEvent, LocationDataSource.HeadingChangedListener, LocationDataSource.Location, LocationDataSource.LocationChangedEvent, LocationDataSource.LocationChangedListener, LocationDataSource.Status, LocationDataSource.StatusChangedEvent, LocationDataSource.StatusChangedListener
-
-
Constructor Summary
Constructors Constructor Description RouteTrackerLocationDataSource(android.content.Context context, RouteTracker routeTracker)
Constructs a RouteTrackerLocationDataSource using the the passedRouteTracker
and the default platform supported location data sourceAndroidLocationDataSource
.RouteTrackerLocationDataSource(RouteTracker routeTracker, LocationDataSource locationDataSource)
Constructs a RouteTrackerLocationDataSource using the the passedRouteTracker
and the given location data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
onStart()
Called fromLocationDataSource.startAsync()
.protected void
onStop()
Called from theLocationDataSource.stopAsync()
orLocationDataSource.stop()
method, subclasses should perform any necessary clean-up in this method; for example, stop streaming the location data, release resources, and so on.-
Methods inherited from class com.esri.arcgisruntime.location.LocationDataSource
addErrorChangedListener, addHeadingChangedListener, addLocationChangedListener, addStartedListener, addStatusChangedListener, getError, getStatus, isStarted, onStartCompleted, removeErrorChangedListener, removeHeadingChangedListener, removeLocationChangedListener, removeStartedListener, removeStatusChangedListener, setLastKnownLocation, startAsync, stop, stopAsync, updateHeading, updateLocation
-
-
-
-
Constructor Detail
-
RouteTrackerLocationDataSource
public RouteTrackerLocationDataSource(android.content.Context context, RouteTracker routeTracker)
Constructs a RouteTrackerLocationDataSource using the the passedRouteTracker
and the default platform supported location data sourceAndroidLocationDataSource
.- Parameters:
context
- the Context in which the LocationDataSource is runningrouteTracker
- a RouteTracker- Throws:
java.lang.IllegalArgumentException
- if context or routeTracker is null- Since:
- 100.9.0
-
RouteTrackerLocationDataSource
public RouteTrackerLocationDataSource(RouteTracker routeTracker, LocationDataSource locationDataSource)
Constructs a RouteTrackerLocationDataSource using the the passedRouteTracker
and the given location data source.- Parameters:
routeTracker
- a RouteTrackerlocationDataSource
- a LocationDataSource- Throws:
java.lang.IllegalArgumentException
- if routeTracker or locationDataSource is null- Since:
- 100.9.0
-
-
Method Detail
-
onStart
protected void onStart()
Description copied from class:LocationDataSource
Called fromLocationDataSource.startAsync()
. Subclasses should implement this method to prepare for starting the data source. TheLocationDataSource.onStartCompleted(Throwable)
method must be called by the subclass once the location data source has finished its starting process.- Specified by:
onStart
in classLocationDataSource
-
onStop
protected void onStop()
Description copied from class:LocationDataSource
Called from theLocationDataSource.stopAsync()
orLocationDataSource.stop()
method, subclasses should perform any necessary clean-up in this method; for example, stop streaming the location data, release resources, and so on.- Specified by:
onStop
in classLocationDataSource
-
-