Reputation: 826
I try to use zoom levels config like this:
SKZoomLevelConfiguration[] zoomLevelConfigurations = new SKZoomLevelConfiguration[]{
new SKZoomLevelConfiguration(0, 10, 16.5f),
new SKZoomLevelConfiguration(10, 40, 16f),
new SKZoomLevelConfiguration(40, 70, 15f),
new SKZoomLevelConfiguration(70, 150, 14.5f),
};
navigationSettings.setZoomLevelConfigurations(zoomLevelConfigurations);
navigationManager.startNavigation(navigationSettings);
Its working good. But in some cases i need to disable this auto-changes of zoom (for example, if user press zoom out or zoom in - we need to fixate selected by user zoom for next few seconds).
How can i disable this configuration without stop/start navigation?
Also, second question - how can i change duration for zoom levels configuration animation?
SDK version 2.5.1
Upvotes: 1
Views: 69
Reputation: 1577
1) To disable the auto-changes of the zoom level: An example can be found in the demo project: Car navigation UI -> Calculate routes -> Start navigation -> Pan/zoom -> Map follower mode is set to SKMapSettings.SKMapFollowerMode.NONE_WITH_HEADING -> Press back button -> Map is set in navigation mode
Pressing zoom out or zoom in onActionZoom() method is called:
@Override
public void onActionZoom() {
// switch to panning mode
SKMapSettings mapSettings = mapView.getMapSettings();
mapSettings.setInertiaPanningEnabled(true);
mapSettings.setMapZoomingEnabled(true);
mapSettings.setMapRotationEnabled(true);
mapView.getMapSettings().setFollowerMode(SKMapSettings.SKMapFollowerMode.NONE_WITH_HEADING);
mapView.getMapSettings().setMapDisplayMode(SKMapSettings.SKMapDisplayMode.MODE_2D);
}
Note: The auto-changes of zoom works only in SKMapSettings.SKMapDisplayMode.MODE_2D.
2) To change the duration for zoom levels configuration: this feature is not supported for the moment
Upvotes: 1