diff options
author | Daria Volvenkova <d.volvenkova@corp.mail.ru> | 2019-03-01 18:23:48 +0300 |
---|---|---|
committer | Roman Kuznetsov <r.kuznetsow@gmail.com> | 2019-03-25 15:47:46 +0300 |
commit | 4723ecedd4f16af9b2ee552d86f21a859a8c62ec (patch) | |
tree | 766de5dcfbf91013c08e5d7b439ea34cfded886a /map/routing_mark.cpp | |
parent | 278683c00271d018bb8553d09e15793ae8834520 (diff) |
Road warning marks.
Diffstat (limited to 'map/routing_mark.cpp')
-rw-r--r-- | map/routing_mark.cpp | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/map/routing_mark.cpp b/map/routing_mark.cpp index 6bd0252b21..ff6bd25c0c 100644 --- a/map/routing_mark.cpp +++ b/map/routing_mark.cpp @@ -3,6 +3,8 @@ #include "drape_frontend/color_constants.hpp" #include "drape_frontend/visual_params.hpp" +#include "platform/localization.hpp" + #include <algorithm> namespace @@ -62,6 +64,12 @@ df::DepthLayer RouteMarkPoint::GetDepthLayer() const return df::DepthLayer::RoutingMarkLayer; } +void RouteMarkPoint::SetIsVisible(bool isVisible) +{ + SetDirty(); + m_markData.m_isVisible = isVisible; +} + void RouteMarkPoint::SetRoutePointType(RouteMarkType type) { SetDirty(); @@ -600,3 +608,66 @@ dp::Anchor SpeedCameraMark::GetAnchor() const { return dp::Center; } + +RoadWarningMark::RoadWarningMark(m2::PointD const & ptOrg) + : UserMark(ptOrg, Type::ROAD_WARNING) +{ + +} + +void RoadWarningMark::SetIndex(uint32_t index) +{ + SetDirty(); + m_index = index; +} + +void RoadWarningMark::SetIsVisible(bool isVisible) +{ + SetDirty(); + m_isVisible = isVisible; +} + +void RoadWarningMark::SetRoadWarningType(RoadWarningMarkType type) +{ + SetDirty(); + m_type = type; +} + +void RoadWarningMark::SetFeatureId(FeatureID const & featureId) +{ + SetDirty(); + m_featureId = featureId; +} + +void RoadWarningMark::SetDistance(std::string const & distance) +{ + SetDirty(); + m_distance = distance; +} + +drape_ptr<df::UserPointMark::SymbolNameZoomInfo> RoadWarningMark::GetSymbolNames() const +{ + std::string symbolName; + switch (m_type) + { + case RoadWarningMarkType::Ferry: symbolName = "ferry"; break; + case RoadWarningMarkType::Paid: symbolName = "paid_road"; break; + case RoadWarningMarkType::Unpaved: symbolName = "unpaved_road"; break; + } + auto symbol = make_unique_dp<SymbolNameZoomInfo>(); + symbol->insert(std::make_pair(1 /* zoomLevel */, symbolName)); + return symbol; +} + +// static +std::string RoadWarningMark::GetLocalizedRoadWarningType(RoadWarningMarkType type) +{ + switch (type) + { + case RoadWarningMarkType::Ferry: return platform::GetLocalizedString("ferry_crossing"); + case RoadWarningMarkType::Paid: return platform::GetLocalizedString("toll_road"); + case RoadWarningMarkType::Unpaved: return platform::GetLocalizedString("unpaved_road"); + } + UNREACHABLE(); + return {}; +} |