Hello, I'm working on a navigation app. I've done my app based on 'Navigate a route' and 'Navigate in AR samples'. I've managed to calculate and display a route, but when I'm trying to navigate, routeTracker is not receiving any callbacks from TrackingStatusChangedListener and trackingStatus is constantly null.
This is how I'm inititating routeTracker and providing it with current location.
routeTracker = RouteTracker(activity, routeResult, 0, true)
val trackingLocationDataSource = AndroidLocationDataSource(activity)
trackingLocationDataSource.addLocationChangedListener { locationChangedEvent ->
routeTracker.trackLocationAsync(locationChangedEvent.location)
}
trackingLocationDataSource.startAsync()
I've also tried like this:
routeTracker = RouteTracker(activity, routeResult, 0, true)
mapView.locationDisplay.addLocationChangedListener { locationChangedEvent ->
routeTracker.trackLocationAsync(locationChangedEvent.location)
}
I even made SimulatedLocationDataSource. When I made it like in sample (Navigate a route) locationDisplay didn't appear:
val simulationParameters = SimulationParameters(Calendar.getInstance(), 35.0, 5.0, 5.0)
val simulatedLocationDataSource = SimulatedLocationDataSource().apply { setLocations(routeGeometry, simulationParameters) }
val routeTrackerLocationDataSource = RouteTrackerLocationDataSource(routeTracker, simulatedLocationDataSource)
mapView.locationDisplay.locationDataSource = routeTrackerLocationDataSource
mapView.locationDisplay.addLocationChangedListener { locationChangedEvent ->
routeTracker.trackLocationAsync(locationChangedEvent.location)
}
But wen I made it like this, the location was moving along the route, but routeTracker still didn't receive any callbacks and trackingStatus was still null:
val simulationParameters = SimulationParameters(Calendar.getInstance(), 35.0, 5.0, 5.0)
val simulatedLocationDataSource = SimulatedLocationDataSource().apply { setLocations(routeGeometry, simulationParameters) }
mapView.locationDisplay.locationDataSource = simulatedLocationDataSource
mapView.locationDisplay.addLocationChangedListener { locationChangedEvent ->
routeTracker.trackLocationAsync(locationChangedEvent.location)
}
I passed directly simulatedLocationDataSource to the locationDataSource, without creating RouteTrackerLocationDataSource. So maybe there is a problem with RouteTracker.
I've created a Network Dataset using Arcgis Pro. It supports directions and everything seems to work fine with the network dataset. I'm loading it from a mobile map package. Changing network dataset from the one I created to world routing service: https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World also didn't help.
I'm using 100.15.0 version.