[elevation] Track is interactive if 'has_elevation_profile' property is set in corresponding kml

This commit is contained in:
Anatoliy Tomilov 2020-05-28 13:33:15 +05:00 committed by Daria Volvenkova
parent f867bb4a14
commit 4609e73b34
3 changed files with 9 additions and 1 deletions

View file

@ -52,6 +52,7 @@ std::string GetBookmarkIconType(kml::BookmarkIcon const & icon)
}
std::string const kCustomImageProperty = "CustomImage";
std::string const kHasElevationProfileProperty = "has_elevation_profile";
} // namespace
Bookmark::Bookmark(m2::PointD const & ptOrg)
@ -354,6 +355,12 @@ bool BookmarkCategory::IsCategoryFromCatalog() const
return FromCatalog(m_data, m_serverId);
}
bool BookmarkCategory::HasElevationProfile() const
{
auto const it = m_data.m_properties.find(kHasElevationProfileProperty);
return (it != m_data.m_properties.end()) && (it->second != "0");
}
std::string BookmarkCategory::GetCatalogDeeplink() const
{
if (kDeepLinkUrl.empty())

View file

@ -96,6 +96,7 @@ public:
std::string const & GetServerId() const { return m_serverId; }
bool IsCategoryFromCatalog() const;
bool HasElevationProfile() const;
std::string GetCatalogDeeplink() const;
std::string GetCatalogPublicLink() const;

View file

@ -2857,7 +2857,7 @@ void BookmarkManager::CreateCategories(KMLDataCollection && dataCollection, bool
}
for (auto & trackData : fileData.m_tracksData)
{
auto track = std::make_unique<Track>(std::move(trackData), group->IsCategoryFromCatalog());
auto track = std::make_unique<Track>(std::move(trackData), group->HasElevationProfile());
auto * t = AddTrack(std::move(track));
t->Attach(groupId);
group->AttachTrack(t->GetId());