Autozoom is enabled by default. Autozoom parameters are tuned.

This commit is contained in:
Daria Volvenkova 2016-07-20 13:30:41 +03:00
parent 0c9f7e91df
commit d068ba8e2b
3 changed files with 11 additions and 9 deletions

View file

@ -196,8 +196,8 @@ ScaleInterpolator::ScaleInterpolator(double delay, double startScale, double end
// static
double ScaleInterpolator::GetScaleDuration(double startScale, double endScale, bool isAutoZoom)
{
// Resize 2.0 times should be done for 1.5 seconds in autozoom or for 0.2 seconds in usual case.
double const kPixelSpeed = isAutoZoom ? (2.0 / 1.5) : (2.0 / 0.2);
// Resize 2.0 times should be done for 1.2 seconds in autozoom or for 0.2 seconds in usual case.
double const kPixelSpeed = isAutoZoom ? (2.0 / 1.2) : (2.0 / 0.2);
if (startScale > endScale)
swap(startScale, endScale);

View file

@ -73,9 +73,9 @@ double CalculateZoomBySpeed(double speed)
make_pair(20.0, 0.25),
make_pair(40.0, 0.5),
make_pair(60.0, 1.0),
make_pair(80.0, 1.75),
make_pair(100.0, 3.5),
make_pair(120.0, 7.0),
make_pair(75.0, 1.75),
make_pair(85.0, 3.5),
make_pair(90.0, 7.0),
};
double const kDefaultSpeed = 80.0;

View file

@ -2272,11 +2272,13 @@ void Framework::FollowRoute()
return;
bool const isPedestrianRoute = m_currentRouterType == RouterType::Pedestrian;
bool const enableAutoZoom = isPedestrianRoute ? false : LoadAutoZoom();
int const scale = isPedestrianRoute ? scales::GetPedestrianNavigationScale()
: scales::GetNavigationScale();
int const scale3d = isPedestrianRoute ? scales::GetPedestrianNavigation3dScale()
: scales::GetNavigation3dScale();
bool const enableAutoZoom = isPedestrianRoute ? false : LoadAutoZoom();
int scale3d = isPedestrianRoute ? scales::GetPedestrianNavigation3dScale()
: scales::GetNavigation3dScale();
if (enableAutoZoom)
++scale3d;
m_drapeEngine->FollowRoute(scale, scale3d, enableAutoZoom);
m_drapeEngine->SetRoutePoint(m2::PointD(), true /* isStart */, false /* isValid */);
@ -2541,7 +2543,7 @@ void Framework::Load3dMode(bool & allow3d, bool & allow3dBuildings)
bool Framework::LoadAutoZoom()
{
bool allowAutoZoom = false;
bool allowAutoZoom = true;
settings::Get(kAllowAutoZoom, allowAutoZoom);
return allowAutoZoom;
}