diff --git a/map/api_mark_container.cpp b/map/api_mark_container.cpp new file mode 100644 index 0000000000..a1de15a524 --- /dev/null +++ b/map/api_mark_container.cpp @@ -0,0 +1,18 @@ +#include "map/api_mark_container.hpp" + +#include "map/api_mark_point.hpp" +#include "map/framework.hpp" + +ApiUserMarkContainer::ApiUserMarkContainer(double layerDepth, Framework & framework) + : UserMarkContainer(layerDepth, framework) +{ +} + +string ApiUserMarkContainer::GetTypeName() const { return "api-result"; } + +string ApiUserMarkContainer::GetActiveTypeName() const { return "search-result-active"; } + +UserMark * ApiUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg) +{ + return new ApiMarkPoint(ptOrg, this); +} diff --git a/map/api_mark_container.hpp b/map/api_mark_container.hpp new file mode 100644 index 0000000000..7984b7b6df --- /dev/null +++ b/map/api_mark_container.hpp @@ -0,0 +1,19 @@ +#pragma once + +#include "map/api_mark_point.hpp" +#include "map/user_mark_container.hpp" + +class ApiUserMarkContainer : public UserMarkContainer +{ +public: + ApiUserMarkContainer(double layerDepth, Framework & framework); + + // UserMarkContainer overrides: + Type GetType() const override { return API_MARK; } + string GetActiveTypeName() const override; + +protected: + // UserMarkContainer overrides: + string GetTypeName() const override; + UserMark * AllocateUserMark(m2::PointD const & ptOrg) override; +}; diff --git a/map/api_mark_point.hpp b/map/api_mark_point.hpp new file mode 100644 index 0000000000..45ad891270 --- /dev/null +++ b/map/api_mark_point.hpp @@ -0,0 +1,51 @@ +#pragma once + +#include "map/user_mark.hpp" +#include "map/styled_point.hpp" + +class ApiMarkPoint : public style::StyledPoint +{ +public: + ApiMarkPoint(m2::PointD const & ptOrg, UserMarkContainer * container) + : StyledPoint(ptOrg, container) + { + } + + ApiMarkPoint(string const & name, string const & id, string const & style, + m2::PointD const & ptOrg, UserMarkContainer * container) + : StyledPoint(ptOrg, container), m_name(name), m_id(id), m_style(style) + { + } + + string const & GetName() const { return m_name; } + void SetName(string const & name) { m_name = name; } + + string const & GetID() const { return m_id; } + void SetID(string const & id) { m_id = id; } + + void SetStyle(string const & style) { m_style = style; } + + // StyledPoint overrides: + string const & GetStyle() const override { return m_style; } + + // UserMark overrides: + UserMark::Type GetMarkType() const override { return UserMark::Type::API; } + + unique_ptr Copy() const override + { + return make_unique( + new ApiMarkPoint(m_name, m_id, GetStyle(), m_ptOrg, m_container)); + } + + void FillLogEvent(TEventContainer & details) const override + { + UserMark::FillLogEvent(details); + details["markType"] = "API"; + details["name"] = GetName(); + } + +private: + string m_name; + string m_id; + string m_style; +}; diff --git a/map/bookmark.cpp b/map/bookmark.cpp index e1ce232e75..ca2395f4c9 100644 --- a/map/bookmark.cpp +++ b/map/bookmark.cpp @@ -31,22 +31,6 @@ unique_ptr Bookmark::Copy() const return unique_ptr(new UserMarkCopy(this, false)); } -graphics::DisplayList * Bookmark::GetDisplayList(UserMarkDLCache * cache) const -{ - return cache->FindUserMark(UserMarkDLCache::Key(GetType(), graphics::EPosAbove, GetContainer()->GetDepth())); -} - -double Bookmark::GetAnimScaleFactor() const -{ - return m_animScaleFactor; -} - -m2::PointD const & Bookmark::GetPixelOffset() const -{ - static m2::PointD s_offset(0.0, 3.0); - return s_offset; -} - shared_ptr Bookmark::CreateAnimTask(Framework & fm) { m_animScaleFactor = 0.0; @@ -139,7 +123,7 @@ void BookmarkCategory::DeleteBookmark(size_t index) size_t animIndex = 0; for (; animIndex < m_anims.size(); ++animIndex) { - anim_node_t const & anim = m_anims[animIndex]; + TAnimNode const & anim = m_anims[animIndex]; if (anim.first == markForDelete) { anim.second->Cancel(); @@ -182,15 +166,14 @@ size_t BookmarkCategory::FindBookmark(Bookmark const * bookmark) const namespace { +string const kPlacemark = "Placemark"; +string const kStyle = "Style"; +string const kDocument = "Document"; +string const kStyleMap = "StyleMap"; +string const kStyleUrl = "styleUrl"; +string const kPair = "Pair"; - string const PLACEMARK = "Placemark"; - string const STYLE = "Style"; - string const DOCUMENT = "Document"; - string const STYLE_MAP = "StyleMap"; - string const STYLE_URL = "styleUrl"; - string const PAIR = "Pair"; - - graphics::Color const DEFAULT_TRACK_COLOR = graphics::Color::fromARGB(0xFF33CCFF); +graphics::Color const kDefaultTrackColor = graphics::Color::fromARGB(0xFF33CCFF); string PointToString(m2::PointD const & org) { @@ -206,31 +189,20 @@ namespace enum GeometryType { - UNKNOWN, - POINT, - LINE - }; - - static char const * s_arrSupportedColors[] = - { - "placemark-red", "placemark-blue", "placemark-purple", "placemark-yellow", - "placemark-pink", "placemark-brown", "placemark-green", "placemark-orange" + GEOMETRY_TYPE_UNKNOWN, + GEOMETRY_TYPE_POINT, + GEOMETRY_TYPE_LINE }; class KMLParser { - // Fixes icons which are not supported by MapsWithMe + // Fixes icons which are not supported by MapsWithMe. string GetSupportedBMType(string const & s) const { - // Remove leading '#' symbol + // Remove leading '#' symbol. + ASSERT(!s.empty(), ()); string const result = s.substr(1); - for (size_t i = 0; i < ARRAY_SIZE(s_arrSupportedColors); ++i) - if (result == s_arrSupportedColors[i]) - return result; - - // Not recognized symbols are replaced with default one - LOG(LWARNING, ("Icon", result, "for bookmark", m_name, "is not supported")); - return s_arrSupportedColors[0]; + return style::GetSupportedStyle(result, m_name, style::GetDefaultStyle()); } BookmarkCategory & m_category; @@ -263,13 +235,13 @@ namespace m_scale = -1.0; m_timeStamp = my::INVALID_TIME_STAMP; - m_trackColor = DEFAULT_TRACK_COLOR; + m_trackColor = kDefaultTrackColor; m_styleId.clear(); m_mapStyleId.clear(); m_styleUrlKey.clear(); m_points.Clear(); - m_geometryType = UNKNOWN; + m_geometryType = GEOMETRY_TYPE_UNKNOWN; } bool ParsePoint(string const & s, char const * delim, m2::PointD & pt) @@ -298,7 +270,7 @@ namespace void SetOrigin(string const & s) { - m_geometryType = POINT; + m_geometryType = GEOMETRY_TYPE_POINT; m2::PointD pt; if (ParsePoint(s, ", \n\r\t", pt)) @@ -307,7 +279,7 @@ namespace void ParseLineCoordinates(string const & s, char const * blockSeparator, char const * coordSeparator) { - m_geometryType = LINE; + m_geometryType = GEOMETRY_TYPE_LINE; strings::SimpleTokenizer cortegeIter(s, blockSeparator); while (cortegeIter) @@ -320,8 +292,8 @@ namespace } bool MakeValid() - { - if (POINT == m_geometryType) + { + if (GEOMETRY_TYPE_POINT == m_geometryType) { if (MercatorBounds::ValidX(m_org.x) && MercatorBounds::ValidY(m_org.y)) { @@ -337,7 +309,7 @@ namespace } return false; } - else if (LINE == m_geometryType) + else if (GEOMETRY_TYPE_LINE == m_geometryType) { return m_points.GetSize() > 1; } @@ -359,7 +331,7 @@ namespace return false; // Remove leading '#' symbol - map::const_iterator it = m_styleUrl2Color.find(styleUrl.substr(1)); + auto it = m_styleUrl2Color.find(styleUrl.substr(1)); if (it != m_styleUrl2Color.end()) { color = it->second; @@ -385,9 +357,9 @@ namespace string attrInLowerCase = attr; strings::AsciiToLower(attrInLowerCase); - if (IsValidAttribute(STYLE, value, attrInLowerCase)) + if (IsValidAttribute(kStyle, value, attrInLowerCase)) m_styleId = value; - else if (IsValidAttribute(STYLE_MAP, value, attrInLowerCase)) + else if (IsValidAttribute(kStyleMap, value, attrInLowerCase)) m_mapStyleId = value; } @@ -406,13 +378,13 @@ namespace { ASSERT_EQUAL(m_tags.back(), tag, ()); - if (tag == PLACEMARK) + if (tag == kPlacemark) { if (MakeValid()) { - if (POINT == m_geometryType) + if (GEOMETRY_TYPE_POINT == m_geometryType) m_category.AddBookmark(m_org, BookmarkData(m_name, m_type, m_description, m_scale, m_timeStamp)); - else if (LINE == m_geometryType) + else if (GEOMETRY_TYPE_LINE == m_geometryType) { Track track(m_points); track.SetName(m_name); @@ -426,14 +398,14 @@ namespace } Reset(); } - else if (tag == STYLE) + else if (tag == kStyle) { - if (GetTagFromEnd(1) == DOCUMENT) + if (GetTagFromEnd(1) == kDocument) { if (!m_styleId.empty()) { m_styleUrl2Color[m_styleId] = m_trackColor; - m_trackColor = DEFAULT_TRACK_COLOR; + m_trackColor = kDefaultTrackColor; } } } @@ -452,14 +424,14 @@ namespace string const & prevTag = m_tags[count - 2]; string const ppTag = count > 3 ? m_tags[count - 3] : string(); - if (prevTag == DOCUMENT) + if (prevTag == kDocument) { if (currTag == "name") m_category.SetName(value); else if (currTag == "visibility") m_category.SetVisible(value == "0" ? false : true); } - else if (prevTag == PLACEMARK) + else if (prevTag == kPlacemark) { if (currTag == "name") m_name = value; @@ -484,16 +456,17 @@ namespace { ParseColor(value); } - else if (ppTag == STYLE_MAP && prevTag == PAIR && currTag == STYLE_URL && m_styleUrlKey == "normal") + else if (ppTag == kStyleMap && prevTag == kPair && currTag == kStyleUrl && + m_styleUrlKey == "normal") { if (!m_mapStyleId.empty()) m_mapStyle2Style[m_mapStyleId] = value; } - else if (ppTag == STYLE_MAP && prevTag == PAIR && currTag == "key") + else if (ppTag == kStyleMap && prevTag == kPair && currTag == "key") { m_styleUrlKey = value; } - else if (ppTag == PLACEMARK) + else if (ppTag == kPlacemark) { if (prevTag == "Point") { @@ -527,7 +500,7 @@ namespace LOG(LWARNING, ("Invalid timestamp in Placemark:", value)); } } - else if (currTag == STYLE_URL) + else if (currTag == kStyleUrl) { GetColorForStyle(value, m_trackColor); } @@ -565,7 +538,7 @@ namespace string BookmarkCategory::GetDefaultType() { - return s_arrSupportedColors[0]; + return style::GetDefaultStyle(); } namespace @@ -852,10 +825,10 @@ string BookmarkCategory::GenerateUniqueFileName(const string & path, string name void BookmarkCategory::ReleaseAnimations() { - vector tempAnims; + vector tempAnims; for (size_t i = 0; i < m_anims.size(); ++i) { - anim_node_t const & anim = m_anims[i]; + TAnimNode const & anim = m_anims[i]; if (!anim.second->IsEnded() && !anim.second->IsCancelled()) { diff --git a/map/bookmark.hpp b/map/bookmark.hpp index 1ef6bce631..e5e08afb21 100644 --- a/map/bookmark.hpp +++ b/map/bookmark.hpp @@ -2,6 +2,7 @@ #include "map/user_mark.hpp" #include "map/user_mark_container.hpp" +#include "map/styled_point.hpp" #include "coding/reader.hpp" @@ -65,28 +66,24 @@ private: time_t m_timeStamp; }; -class Bookmark : public ICustomDrawable +class Bookmark : public style::StyledPoint { BookmarkData m_data; double m_animScaleFactor; public: Bookmark(m2::PointD const & ptOrg, UserMarkContainer * container) - : ICustomDrawable(ptOrg, container) - , m_animScaleFactor(1.0) + : StyledPoint(ptOrg, container), m_animScaleFactor(1.0) { } - Bookmark(BookmarkData const & data, - m2::PointD const & ptOrg, - UserMarkContainer * container) - : ICustomDrawable(ptOrg, container) - , m_data(data) - , m_animScaleFactor(1.0) + Bookmark(BookmarkData const & data, m2::PointD const & ptOrg, UserMarkContainer * container) + : StyledPoint(ptOrg, container), m_data(data), m_animScaleFactor(1.0) { } void SetData(BookmarkData const & data) { m_data = data; } + BookmarkData const & GetData() const { return m_data; } virtual Type GetMarkType() const override { return UserMark::Type::BOOKMARK; } @@ -96,7 +93,9 @@ public: void SetName(string const & name) { m_data.SetName(name); } /// @return Now its a bookmark color - name of icon file string const & GetType() const { return m_data.GetType(); } + void SetType(string const & type) { m_data.SetType(type); } + m2::RectD GetViewport() const { return m2::RectD(GetOrg(), GetOrg()); } string const & GetDescription() const { return m_data.GetDescription(); } @@ -111,10 +110,10 @@ public: unique_ptr Copy() const override; - virtual graphics::DisplayList * GetDisplayList(UserMarkDLCache * cache) const override; - virtual double GetAnimScaleFactor() const override; - virtual m2::PointD const & GetPixelOffset() const override; shared_ptr CreateAnimTask(Framework & fm); + + // StyledPoint overrides: + string const & GetStyle() const override { return m_data.GetType(); } }; class BookmarkCategory : public UserMarkContainer @@ -199,8 +198,8 @@ private: private: bool m_blockAnimation; - typedef pair > anim_node_t; - vector m_anims; + using TAnimNode = pair>; + vector m_anims; }; /// diff --git a/map/framework.hpp b/map/framework.hpp index d60396d143..6273f4cdb8 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -6,6 +6,8 @@ #include "map/navigator.hpp" #include "map/animator.hpp" +#include "map/api_mark_container.hpp" +#include "map/api_mark_point.hpp" #include "map/bookmark.hpp" #include "map/bookmark_manager.hpp" #include "map/pin_click_manager.hpp" diff --git a/map/map.pro b/map/map.pro index 152972ef17..dabcea1103 100644 --- a/map/map.pro +++ b/map/map.pro @@ -11,67 +11,72 @@ INCLUDEPATH *= $$ROOT_DIR/3party/protobuf/src $$ROOT_DIR/3party/expat/lib $$ROOT include($$ROOT_DIR/common.pri) HEADERS += \ - framework.hpp \ + active_maps_layout.hpp \ + alfa_animation_task.hpp \ + anim_phase_chain.hpp \ + animator.hpp \ + api_mark_container.hpp \ + api_mark_point.hpp \ + benchmark_engine.hpp \ + benchmark_provider.hpp \ + bookmark.hpp \ + bookmark_manager.hpp \ + change_viewport_task.hpp \ + compass_arrow.hpp \ + country_status_display.hpp \ + country_tree.hpp \ feature_vec_model.hpp \ - navigator.hpp \ + framework.hpp \ + ge0_parser.hpp \ + geourl_process.hpp \ information_display.hpp \ location_state.hpp \ - benchmark_provider.hpp \ - benchmark_engine.hpp \ - ruler.hpp \ - bookmark.hpp \ - geourl_process.hpp \ - country_status_display.hpp \ - rotate_screen_task.hpp \ - compass_arrow.hpp \ - animator.hpp \ move_screen_task.hpp \ - change_viewport_task.hpp \ mwm_url.hpp \ - bookmark_manager.hpp \ - ge0_parser.hpp \ - track.hpp \ - alfa_animation_task.hpp \ - user_mark_container.hpp \ - user_mark.hpp \ - user_mark_dl_cache.hpp \ - anim_phase_chain.hpp \ - pin_click_manager.hpp \ - country_tree.hpp \ - active_maps_layout.hpp \ + navigator.hpp \ navigator_utils.hpp \ + pin_click_manager.hpp \ + rotate_screen_task.hpp \ + ruler.hpp \ + styled_point.hpp \ + track.hpp \ + user_mark.hpp \ + user_mark_container.hpp \ + user_mark_dl_cache.hpp \ SOURCES += \ + ../api/src/c/api-client.c \ + active_maps_layout.cpp \ + address_finder.cpp \ + alfa_animation_task.cpp \ + anim_phase_chain.cpp \ + animator.cpp \ + api_mark_container.cpp \ + benchmark_engine.cpp \ + benchmark_provider.cpp \ + bookmark.cpp \ + bookmark_manager.cpp \ + change_viewport_task.cpp \ + compass_arrow.cpp \ + country_status_display.cpp \ + country_tree.cpp \ feature_vec_model.cpp \ framework.cpp \ - navigator.cpp \ + ge0_parser.cpp \ + geourl_process.cpp \ information_display.cpp \ location_state.cpp \ - benchmark_provider.cpp \ - benchmark_engine.cpp \ - ruler.cpp \ - address_finder.cpp \ - geourl_process.cpp \ - bookmark.cpp \ - country_status_display.cpp \ - rotate_screen_task.cpp \ - compass_arrow.cpp \ - animator.cpp \ move_screen_task.cpp \ - change_viewport_task.cpp \ mwm_url.cpp \ - bookmark_manager.cpp \ - ge0_parser.cpp \ - ../api/src/c/api-client.c \ + navigator.cpp \ + navigator_utils.cpp \ + pin_click_manager.cpp \ + rotate_screen_task.cpp \ + ruler.cpp \ + styled_point.cpp \ track.cpp \ - alfa_animation_task.cpp \ user_mark_container.cpp \ user_mark_dl_cache.cpp \ - anim_phase_chain.cpp \ - pin_click_manager.cpp \ - country_tree.cpp \ - active_maps_layout.cpp \ - navigator_utils.cpp \ !iphone*:!tizen*:!android* { HEADERS += qgl_render_context.hpp diff --git a/map/mwm_url.cpp b/map/mwm_url.cpp index 5156e35842..8b2bc68f57 100644 --- a/map/mwm_url.cpp +++ b/map/mwm_url.cpp @@ -70,6 +70,7 @@ bool ParsedMapApi::Parse(Uri const & uri) ApiMarkPoint * mark = static_cast(m_controller->CreateUserMark(glPoint)); mark->SetName(p.m_name); mark->SetID(p.m_id); + mark->SetStyle(style::GetSupportedStyle(p.m_style, p.m_name, "")); } return true; @@ -134,6 +135,13 @@ void ParsedMapApi::AddKeyValue(string key, string const & value, vectorGetDefaultKey() + : UserMarkDLCache::Key(GetStyle(), graphics::EPosAbove, container->GetDepth()); + return cache->FindUserMark(key); +} + +double StyledPoint::GetAnimScaleFactor() const +{ + // Matches the behaviour for non-custom drawables. The only caller + // of ::DrawUserMark is UserMarkContainer::Draw and it always passes + // this value. + return 1.0; +} + +m2::PointD const & StyledPoint::GetPixelOffset() const +{ + static m2::PointD const s_centre(0.0, 0.0); + static m2::PointD const s_offset(0.0, 3.0); + + return GetStyle().empty() ? s_centre : s_offset; +} + +string GetSupportedStyle(string const & s, string const & context, string const & fallback) +{ + if (s.empty()) + return fallback; + + for (size_t i = 0; i < ARRAY_SIZE(kSupportedColors); ++i) + { + if (s == kSupportedColors[i]) + return s; + } + + // Not recognized symbols are replaced with default one + LOG(LWARNING, ("Icon", s, "for point", context, "is not supported")); + return fallback; +} + +string GetDefaultStyle() { return kSupportedColors[0]; } +} // namespace style diff --git a/map/styled_point.hpp b/map/styled_point.hpp new file mode 100644 index 0000000000..684a14ea0a --- /dev/null +++ b/map/styled_point.hpp @@ -0,0 +1,39 @@ +#pragma once + +#include "map/user_mark.hpp" +#include "map/user_mark_container.hpp" + +#include "search/result.hpp" + +#include "indexer/feature.hpp" + +#include "geometry/point2d.hpp" + +#include "std/string.hpp" +#include "std/unique_ptr.hpp" +#include "std/utility.hpp" + +namespace style +{ +// Fixes icons which are not supported by MapsWithMe. +string GetSupportedStyle(string const & s, string const & context, string const & fallback); +// Default icon. +string GetDefaultStyle(); + +class StyledPoint : public ICustomDrawable +{ +public: + StyledPoint(m2::PointD const & ptOrg, UserMarkContainer * container) + : ICustomDrawable(ptOrg, container) + { + } + + // ICustomDrawable overrides: + graphics::DisplayList * GetDisplayList(UserMarkDLCache * cache) const override; + double GetAnimScaleFactor() const override; + m2::PointD const & GetPixelOffset() const override; + + /// @return name of icon, or empty string for plain circle. + virtual string const & GetStyle() const = 0; +}; +} // namespace style diff --git a/map/user_mark.hpp b/map/user_mark.hpp index d3e667fb64..73420bc00d 100644 --- a/map/user_mark.hpp +++ b/map/user_mark.hpp @@ -92,50 +92,6 @@ private: bool m_needDestroy; }; -class ApiMarkPoint : public UserMark -{ -public: - ApiMarkPoint(m2::PointD const & ptOrg, UserMarkContainer * container) - : UserMark(ptOrg, container) - { - } - - ApiMarkPoint(string const & name, - string const & id, - m2::PointD const & ptOrg, - UserMarkContainer * container) - : UserMark(ptOrg, container) - , m_name(name) - , m_id(id) - { - } - - UserMark::Type GetMarkType() const override { return UserMark::Type::API; } - - string const & GetName() const { return m_name; } - void SetName(string const & name) { m_name = name; } - - string const & GetID() const { return m_id; } - void SetID(string const & id) { m_id = id; } - - unique_ptr Copy() const override - { - return unique_ptr( - new UserMarkCopy(new ApiMarkPoint(m_name, m_id, m_ptOrg, m_container))); - } - - virtual void FillLogEvent(TEventContainer & details) const override - { - UserMark::FillLogEvent(details); - details["markType"] = "API"; - details["name"] = GetName(); - } - -private: - string m_name; - string m_id; -}; - class DebugMarkPoint : public UserMark { public: diff --git a/map/user_mark_container.cpp b/map/user_mark_container.cpp index df240531bf..fac33745d5 100644 --- a/map/user_mark_container.cpp +++ b/map/user_mark_container.cpp @@ -173,29 +173,34 @@ void UserMarkContainer::Clear(size_t skipCount/* = 0*/) namespace { - static unique_ptr s_selectionUserMark; - static unique_ptr s_myPosition; +unique_ptr g_selectionUserMark; +unique_ptr g_myPosition; +} + +UserMarkDLCache::Key UserMarkContainer::GetDefaultKey() const +{ + return UserMarkDLCache::Key(GetTypeName(), graphics::EPosCenter, GetDepth()); } void UserMarkContainer::InitStaticMarks(UserMarkContainer * container) { - if (s_selectionUserMark == NULL) - s_selectionUserMark.reset(new PoiMarkPoint(container)); + if (g_selectionUserMark == NULL) + g_selectionUserMark.reset(new PoiMarkPoint(container)); - if (s_myPosition == NULL) - s_myPosition.reset(new MyPositionMarkPoint(container)); + if (g_myPosition == NULL) + g_myPosition.reset(new MyPositionMarkPoint(container)); } PoiMarkPoint * UserMarkContainer::UserMarkForPoi() { - ASSERT(s_selectionUserMark != NULL, ()); - return s_selectionUserMark.get(); + ASSERT(g_selectionUserMark != NULL, ()); + return g_selectionUserMark.get(); } MyPositionMarkPoint * UserMarkContainer::UserMarkForMyPostion() { - ASSERT(s_myPosition != NULL, ()); - return s_myPosition.get(); + ASSERT(g_myPosition != NULL, ()); + return g_myPosition.get(); } UserMark * UserMarkContainer::CreateUserMark(m2::PointD const & ptOrg) @@ -267,27 +272,6 @@ UserMark * SearchUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg) return new SearchMarkPoint(ptOrg, this); } -ApiUserMarkContainer::ApiUserMarkContainer(double layerDepth, Framework & framework) - : UserMarkContainer(layerDepth, framework) -{ -} - -string ApiUserMarkContainer::GetTypeName() const -{ - return "api-result"; -} - -string ApiUserMarkContainer::GetActiveTypeName() const -{ - return "search-result-active"; -} - -UserMark * ApiUserMarkContainer::AllocateUserMark(const m2::PointD & ptOrg) -{ - return new ApiMarkPoint(ptOrg, this); -} - - DebugUserMarkContainer::DebugUserMarkContainer(double layerDepth, Framework & framework) : UserMarkContainer(layerDepth, framework) { diff --git a/map/user_mark_container.hpp b/map/user_mark_container.hpp index 4ca9549e4e..79b11aff09 100644 --- a/map/user_mark_container.hpp +++ b/map/user_mark_container.hpp @@ -84,6 +84,8 @@ public: double GetDepth() const { return m_layerDepth; } + virtual UserMarkDLCache::Key GetDefaultKey() const; + static void InitStaticMarks(UserMarkContainer * container); static PoiMarkPoint * UserMarkForPoi(); static MyPositionMarkPoint * UserMarkForMyPostion(); @@ -133,19 +135,6 @@ protected: virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg); }; -class ApiUserMarkContainer : public UserMarkContainer -{ -public: - ApiUserMarkContainer(double layerDepth, Framework & framework); - - virtual Type GetType() const { return API_MARK; } - - virtual string GetActiveTypeName() const; -protected: - virtual string GetTypeName() const; - virtual UserMark * AllocateUserMark(m2::PointD const & ptOrg); -}; - class DebugUserMarkContainer : public UserMarkContainer { public: