From 6c02e1d53a91e9c08e3a3184f720c426a9f08d84 Mon Sep 17 00:00:00 2001 From: Yannik Bloscheck Date: Sat, 15 Nov 2025 12:54:29 +0100 Subject: [PATCH] [types] Christmas trees Signed-off-by: Yannik Bloscheck --- .../sdk/src/main/res/values-de/types_strings.xml | 1 + android/sdk/src/main/res/values/types_strings.xml | 1 + data/mapcss-mapping.csv | 2 +- .../default/dark/symbols/christmas-tree-m.svg | 1 + data/styles/default/include/Icons.mapcss | 3 +++ .../default/include/priorities_4_overlays.prio.txt | 3 +++ .../default/light/symbols/christmas-tree-m.svg | 1 + .../include/priorities_4_overlays.prio.txt | 3 +++ .../de.lproj/LocalizableTypes.strings | 1 + .../en-GB.lproj/LocalizableTypes.strings | 1 + .../en.lproj/LocalizableTypes.strings | 2 ++ libs/drape_frontend/rule_drawer.cpp | 14 ++++++++++++-- libs/drape_frontend/rule_drawer.hpp | 1 + libs/indexer/ftypes_matcher.cpp | 6 ++++++ libs/indexer/ftypes_matcher.hpp | 8 ++++++++ 15 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 data/styles/default/dark/symbols/christmas-tree-m.svg create mode 100644 data/styles/default/light/symbols/christmas-tree-m.svg diff --git a/android/sdk/src/main/res/values-de/types_strings.xml b/android/sdk/src/main/res/values-de/types_strings.xml index 8ca9e881a..275c7a69e 100644 --- a/android/sdk/src/main/res/values-de/types_strings.xml +++ b/android/sdk/src/main/res/values-de/types_strings.xml @@ -1451,4 +1451,5 @@ Zahlungszentrum Suppenküche Tafel + Weihnachtsbaum diff --git a/android/sdk/src/main/res/values/types_strings.xml b/android/sdk/src/main/res/values/types_strings.xml index 252089550..cdea93b89 100644 --- a/android/sdk/src/main/res/values/types_strings.xml +++ b/android/sdk/src/main/res/values/types_strings.xml @@ -1462,4 +1462,5 @@ Dojo Sports hall + Christmas Tree diff --git a/data/mapcss-mapping.csv b/data/mapcss-mapping.csv index 701e934b1..e67bea10c 100644 --- a/data/mapcss-mapping.csv +++ b/data/mapcss-mapping.csv @@ -618,7 +618,7 @@ amenity|parking|park_and_ride;[amenity=parking][parking=park_and_ride];;name;int waterway|fish_pass;496; waterway|fish_pass|tunnel;[waterway=fish_pass][tunnel?];;name;int_name;497; natural|water|lock;[natural=water][water=lock];;name;int_name;498; -deprecated:waterway|lock:06.2022;499;waterway|canal +xmas|tree;[xmas:feature=tree];;name;int_name;499; fee|yes;[fee?];;name;int_name;500; fee|no;[fee=not],[fee=no];;name;int_name;501; toilets|yes;502; diff --git a/data/styles/default/dark/symbols/christmas-tree-m.svg b/data/styles/default/dark/symbols/christmas-tree-m.svg new file mode 100644 index 000000000..a34a4cf1a --- /dev/null +++ b/data/styles/default/dark/symbols/christmas-tree-m.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/styles/default/include/Icons.mapcss b/data/styles/default/include/Icons.mapcss index 870b5882d..5166a97f2 100644 --- a/data/styles/default/include/Icons.mapcss +++ b/data/styles/default/include/Icons.mapcss @@ -206,6 +206,9 @@ node|z19-[man_made=water_well][drinking_water=not], node|z19-[amenity=water_point][drinking_water=not], {icon-image: drinking-water-no-m.svg;} +node|z18-[xmas:feature=tree], +{icon-image: christmas-tree-m.svg;} + /* 3. TRANSPORT */ node|z12-[railway=station], diff --git a/data/styles/default/include/priorities_4_overlays.prio.txt b/data/styles/default/include/priorities_4_overlays.prio.txt index 489cef04a..24f658bfc 100644 --- a/data/styles/default/include/priorities_4_overlays.prio.txt +++ b/data/styles/default/include/priorities_4_overlays.prio.txt @@ -2259,6 +2259,9 @@ leisure-swimming_pool-private # icon z17- (also has captio # shop # caption(optional) z18- (also has icon z18-) # === -9530 +xmas-tree # icon z18- +=== -9540 + # amenity-bbq # caption(optional) z18- (also has icon z18-) # amenity-luggage_locker # caption(optional) z19- (also has icon z17-) # amenity-public_bookcase # caption(optional) z18- (also has icon z18-) diff --git a/data/styles/default/light/symbols/christmas-tree-m.svg b/data/styles/default/light/symbols/christmas-tree-m.svg new file mode 100644 index 000000000..45181a263 --- /dev/null +++ b/data/styles/default/light/symbols/christmas-tree-m.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/data/styles/outdoors/include/priorities_4_overlays.prio.txt b/data/styles/outdoors/include/priorities_4_overlays.prio.txt index c84f7b115..9884f5d9d 100644 --- a/data/styles/outdoors/include/priorities_4_overlays.prio.txt +++ b/data/styles/outdoors/include/priorities_4_overlays.prio.txt @@ -2264,6 +2264,9 @@ leisure-swimming_pool-private # icon z17- (also has captio # shop # caption(optional) z18- (also has icon z18-) # === -9530 +xmas-tree # icon z18- +=== -9540 + # amenity-bbq # caption(optional) z17- (also has icon z16-) # amenity-luggage_locker # caption(optional) z19- (also has icon z17-) # amenity-public_bookcase # caption(optional) z18- (also has icon z18-) diff --git a/iphone/Maps/LocalizedStrings/de.lproj/LocalizableTypes.strings b/iphone/Maps/LocalizedStrings/de.lproj/LocalizableTypes.strings index 6a90f2c3c..c58f2c49d 100644 --- a/iphone/Maps/LocalizedStrings/de.lproj/LocalizableTypes.strings +++ b/iphone/Maps/LocalizedStrings/de.lproj/LocalizableTypes.strings @@ -1539,3 +1539,4 @@ "type.amenity.payment_centre" = "Zahlungszentrum"; "type.social_facility.food_bank" = "Tafel"; "type.social_facility.soup_kitchen" = "Suppenküche"; +"type.xmas.tree" = "Weihnachtsbaum"; diff --git a/iphone/Maps/LocalizedStrings/en-GB.lproj/LocalizableTypes.strings b/iphone/Maps/LocalizedStrings/en-GB.lproj/LocalizableTypes.strings index 2b6a8a298..088477922 100644 --- a/iphone/Maps/LocalizedStrings/en-GB.lproj/LocalizableTypes.strings +++ b/iphone/Maps/LocalizedStrings/en-GB.lproj/LocalizableTypes.strings @@ -1544,3 +1544,4 @@ "type.office.security" = "Security Guards Office"; "type.power.portal" = "Power Portal"; "type.building.guardhouse" = "Security Booth"; +"type.xmas.tree" = "Christmas Tree"; diff --git a/iphone/Maps/LocalizedStrings/en.lproj/LocalizableTypes.strings b/iphone/Maps/LocalizedStrings/en.lproj/LocalizableTypes.strings index a65e9b7d9..0d2d07a0a 100644 --- a/iphone/Maps/LocalizedStrings/en.lproj/LocalizableTypes.strings +++ b/iphone/Maps/LocalizedStrings/en.lproj/LocalizableTypes.strings @@ -1564,3 +1564,5 @@ /* https://wiki.openstreetmap.org/wiki/Tag:leisure=sports_hall */ "type.leisure.sports_hall" = "Sports hall"; + +"type.xmas.tree" = "Christmas Tree"; diff --git a/libs/drape_frontend/rule_drawer.cpp b/libs/drape_frontend/rule_drawer.cpp index d82670128..55c45fc3d 100644 --- a/libs/drape_frontend/rule_drawer.cpp +++ b/libs/drape_frontend/rule_drawer.cpp @@ -216,6 +216,16 @@ bool RuleDrawer::IsDiscardCustomFeature(FeatureID const & id) const return m_customFeaturesContext && m_customFeaturesContext->NeedDiscardGeometry(id); } +bool RuleDrawer::IsHiddenChristmasFeature(FeatureType & f) const +{ + if (!ftypes::IsChristmasChecker::Instance()(feature::TypesHolder(f))) + return false; + + time_t time = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now()); + tm local_time = *localtime(&time); + return !((local_time.tm_mon == 11 && local_time.tm_mday >= 6) || (local_time.tm_mon == 0 && local_time.tm_mday <= 6)); +} + bool RuleDrawer::CheckCoastlines(FeatureType & f) { if (m_zoomLevel > scales::GetUpperWorldScale() && f.GetID().m_mwmId.GetInfo()->GetType() == MwmInfo::COASTS) @@ -303,7 +313,7 @@ void RuleDrawer::ProcessAreaAndPointStyle(FeatureType & f, Stylist const & s, TI } /// @todo Can we put this check in the beginning of this function? - if (applyPointStyle && !IsDiscardCustomFeature(f.GetID())) + if (applyPointStyle && !IsDiscardCustomFeature(f.GetID()) && !IsHiddenChristmasFeature(f)) { apply.ProcessPointRules(s.m_symbolRule, s.m_captionRule, s.m_houseNumberRule, featureCenter, m_context->GetTextureManager()); @@ -381,7 +391,7 @@ void RuleDrawer::ProcessLineStyle(FeatureType & f, Stylist const & s, TInsertSha void RuleDrawer::ProcessPointStyle(FeatureType & f, Stylist const & s, TInsertShapeFn const & insertShape) { - if (IsDiscardCustomFeature(f.GetID())) + if (IsDiscardCustomFeature(f.GetID()) || IsHiddenChristmasFeature(f)) return; ApplyPointFeature apply(m_context->GetTileKey(), insertShape, f, s.GetCaptionDescription()); diff --git a/libs/drape_frontend/rule_drawer.hpp b/libs/drape_frontend/rule_drawer.hpp index 2b8d6089a..05868dcc4 100644 --- a/libs/drape_frontend/rule_drawer.hpp +++ b/libs/drape_frontend/rule_drawer.hpp @@ -61,6 +61,7 @@ private: bool CheckCancelled(); bool IsDiscardCustomFeature(FeatureID const & id) const; + bool IsHiddenChristmasFeature(FeatureType & f) const; TCheckCancelledCallback m_checkCancelled; TIsCountryLoadedByNameFn m_isLoadedFn; diff --git a/libs/indexer/ftypes_matcher.cpp b/libs/indexer/ftypes_matcher.cpp index ccb754e48..7a57a7305 100644 --- a/libs/indexer/ftypes_matcher.cpp +++ b/libs/indexer/ftypes_matcher.cpp @@ -746,6 +746,12 @@ IsTaxiChecker::IsTaxiChecker() m_types.push_back(c.GetTypeByPath({"amenity", "taxi"})); } +IsChristmasChecker::IsChristmasChecker() +{ + Classificator const & c = classif(); + m_types.push_back(c.GetTypeByPath({"xmas", "tree"})); +} + IsMotorwayJunctionChecker::IsMotorwayJunctionChecker() { m_types.push_back(classif().GetTypeByPath({"highway", "motorway_junction"})); diff --git a/libs/indexer/ftypes_matcher.hpp b/libs/indexer/ftypes_matcher.hpp index ed7f5d575..af22c3938 100644 --- a/libs/indexer/ftypes_matcher.hpp +++ b/libs/indexer/ftypes_matcher.hpp @@ -511,6 +511,14 @@ public: DECLARE_CHECKER_INSTANCE(IsTaxiChecker); }; +class IsChristmasChecker : public BaseChecker +{ + IsChristmasChecker(); + +public: + DECLARE_CHECKER_INSTANCE(IsChristmasChecker); +}; + class IsMotorwayJunctionChecker : public BaseChecker { IsMotorwayJunctionChecker();