Skip to content

Commit

Permalink
[LP][bookmarks] Show metainformatioin for LP bookmarks the same way a…
Browse files Browse the repository at this point in the history
…s for ordinary feature. MAPSME-14904
  • Loading branch information
tomilov authored and Polas committed Nov 30, 2020
1 parent 817d7f6 commit cd2f929
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions android/jni/com/mapswithme/maps/UserMarkHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ jobject CreateBookmark(JNIEnv *env, const place_page::Info &info,
info.CanBeRated(), info.CanBeReviewed(), jratings.get(), hotelType.get(), priceRate,
popularity.get(), jDescription.get(), info.IsTopChoice(), jrawTypes.get());

if (info.IsFeature())
if (info.HasMetadata())
InjectMetadata(env, g_mapObjectClazz, mapObject, info.GetMetadata());
return mapObject;
}
Expand Down Expand Up @@ -298,11 +298,11 @@ jobject CreateMapObject(JNIEnv * env, place_page::Info const & info)
return CreateMapObject(
env, info.GetID().GetMwmName(), info.GetID().GetMwmVersion(), info.GetID().m_index, kPoi,
info.GetTitle(), info.GetSecondaryTitle(), info.GetSubtitle(), ll.m_lat, ll.m_lon,
info.GetAddress(), info.IsFeature() ? info.GetMetadata() : Metadata(), "", jbanners.get(),
info.GetAddress(), info.HasMetadata() ? info.GetMetadata() : Metadata(), "", jbanners.get(),
jTaxiTypes.get(), info.GetBookingSearchUrl(), localAdInfo.get(), routingPointInfo.get(),
info.GetOpeningMode(), info.ShouldShowUGC(), info.CanBeRated(), info.CanBeReviewed(),
jratings.get(), hotelType.get(), priceRate, popularity.get(),
info.GetDescription(), info.GetRoadType(), info.IsTopChoice(), jrawTypes.get());
jratings.get(), hotelType.get(), priceRate, popularity.get(), info.GetDescription(),
info.GetRoadType(), info.IsTopChoice(), jrawTypes.get());
}

jobjectArray ToBannersArray(JNIEnv * env, std::vector<ads::Banner> const & banners)
Expand Down
3 changes: 3 additions & 0 deletions map/place_page_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ bool Info::ShouldShowUGC() const
void Info::SetFromFeatureType(FeatureType & ft)
{
MapObject::SetFromFeatureType(ft);
m_hasMetadata = true;

std::string primaryName;
std::string secondaryName;
GetPrefferedNames(primaryName, secondaryName);
Expand Down Expand Up @@ -247,6 +249,7 @@ void Info::SetFromBookmarkProperties(kml::Properties const & p)
m_metadata.Set(feature::Metadata::EType::FMD_URL, url->second);
if (auto const isTopChoice = p.find("is_top_choice"); isTopChoice != p.end())
m_isTopChoice = isTopChoice->second == "1";
m_hasMetadata = true;
}

void Info::SetBookmarkId(kml::MarkId bookmarkId)
Expand Down
3 changes: 3 additions & 0 deletions map/place_page_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ class Info : public osm::MapObject
bool IsRoutePoint() const { return m_isRoutePoint; }
bool IsRoadType() const { return m_roadType != RoadWarningMarkType::Count; }
bool IsGuide() const { return m_isGuide; }
bool HasMetadata() const { return m_hasMetadata; }

/// Edit and add
bool ShouldShowAddPlace() const;
Expand Down Expand Up @@ -364,6 +365,8 @@ class Info : public osm::MapObject
kml::TrackId m_trackId = kml::kInvalidTrackId;
/// Whether to show "Must See".
bool m_isTopChoice = false;
/// Whether to treat it as plain feature.
bool m_hasMetadata = false;

/// Guide
bool m_isGuide = false;
Expand Down

0 comments on commit cd2f929

Please sign in to comment.