diff --git a/android/jni/com/mapswithme/maps/Framework.cpp b/android/jni/com/mapswithme/maps/Framework.cpp index f9dec046b9..946e2a6a84 100644 --- a/android/jni/com/mapswithme/maps/Framework.cpp +++ b/android/jni/com/mapswithme/maps/Framework.cpp @@ -431,12 +431,6 @@ string Framework::GetOutdatedCountriesString() return res; } -void Framework::ShowTrack(kml::TrackId track) -{ - Track const * nTrack = NativeFramework()->GetBookmarkManager().GetTrack(track); - NativeFramework()->ShowTrack(*nTrack); -} - void Framework::SetTrafficStateListener(TrafficManager::TrafficStateChangedFn const & fn) { m_onTrafficStateChangedFn = fn; @@ -939,7 +933,7 @@ Java_com_mapswithme_maps_Framework_nativeGetScreenRectCenter(JNIEnv * env, jclas JNIEXPORT void JNICALL Java_com_mapswithme_maps_Framework_nativeShowTrackRect(JNIEnv * env, jclass, jlong track) { - g_framework->ShowTrack(static_cast(track)); + frm()->ShowTrack(static_cast(track)); } JNIEXPORT jstring JNICALL diff --git a/android/jni/com/mapswithme/maps/Framework.hpp b/android/jni/com/mapswithme/maps/Framework.hpp index d0747520dc..76d35025b2 100644 --- a/android/jni/com/mapswithme/maps/Framework.hpp +++ b/android/jni/com/mapswithme/maps/Framework.hpp @@ -159,8 +159,6 @@ namespace android std::string GetOutdatedCountriesString(); - void ShowTrack(kml::TrackId track); - void SetMyPositionModeListener(location::TMyPositionModeChanged const & fn); location::EMyPositionMode GetMyPositionMode(); void OnMyPositionModeChanged(location::EMyPositionMode mode); diff --git a/drape_frontend/transit_scheme_builder.cpp b/drape_frontend/transit_scheme_builder.cpp index 0ff61a2eae..1c6c7b4898 100644 --- a/drape_frontend/transit_scheme_builder.cpp +++ b/drape_frontend/transit_scheme_builder.cpp @@ -39,7 +39,6 @@ namespace float constexpr kBaseLineDepth = 0.0f; float constexpr kDepthPerLine = 1.0f; float constexpr kBaseMarkerDepth = 300.0f; -float constexpr kBaseTitleDepth = 400.0f; int constexpr kFinalStationMinZoomLevel = 10; int constexpr kTransferMinZoomLevel = 11; int constexpr kStopMinZoomLevel = 12; diff --git a/iphone/Maps/Bookmarks/BookmarksVC.mm b/iphone/Maps/Bookmarks/BookmarksVC.mm index ddc7c28b41..f42f488bf1 100644 --- a/iphone/Maps/Bookmarks/BookmarksVC.mm +++ b/iphone/Maps/Bookmarks/BookmarksVC.mm @@ -206,21 +206,17 @@ CGFloat const kPinDiameter = 18.0f; case Section::Track: { kml::TrackId const trackId = [self getTrackIdByRow:indexPath.row]; - Track const * tr = bm.GetTrack(trackId); - CHECK(tr, ("NULL track")); - f.ShowTrack(*tr); + f.ShowTrack(trackId); [self.navigationController popToRootViewControllerAnimated:YES]; break; } case Section::Bookmark: { kml::MarkId const bmId = [self getBookmarkIdByRow:indexPath.row]; - Bookmark const * bookmark = bm.GetBookmark(bmId); - CHECK(bookmark, ("NULL bookmark")); [Statistics logEvent:kStatEventName(kStatBookmarks, kStatShowOnMap)]; // Same as "Close". [MWMSearchManager manager].state = MWMSearchManagerStateHidden; - f.ShowBookmark(bookmark); + f.ShowBookmark(bmId); [self.navigationController popToRootViewControllerAnimated:YES]; break; } diff --git a/map/framework.cpp b/map/framework.cpp index c028bbc923..092be7937e 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -984,12 +984,16 @@ void Framework::ShowBookmark(Bookmark const * mark) m_lastTapEvent = MakeTapEvent(info.GetMercator(), info.GetID(), TapEvent::Source::Other); } -void Framework::ShowTrack(Track const & track) +void Framework::ShowTrack(kml::TrackId trackId) { double const kPaddingScale = 1.2; + auto const track = GetBookmarkManager().GetTrack(trackId); + if (track == nullptr) + return; + StopLocationFollow(); - auto rect = track.GetLimitRect(); + auto rect = track->GetLimitRect(); rect.Scale(kPaddingScale); ShowRect(rect); diff --git a/map/framework.hpp b/map/framework.hpp index 2fd551ed3f..99d6106fad 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -329,7 +329,7 @@ public: void ShowBookmark(kml::MarkId id); void ShowBookmark(Bookmark const * bookmark); - void ShowTrack(Track const & track); + void ShowTrack(kml::TrackId trackId); void ShowFeatureByMercator(m2::PointD const & pt); void ShowBookmarkCategory(kml::MarkGroupId categoryId); diff --git a/qt/bookmark_dialog.cpp b/qt/bookmark_dialog.cpp index b96bd87c78..7d0e0203e1 100644 --- a/qt/bookmark_dialog.cpp +++ b/qt/bookmark_dialog.cpp @@ -100,8 +100,8 @@ void BookmarkDialog::OnItemClick(QTreeWidgetItem * item, int column) auto const categoryIt = m_categories.find(item); if (categoryIt != m_categories.cend()) { - m_framework.ShowBookmarkCategory(categoryIt->second); done(0); + m_framework.ShowBookmarkCategory(categoryIt->second); return; } @@ -116,12 +116,8 @@ void BookmarkDialog::OnItemClick(QTreeWidgetItem * item, int column) auto const trackIt = m_tracks.find(item); if (trackIt != m_tracks.cend()) { - auto const track = m_framework.GetBookmarkManager().GetTrack(trackIt->second); - if (track != nullptr) - { - done(0); - m_framework.ShowTrack(*track); - } + done(0); + m_framework.ShowTrack(trackIt->second); return; } } @@ -148,7 +144,7 @@ void BookmarkDialog::OnExportClick() { QMessageBox ask(this); ask.setIcon(QMessageBox::Information); - ask.setText(tr("Select one of bookmarks category to export.")); + ask.setText(tr("Select one of the bookmark categories to export.")); ask.addButton(tr("OK"), QMessageBox::NoRole); ask.exec(); return; @@ -159,7 +155,7 @@ void BookmarkDialog::OnExportClick() { QMessageBox ask(this); ask.setIcon(QMessageBox::Warning); - ask.setText(tr("Selected item is not a bookmarks category.")); + ask.setText(tr("Selected item is not a bookmark category.")); ask.addButton(tr("OK"), QMessageBox::NoRole); ask.exec(); return; @@ -316,10 +312,7 @@ void BookmarkDialog::FillTree() void BookmarkDialog::ShowModal() { - // If called for first time. - if (!m_tree->topLevelItemCount()) - FillTree(); - + FillTree(); exec(); } } // namespace qt