forked from organicmaps/organicmaps
[search] Fixed min viewport size for search.
This commit is contained in:
parent
6fcf5d0ad7
commit
ca9a449aae
1 changed files with 10 additions and 4 deletions
|
@ -231,13 +231,19 @@ bool IsStopWord(strings::UniString const & s)
|
|||
return kStopWords.count(s) > 0;
|
||||
}
|
||||
|
||||
m2::RectD NormalizeViewport(m2::RectD const & viewport)
|
||||
m2::RectD NormalizeViewport(m2::RectD viewport)
|
||||
{
|
||||
double constexpr kMinViewportRadiusM = 5.0 * 1000;
|
||||
double constexpr kMaxViewportRadiusM = 50.0 * 1000;
|
||||
m2::RectD limit =
|
||||
|
||||
m2::RectD minViewport =
|
||||
MercatorBounds::RectByCenterXYAndSizeInMeters(viewport.Center(), kMinViewportRadiusM);
|
||||
viewport.Add(minViewport);
|
||||
|
||||
m2::RectD maxViewport =
|
||||
MercatorBounds::RectByCenterXYAndSizeInMeters(viewport.Center(), kMaxViewportRadiusM);
|
||||
VERIFY(limit.Intersect(viewport), ());
|
||||
return limit;
|
||||
VERIFY(viewport.Intersect(maxViewport), ());
|
||||
return viewport;
|
||||
}
|
||||
|
||||
m2::RectD GetRectAroundPoistion(m2::PointD const & position)
|
||||
|
|
Loading…
Add table
Reference in a new issue