diff --git a/android/jni/com/mapswithme/maps/SearchEngine.cpp b/android/jni/com/mapswithme/maps/SearchEngine.cpp index b05c33286f..0e10845d77 100644 --- a/android/jni/com/mapswithme/maps/SearchEngine.cpp +++ b/android/jni/com/mapswithme/maps/SearchEngine.cpp @@ -343,6 +343,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b jni::TScopedLocalRef address(env, jni::ToJavaString(env, result.GetAddress())); jni::TScopedLocalRef dist(env, jni::ToJavaString(env, distance)); jni::TScopedLocalRef cuisine(env, jni::ToJavaString(env, result.GetCuisine())); + jni::TScopedLocalRef airportIata(env, jni::ToJavaString(env, result.GetAirportIata())); jni::TScopedLocalRef pricing(env, jni::ToJavaString(env, result.GetHotelApproximatePricing())); @@ -353,7 +354,7 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b jni::TScopedLocalRef desc(env, env->NewObject(g_descriptionClass, g_descriptionConstructor, featureId.get(), featureType.get(), address.get(), - dist.get(), cuisine.get(), + dist.get(), cuisine.get(), airportIata.get(), pricing.get(), rating, result.GetStarsCount(), static_cast(result.IsOpenNow()), @@ -647,7 +648,7 @@ extern "C" g_descriptionConstructor = jni::GetConstructorID(env, g_descriptionClass, "(Lcom/mapswithme/maps/bookmarks/data/FeatureId;" "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;" - "Ljava/lang/String;Ljava/lang/String;FIIZ)V"); + "Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;FIIZ)V"); g_popularityClass = jni::GetGlobalClassRef(env, "com/mapswithme/maps/search/Popularity"); g_popularityConstructor = jni::GetConstructorID(env, g_popularityClass, "(I)V"); diff --git a/android/src/com/mapswithme/maps/search/SearchAdapter.java b/android/src/com/mapswithme/maps/search/SearchAdapter.java index c1281dfbbc..716a92107c 100644 --- a/android/src/com/mapswithme/maps/search/SearchAdapter.java +++ b/android/src/com/mapswithme/maps/search/SearchAdapter.java @@ -249,6 +249,10 @@ class SearchAdapter extends RecyclerView.Adapter 0) [self setInfoRating:starsCount]; else if (cuisine.length > 0) [self setInfoText:cuisine.capitalizedString]; + else if (airportIata.length > 0) + [self setInfoText:airportIata]; else [self clearInfo]; diff --git a/map/place_page_info.cpp b/map/place_page_info.cpp index 9903eeaac6..5a7948b9e7 100644 --- a/map/place_page_info.cpp +++ b/map/place_page_info.cpp @@ -106,6 +106,11 @@ string Info::FormatSubtitle(bool withType) const for (string const & cuisine : GetLocalizedCuisines()) subtitle.push_back(cuisine); + // Airport IATA code. + string const iata = GetAirportIata(); + if (!iata.empty()) + subtitle.push_back(iata); + // Stars. string const stars = FormatStars(); if (!stars.empty()) diff --git a/search/intermediate_result.cpp b/search/intermediate_result.cpp index face3131b2..9995481cdf 100644 --- a/search/intermediate_result.cpp +++ b/search/intermediate_result.cpp @@ -196,6 +196,7 @@ void ProcessMetadata(FeatureType & ft, Result::Metadata & meta) feature::Metadata const & src = ft.GetMetadata(); meta.m_cuisine = src.Get(feature::Metadata::FMD_CUISINE); + meta.m_airportIata = src.Get(feature::Metadata::FMD_AIRPORT_IATA); string const openHours = src.Get(feature::Metadata::FMD_OPEN_HOURS); if (!openHours.empty()) diff --git a/search/result.hpp b/search/result.hpp index 41631e44d0..b971b51e37 100644 --- a/search/result.hpp +++ b/search/result.hpp @@ -45,6 +45,9 @@ public: // Valid only if not empty, used for restaurants. std::string m_cuisine; + // Valid only if not empty, used for airport iata codes. + std::string m_airportIata; + // Following fields are used for hotels only. int m_hotelPricing = 0; std::string m_hotelApproximatePricing; @@ -80,6 +83,7 @@ public: std::string const & GetString() const { return m_str; } std::string const & GetAddress() const { return m_address; } std::string const & GetCuisine() const { return m_metadata.m_cuisine; } + std::string const & GetAirportIata() const { return m_metadata.m_airportIata; } float GetHotelRating() const { return m_metadata.m_hotelRating; } std::string const & GetHotelApproximatePricing() const {