diff options
author | vng <viktor.govako@gmail.com> | 2011-01-28 10:50:15 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:11:06 +0300 |
commit | 9292651e891607c52a73c4c43125637e30e4fb40 (patch) | |
tree | 589e5362076b8111e9580289c26ee74ed64ba775 /map/feature_vec_model.cpp | |
parent | 9263e8a91c53899a0356c8df30dfcbe7dd28824c (diff) |
Fix initial model rect: if empty, return MercatorBounds. Check for maximum screen scale level (limited by MercatorBounds).
Diffstat (limited to 'map/feature_vec_model.cpp')
-rw-r--r-- | map/feature_vec_model.cpp | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp index a629301a08..f280b16672 100644 --- a/map/feature_vec_model.cpp +++ b/map/feature_vec_model.cpp @@ -18,11 +18,6 @@ namespace model { -FeaturesFetcher::FeaturesFetcher() -{ - Clean(); -} - void FeaturesFetcher::InitClassificator() { Platform & p = GetPlatform(); @@ -57,12 +52,22 @@ void FeaturesFetcher::RemoveMap(string const & fName) void FeaturesFetcher::Clean() { - m_rect = m2::RectD(MercatorBounds::minX, + m_rect.MakeEmpty(); + m_multiIndex.Clean(); +} + +m2::RectD FeaturesFetcher::GetWorldRect() const +{ + if (m_rect == m2::RectD()) + { + // rect is empty when now countries are loaded + // return max global rect + return m2::RectD(MercatorBounds::minX, MercatorBounds::minY, MercatorBounds::maxX, MercatorBounds::maxY); -// m_rect.MakeEmpty(); - m_multiIndex.Clean(); + } + return m_rect; } } |