Hi Thom,
As far as I know, autoPanMode will pan, but it will not zoom, so perhaps you can set the zoom level you wish to use before you start the navigation? One way to do this automatically might be to set the AutoPanMode to OFF, set the LocationListener, and start() the LocationDisplayManager. Then just in the first call to onLocationChanged, set the zoom level there, and then switch the AutoPanMode to NAVIGATION. I've added some code as an example below.
Also I will make a note that we could add a sample to demonstrate navigation auto-pan mode, along with the initial zoom in, to the SDK.
mLocationDisplayManager = mMapView.getLocationDisplayManager();
mLocationDisplayManager.setAutoPanMode(AutoPanMode.OFF);
mLocationDisplayManager.setLocationListener(new LocationListener() {
boolean locationChanged = false;
@Override
public void onLocationChanged(Location location) {
if (!locationChanged) {
Point currentPt = new Point(location.getLongitude(), location.getLatitude());
Point currentMapPt = (Point) GeometryEngine.project(currentPt, SpatialReference.create(4326), mMapView.getSpatialReference());
// Use a suitable value for the typical app usage for when no accuracy is available.
float accuracy = 100;
if (location.hasAccuracy()) {
accuracy = location.getAccuracy();
}
// Convert the accuracy to units of the map, and apply a suitable zoom factor for the app.
Unit mapUnits = mMapView.getSpatialReference().getUnit();
double zoomToWidth = 50 * Unit.convertUnits(accuracy, Unit.create(LinearUnit.Code.METER), mapUnits);
Envelope zoomExtent = new Envelope(currentMapPt, zoomToWidth, zoomToWidth);
// Make sure that the initial zoom is dont WITHOUT animation, or it may interfere with autopan.
mMapView.setExtent(zoomExtent, 0, false);
// Dont run this again.
locationChanged = true;
// Now switch to navigation mode.
mLocationDisplayManager.setAutoPanMode(AutoPanMode.NAVIGATION);
}
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
});
mLocationDisplayManager.start();