mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-12 23:34:21 +00:00
[styles] Keep using shorter type for simple charging stations
Signed-off-by: Yannik Bloscheck <git@yannikbloscheck.com>
This commit is contained in:
@@ -196,15 +196,20 @@ void TypesHolder::SortBySpec()
|
||||
|
||||
std::stable_sort(begin(), end(), [&checker, &getPriority, &isChargingStationChecker, &isChargingStationSmallChecker](uint32_t t1, uint32_t t2)
|
||||
{
|
||||
if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return false;
|
||||
else if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return true;
|
||||
|
||||
if (isChargingStationChecker(t1) && !isChargingStationChecker(t2))
|
||||
return true;
|
||||
else if (isChargingStationChecker(t2) && !isChargingStationChecker(t1))
|
||||
return false;
|
||||
if (isChargingStationChecker(t1) && isChargingStationChecker(t2))
|
||||
{
|
||||
if (isChargingStationSmallChecker(t1) && !isChargingStationSmallChecker(t2))
|
||||
return false;
|
||||
else if (!isChargingStationSmallChecker(t1) && isChargingStationSmallChecker(t2))
|
||||
return true;
|
||||
|
||||
uint8_t const t1Level = ftype::GetLevel(t1);
|
||||
uint8_t const t2Level = ftype::GetLevel(t2);
|
||||
if (t1Level == 2 && t2Level != 2)
|
||||
return true;
|
||||
else if (t1Level != 2 && t2Level == 2)
|
||||
return false;
|
||||
}
|
||||
|
||||
int const p1 = getPriority(t1);
|
||||
int const p2 = getPriority(t2);
|
||||
@@ -416,7 +421,7 @@ void FeatureParams::SetRwSubwayType(char const * cityName)
|
||||
FeatureParams::TypesResult FeatureParams::FinishAddingTypesEx()
|
||||
{
|
||||
auto const & cl = classif();
|
||||
auto charingStation = cl.GetTypeByPath({"amenity", "charging_station", "general"});
|
||||
auto charingStation = cl.GetTypeByPath({"amenity", "charging_station"});
|
||||
auto motorcarCharingStation = cl.GetTypeByPath({"amenity", "charging_station", "motorcar"});
|
||||
auto carelessCharingStation = cl.GetTypeByPath({"amenity", "charging_station", "carless"});
|
||||
if (IsTypeExist(charingStation) && !IsTypeExist(motorcarCharingStation) && !IsTypeExist(carelessCharingStation))
|
||||
|
||||
@@ -753,10 +753,10 @@ IsDirectionalChecker::IsDirectionalChecker() : ftypes::BaseChecker(1 /* level */
|
||||
m_types.push_back(c.GetTypeByPath({"lateral"}));
|
||||
}
|
||||
|
||||
IsCharingStationChecker::IsCharingStationChecker() : ftypes::BaseChecker(3 /* level */)
|
||||
IsCharingStationChecker::IsCharingStationChecker() : ftypes::BaseChecker(2 /* level */)
|
||||
{
|
||||
Classificator const & c = classif();
|
||||
m_types.push_back(c.GetTypeByPath({"amenity", "charging_station", "general"}));
|
||||
m_types.push_back(c.GetTypeByPath({"amenity", "charging_station"}));
|
||||
}
|
||||
|
||||
IsCharingStationCarChecker::IsCharingStationCarChecker() : ftypes::BaseChecker(3 /* level */)
|
||||
|
||||
@@ -86,7 +86,6 @@ std::map<std::string, BookmarkMatchInfo> const kFeatureTypeToBookmarkMatchInfo =
|
||||
{"amenity-bureau_de_change", {kml::BookmarkIcon::Exchange, BookmarkBaseType::Exchange}},
|
||||
|
||||
{"amenity-charging_station", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-general", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-bicycle", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-motorcycle", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
{"amenity-charging_station-motorcar", {kml::BookmarkIcon::ChargingStation, BookmarkBaseType::Gas}},
|
||||
|
||||
@@ -228,7 +228,6 @@ private:
|
||||
{{"shop", "money_lender"}, SearchMarkType::Bank},
|
||||
{{"amenity", "fuel"}, SearchMarkType::Fuel},
|
||||
{{"amenity", "charging_station"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "general"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "bicycle"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "motorcycle"}, SearchMarkType::ChargingStation},
|
||||
{{"amenity", "charging_station", "motorcar"}, SearchMarkType::ChargingStation},
|
||||
|
||||
Reference in New Issue
Block a user