mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[types] Christmas trees
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
committed by
Yannik Bloscheck
parent
a1944435ae
commit
6c02e1d53a
@@ -1451,4 +1451,5 @@
|
||||
<string name="type.amenity.payment_centre">Zahlungszentrum</string>
|
||||
<string name="type.social_facility.soup_kitchen">Suppenküche</string>
|
||||
<string name="type.social_facility.food_bank">Tafel</string>
|
||||
<string name="type.xmas.tree">Weihnachtsbaum</string>
|
||||
</resources>
|
||||
|
||||
@@ -1462,4 +1462,5 @@
|
||||
<string name="type.amenity.dojo">Dojo</string>
|
||||
<!-- https://wiki.openstreetmap.org/wiki/Tag:leisure=sports_hall -->
|
||||
<string name="type.leisure.sports_hall">Sports hall</string>
|
||||
<string name="type.xmas.tree">Christmas Tree</string>
|
||||
</resources>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 7 and column 16.
|
1
data/styles/default/dark/symbols/christmas-tree-m.svg
Normal file
1
data/styles/default/dark/symbols/christmas-tree-m.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m8 15h2v3h-2z" fill="#633d18"/><path d="m9 4.5 1.5 1.5h-.87530378l1.87530378 1.5h-1.3333038l2.3333038 2h-1.6123038l2.5 2.5h-1.427l2.5393038 3h-11l2.53869622-3h-1.651l2.5-2.5h-1.38769621l2.33269621-2h-1.33269622l1.87469622-1.5h-.87469622z" fill="#5a682e"/><path d="m10.3477837 9.5c.2761423 0 .5-.22385763.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.50000003.22385763-.50000003.5s.22385763.5.50000003.5zm-1.46008748-2c.27614237 0 .5-.22385763.5-.5s-.22385763-.5-.5-.5c-.27614238 0-.5.22385763-.5.5s.22385762.5.5.5zm-1.88769622 2.5c.27614237 0 .5-.22385763.5-.5s-.22385763-.5-.5-.5-.5.22385763-.5.5.22385763.5.5.5zm4.8477837 1.6115873c.2761423 0 .5-.2238576.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.5.2238576-.5.5s.2238576.5.5.5zm-.5 2.5c.2761423 0 .5-.2238576.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.5.2238576-.5.5s.2238576.5.5.5zm-2.84778369-1.1115873c.27614238 0 .5-.2238576.5-.5s-.22385762-.5-.5-.5c-.27614237 0-.5.2238576-.5.5s.22385763.5.5.5zm-3 1.6115873c.27614238 0 .5-.2238576.5-.5s-.22385762-.5-.5-.5c-.27614237 0-.5.2238576-.5.5s.22385763.5.5.5z" fill="#711"/><path d="m9 4.58369049-1.79615045.94429217.34303421-2.00004292-1.45311623-1.41643825 2.00815725-.29180233.89807522-1.81969916.89807522 1.81969916 2.00815728.29180233-1.4531163 1.41643825.3430342 2.00004292z" fill="#a5871d"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -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],
|
||||
|
||||
@@ -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-)
|
||||
|
||||
1
data/styles/default/light/symbols/christmas-tree-m.svg
Normal file
1
data/styles/default/light/symbols/christmas-tree-m.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m8 15h2v3h-2z" fill="#5b3919"/><path d="m9 4.5 1.5 1.5h-.87530378l1.87530378 1.5h-1.3333038l2.3333038 2h-1.6123038l2.5 2.5h-1.427l2.5393038 3h-11l2.53869622-3h-1.651l2.5-2.5h-1.38769621l2.33269621-2h-1.33269622l1.87469622-1.5h-.87469622z" fill="#a2ba4e"/><path d="m10.3477837 9.5c.2761423 0 .5-.22385763.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.50000003.22385763-.50000003.5s.22385763.5.50000003.5zm-1.46008748-2c.27614237 0 .5-.22385763.5-.5s-.22385763-.5-.5-.5c-.27614238 0-.5.22385763-.5.5s.22385762.5.5.5zm-1.88769622 2.5c.27614237 0 .5-.22385763.5-.5s-.22385763-.5-.5-.5-.5.22385763-.5.5.22385763.5.5.5zm4.8477837 1.6115873c.2761423 0 .5-.2238576.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.5.2238576-.5.5s.2238576.5.5.5zm-.5 2.5c.2761423 0 .5-.2238576.5-.5s-.2238577-.5-.5-.5c-.2761424 0-.5.2238576-.5.5s.2238576.5.5.5zm-2.84778369-1.1115873c.27614238 0 .5-.2238576.5-.5s-.22385762-.5-.5-.5c-.27614237 0-.5.2238576-.5.5s.22385763.5.5.5zm-3 1.6115873c.27614238 0 .5-.2238576.5-.5s-.22385762-.5-.5-.5c-.27614237 0-.5.2238576-.5.5s.22385763.5.5.5z" fill="#cf1212"/><path d="m9 4.58369049-1.79615045.94429217.34303421-2.00004292-1.45311623-1.41643825 2.00815725-.29180233.89807522-1.81969916.89807522 1.81969916 2.00815728.29180233-1.4531163 1.41643825.3430342 2.00004292z" fill="#ffc700"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -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-)
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -1564,3 +1564,5 @@
|
||||
|
||||
/* https://wiki.openstreetmap.org/wiki/Tag:leisure=sports_hall */
|
||||
"type.leisure.sports_hall" = "Sports hall";
|
||||
|
||||
"type.xmas.tree" = "Christmas Tree";
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -61,6 +61,7 @@ private:
|
||||
bool CheckCancelled();
|
||||
|
||||
bool IsDiscardCustomFeature(FeatureID const & id) const;
|
||||
bool IsHiddenChristmasFeature(FeatureType & f) const;
|
||||
|
||||
TCheckCancelledCallback m_checkCancelled;
|
||||
TIsCountryLoadedByNameFn m_isLoadedFn;
|
||||
|
||||
@@ -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"}));
|
||||
|
||||
@@ -511,6 +511,14 @@ public:
|
||||
DECLARE_CHECKER_INSTANCE(IsTaxiChecker);
|
||||
};
|
||||
|
||||
class IsChristmasChecker : public BaseChecker
|
||||
{
|
||||
IsChristmasChecker();
|
||||
|
||||
public:
|
||||
DECLARE_CHECKER_INSTANCE(IsChristmasChecker);
|
||||
};
|
||||
|
||||
class IsMotorwayJunctionChecker : public BaseChecker
|
||||
{
|
||||
IsMotorwayJunctionChecker();
|
||||
|
||||
Reference in New Issue
Block a user