Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/map
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2013-06-14 16:41:27 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:57:12 +0300
commit2a34b742e4e59fb192b8ec607a805ac51d3623cc (patch)
tree55dcd4484420c898ac43e53d426fd0cfd2519768 /map
parent593cb1723b6f9570acaf1a9bf5cd6786176f933d (diff)
[refactoring] Cross platform balloon everywhere.
Diffstat (limited to 'map')
-rw-r--r--map/address_finder.cpp126
-rw-r--r--map/balloon_manager.cpp190
-rw-r--r--map/balloon_manager.hpp66
-rw-r--r--map/framework.cpp64
-rw-r--r--map/framework.hpp50
-rw-r--r--map/map.pro2
-rw-r--r--map/map_tests/bookmarks_test.cpp7
7 files changed, 312 insertions, 193 deletions
diff --git a/map/address_finder.cpp b/map/address_finder.cpp
index c0f65492af..d507816908 100644
--- a/map/address_finder.cpp
+++ b/map/address_finder.cpp
@@ -332,7 +332,7 @@ namespace
static void GetReadableTypes(search::Engine const * eng, int8_t lang,
feature::TypesHolder & types,
- Framework::AddressInfo & info)
+ search::AddressInfo & info)
{
types.SortBySpec();
@@ -367,7 +367,7 @@ namespace
}
}
- void FillAddress(search::Engine const * eng, Framework::AddressInfo & info)
+ void FillAddress(search::Engine const * eng, search::AddressInfo & info)
{
int8_t const lang = eng->GetCurrentLanguage();
@@ -435,7 +435,7 @@ namespace
m_eps = max(rect.SizeX(), rect.SizeY());
}
- void FillLocality(Framework::AddressInfo & info, Framework const & fm)
+ void FillLocality(search::AddressInfo & info, Framework const & fm)
{
SortResults();
//LOG(LDEBUG, (m_cont));
@@ -470,15 +470,7 @@ namespace
}
}
-void Framework::GetAddressInfo(m2::PointD const & pxPoint, AddressInfo & info) const
-{
- // Input point is in pixel coordinates.
- m2::PointD const pt = PtoG(pxPoint);
-
- GetAddressInfoForGlobalPoint(pt, info);
-}
-
-void Framework::GetAddressInfoForGlobalPoint(m2::PointD const & pt, AddressInfo & info) const
+void Framework::GetAddressInfoForGlobalPoint(m2::PointD const & pt, search::AddressInfo & info) const
{
info.Clear();
@@ -508,7 +500,7 @@ void Framework::GetAddressInfoForGlobalPoint(m2::PointD const & pt, AddressInfo
GetLocality(pt, info);
}
-void Framework::GetAddressInfo(FeatureType const & ft, m2::PointD const & pt, AddressInfo & info) const
+void Framework::GetAddressInfo(FeatureType const & ft, m2::PointD const & pt, search::AddressInfo & info) const
{
info.Clear();
@@ -531,7 +523,7 @@ void Framework::GetAddressInfo(FeatureType const & ft, m2::PointD const & pt, Ad
//GetLocality(pt, info);
}
-void Framework::GetLocality(m2::PointD const & pt, AddressInfo & info) const
+void Framework::GetLocality(m2::PointD const & pt, search::AddressInfo & info) const
{
CheckerT & checker = GetChecker();
@@ -546,109 +538,3 @@ void Framework::GetLocality(m2::PointD const & pt, AddressInfo & info) const
getLocality.FillLocality(info, *this);
}
-
-////////////////////////////////////////////////////////////////////////////////////
-// Framework::AddressInfo implementation
-////////////////////////////////////////////////////////////////////////////////////
-
-void Framework::AddressInfo::MakeFrom(search::Result const & res)
-{
- ASSERT_EQUAL ( res.GetResultType(), search::Result::RESULT_FEATURE, () );
-
- // push the feature type
- string const type = res.GetFeatureType();
- if (!type.empty())
- m_types.push_back(type);
- else
- ASSERT ( false, ("Search result with empty type") );
-
- // assign name if it's not equal with type
- string name = res.GetString();
- if (name != type)
- m_name.swap(name);
-}
-
-string Framework::AddressInfo::GetPinName() const
-{
- return m_name.empty() ? m_house : m_name;
-}
-
-string Framework::AddressInfo::GetPinType() const
-{
- char const * type = GetBestType();
- return (type ? type : "");
-}
-
-string Framework::AddressInfo::FormatPinText() const
-{
- // select name or house if name is empty
- string const & ret = (m_name.empty() ? m_house : m_name);
-
- char const * type = GetBestType();
- if (type)
- {
- if (ret.empty())
- return type;
- else
- return ret + " (" + string(type) + ')';
- }
- else
- return ret;
-}
-
-string Framework::AddressInfo::FormatAddress() const
-{
- string result = m_house;
- if (!m_street.empty())
- {
- if (!result.empty())
- result += ' ';
- result += m_street;
- }
- if (!m_city.empty())
- {
- if (!result.empty())
- result += ", ";
- result += m_city;
- }
- if (!m_country.empty())
- {
- if (!result.empty())
- result += ", ";
- result += m_country;
- }
- return result;
-}
-
-string Framework::AddressInfo::FormatTypes() const
-{
- string result;
- for (size_t i = 0; i < m_types.size(); ++i)
- {
- ASSERT ( !m_types.empty(), () );
- if (!result.empty())
- result += ' ';
- result += m_types[i];
- }
- return result;
-}
-
-char const * Framework::AddressInfo::GetBestType() const
-{
- if (!m_types.empty())
- {
- ASSERT ( !m_types[0].empty(), () );
- return m_types[0].c_str();
- }
- return 0;
-}
-
-void Framework::AddressInfo::Clear()
-{
- m_country.clear();
- m_city.clear();
- m_street.clear();
- m_house.clear();
- m_name.clear();
- m_types.clear();
-}
diff --git a/map/balloon_manager.cpp b/map/balloon_manager.cpp
new file mode 100644
index 0000000000..3007ae1b9c
--- /dev/null
+++ b/map/balloon_manager.cpp
@@ -0,0 +1,190 @@
+#include "bookmark_balloon.hpp"
+#include "balloon_manager.hpp"
+#include "framework.hpp"
+
+#include "../search/result.hpp"
+
+#include "../graphics/depth_constants.hpp"
+
+#include "../gui/controller.hpp"
+
+
+BalloonManager::BalloonManager(Framework & f)
+ : m_f(f), m_updateForLocation(false)
+{
+}
+
+void BalloonManager::CreateBookmarkBalloon()
+{
+ CHECK(m_f.GetGuiController(), ());
+ CHECK(m_f.GetLocationState(), ());
+
+ BookmarkBalloon::Params bp;
+ bp.m_position = graphics::EPosAbove;
+ bp.m_depth = graphics::balloonBaseDepth;
+ bp.m_pivot = m2::PointD(0, 0);
+ bp.m_framework = &m_f;
+
+ m_balloon.reset(new BookmarkBalloon(bp));
+ m_balloon->setIsVisible(false);
+
+ m_f.GetGuiController()->AddElement(m_balloon);
+ m_f.GetLocationState()->AddOnPositionClickListener(bind(&BalloonManager::OnPositionClicked, this, _1));
+}
+
+void BalloonManager::RenderPolicyCreated(graphics::EDensity density)
+{
+ if (m_balloon == 0)
+ CreateBookmarkBalloon();
+
+ m_balloon->setImage(graphics::Image::Info("arrow.png", density));
+}
+
+void BalloonManager::ScreenSizeChanged(int width, int height)
+{
+ if (m_balloon)
+ m_balloon->onScreenSize(width, height);
+}
+
+void BalloonManager::LocationChanged(location::GpsInfo const & info)
+{
+ if (m_balloon && m_updateForLocation)
+ {
+ m_balloon->setGlbPivot(m2::PointD(MercatorBounds::LonToX(info.m_longitude),
+ MercatorBounds::LatToY(info.m_latitude)));
+ }
+}
+
+void BalloonManager::OnPositionClicked(m2::PointD const & pt)
+{
+ Show(pt, m_f.GetStringsBundle().GetString("my_position"), "");
+
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateMyPosition, this, _1));
+
+ m_updateForLocation = true;
+}
+
+void BalloonManager::Show(m2::PointD const & pt, string const & name, string const & type)
+{
+ m_updateForLocation = false;
+
+ m_balloon->setGlbPivot(pt);
+ m_balloon->setBookmarkCaption(name, type);
+ m_balloon->showAnimated();
+
+ m_f.Invalidate();
+}
+
+void BalloonManager::Hide()
+{
+ m_updateForLocation = false;
+
+ m_balloon->hide();
+
+ m_f.Invalidate();
+}
+
+void BalloonManager::ShowAddress(m2::PointD const & pt, search::AddressInfo const & info)
+{
+ string name = info.GetPinName();
+ string type = info.GetPinType();
+ if (name.empty() && type.empty())
+ name = m_f.GetStringsBundle().GetString("dropped_pin");
+
+ Show(pt, name, type);
+
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivatePOI, this, _1, info));
+}
+
+void BalloonManager::ShowApiPoint(url_scheme::ApiPoint const & apiPoint)
+{
+ Show(m2::PointD(MercatorBounds::LonToX(apiPoint.m_lon),
+ MercatorBounds::LatToY(apiPoint.m_lat)),
+ apiPoint.m_name, "");
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateAPI, this, _1, apiPoint));
+}
+
+void BalloonManager::ShowBookmark(BookmarkAndCategory bmAndCat)
+{
+ Bookmark const * pBM = m_f.GetBmCategory(bmAndCat.first)->GetBookmark(bmAndCat.second);
+ Show(pBM->GetOrg(), pBM->GetName(), "");
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateBookmark, this, _1, bmAndCat));
+}
+
+void BalloonManager::OnClick(m2::PointD const & pxPoint, bool isLongTouch)
+{
+ url_scheme::ApiPoint apiPoint;
+ if (m_f.GetMapApiPoint(pxPoint, apiPoint))
+ {
+ Show(m2::PointD(MercatorBounds::LonToX(apiPoint.m_lon),
+ MercatorBounds::LatToY(apiPoint.m_lat)),
+ apiPoint.m_name, "");
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateAPI, this, _1, apiPoint));
+ }
+ else
+ {
+ search::AddressInfo addrInfo;
+ m2::PointD pxPivot;
+ BookmarkAndCategory bmAndCat;
+
+ switch (m_f.GetBookmarkOrPoi(pxPoint, pxPivot, addrInfo, bmAndCat))
+ {
+ case Framework::BOOKMARK:
+ {
+ Bookmark const * pBM = m_f.GetBmCategory(bmAndCat.first)->GetBookmark(bmAndCat.second);
+ Show(pBM->GetOrg(), pBM->GetName(), "");
+ m_balloon->setOnClickListener(bind(&BalloonManager::OnActivateBookmark, this, _1, bmAndCat));
+ return;
+ }
+
+ case Framework::POI:
+ if (!m_balloon->isVisible())
+ {
+ ShowAddress(m_f.PtoG(pxPivot), addrInfo);
+ return;
+ }
+
+ default:
+ if (isLongTouch)
+ {
+ m2::PointD const glbPoint = m_f.PtoG(pxPoint);
+ m_f.GetAddressInfoForGlobalPoint(glbPoint, addrInfo);
+ ShowAddress(glbPoint, addrInfo);
+ return;
+ }
+ }
+
+ // hide the balloon by default if no any Show before
+ Hide();
+ }
+}
+
+void BalloonManager::ClearListeners()
+{
+ m_poiListener.clear();
+ m_bookmarkListener.clear();
+ m_apiListener.clear();
+ m_positionListener.clear();
+}
+
+void BalloonManager::OnActivateMyPosition(gui::Element *)
+{
+ m2::PointD const & pt = m_balloon->glbPivot();
+ m_positionListener(MercatorBounds::YToLat(pt.y),
+ MercatorBounds::XToLon(pt.x));
+}
+
+void BalloonManager::OnActivatePOI(gui::Element *, search::AddressInfo const & info)
+{
+ m_poiListener(m_balloon->glbPivot(), info);
+}
+
+void BalloonManager::OnActivateAPI(gui::Element *, url_scheme::ApiPoint const & apiPoint)
+{
+ m_apiListener(apiPoint);
+}
+
+void BalloonManager::OnActivateBookmark(gui::Element *, BookmarkAndCategory const & bmAndCat)
+{
+ m_bookmarkListener(bmAndCat);
+}
diff --git a/map/balloon_manager.hpp b/map/balloon_manager.hpp
new file mode 100644
index 0000000000..59233d96e2
--- /dev/null
+++ b/map/balloon_manager.hpp
@@ -0,0 +1,66 @@
+#pragma once
+#include "bookmark.hpp"
+
+#include "../graphics/defines.hpp"
+
+#include "../geometry/point2d.hpp"
+
+#include "../std/shared_ptr.hpp"
+#include "../std/function.hpp"
+
+
+class Framework;
+class BookmarkBalloon;
+namespace location { class GpsInfo; }
+namespace gui { class Element; }
+namespace search { struct AddressInfo; }
+namespace url_scheme { struct ApiPoint; }
+
+class BalloonManager
+{
+ Framework & m_f;
+ shared_ptr<BookmarkBalloon> m_balloon;
+ bool m_updateForLocation;
+
+ void CreateBookmarkBalloon();
+
+ void OnPositionClicked(m2::PointD const & pt);
+ void OnActivateMyPosition(gui::Element *);
+ void OnActivatePOI(gui::Element *, search::AddressInfo const & info);
+ void OnActivateAPI(gui::Element *, url_scheme::ApiPoint const & apiPoint);
+ void OnActivateBookmark(gui::Element *, BookmarkAndCategory const & bmAndCat);
+
+ void Show(m2::PointD const & pt, string const & name, string const & type);
+
+public:
+ BalloonManager(Framework & f);
+
+ void RenderPolicyCreated(graphics::EDensity density);
+ void LocationChanged(location::GpsInfo const & info);
+ void ScreenSizeChanged(int width, int height);
+
+ void ShowAddress(m2::PointD const & pt, search::AddressInfo const & info);
+ void ShowApiPoint(url_scheme::ApiPoint const & apiPoint);
+ void ShowBookmark(BookmarkAndCategory bmAndCat);
+
+ void OnClick(m2::PointD const & pxPoint, bool isLongTouch);
+
+ void Hide();
+
+private:
+ /// @name Platform dependent listeners to show special activities.
+ //@{
+ function<void (m2::PointD const &, search::AddressInfo const &)> m_poiListener;
+ function<void (BookmarkAndCategory const &)> m_bookmarkListener;
+ function<void (url_scheme::ApiPoint const &)> m_apiListener;
+ function<void (double, double)> m_positionListener;
+
+public:
+ template <class T> void ConnectPoiListener(T const & t) { m_poiListener = t; }
+ template <class T> void ConnectBookmarkListener(T const & t) { m_bookmarkListener = t; }
+ template <class T> void ConnectApiListener(T const & t) { m_apiListener = t; }
+ template <class T> void ConnectPositionListener(T const & t) { m_positionListener = t; }
+
+ void ClearListeners();
+ //@}
+};
diff --git a/map/framework.cpp b/map/framework.cpp
index 9768bad793..a78645cf59 100644
--- a/map/framework.cpp
+++ b/map/framework.cpp
@@ -129,6 +129,7 @@ void Framework::OnLocationUpdate(location::GpsInfo const & info)
#endif
m_informationDisplay.locationState()->OnLocationUpdate(rInfo);
+ m_balloonManager.LocationChanged(rInfo);
}
void Framework::OnCompassUpdate(location::CompassInfo const & info)
@@ -169,12 +170,9 @@ static void GetResourcesMaps(vector<string> & outMaps)
}
Framework::Framework()
- : //m_hasPendingInvalidate(false),
- //m_doForceUpdate(false),
- m_animator(this),
+ : m_animator(this),
m_queryMaxScaleMode(false),
m_drawPlacemark(false),
- //m_hasPendingShowRectFixed(false),
/// @todo It's not a class state, so no need to store it in memory.
/// Move this constants to Ruler (and don't store them at all).
@@ -192,7 +190,8 @@ Framework::Framework()
m_informationDisplay(this),
m_lowestMapVersion(numeric_limits<int>::max()),
m_benchmarkEngine(0),
- m_bmManager(*this)
+ m_bmManager(*this),
+ m_balloonManager(*this)
{
// Checking whether we should enable benchmark.
bool isBenchmarkingEnabled = false;
@@ -210,6 +209,7 @@ Framework::Framework()
m_stringsBundle.SetDefaultString("dropped_pin", "Dropped Pin");
m_stringsBundle.SetDefaultString("my_places", "My Places");
+ m_stringsBundle.SetDefaultString("my_position", "My Position");
m_animController.reset(new anim::Controller());
@@ -705,11 +705,9 @@ void Framework::OnSize(int w, int h)
m2::RectI const & viewPort = m_renderPolicy->OnSize(w, h);
- m_navigator.OnSize(
- viewPort.minX(),
- viewPort.minY(),
- viewPort.SizeX(),
- viewPort.SizeY());
+ m_navigator.OnSize(viewPort.minX(), viewPort.minY(), viewPort.SizeX(), viewPort.SizeY());
+
+ m_balloonManager.ScreenSizeChanged(w, h);
}
m_width = w;
@@ -1297,10 +1295,9 @@ void Framework::ShowSearchResult(search::Result const & res)
ShowRectExVisibleScale(rect);
- // On iOS, we draw search results as bookmarks
-#ifndef OMIM_OS_IPHONE
- DrawPlacemark(res.GetFeatureCenter());
-#endif
+ search::AddressInfo info;
+ info.MakeFrom(res);
+ m_balloonManager.ShowAddress(res.GetFeatureCenter(), info);
}
bool Framework::GetDistanceAndAzimut(m2::PointD const & point,
@@ -1366,6 +1363,8 @@ void Framework::SetRenderPolicy(RenderPolicy * renderPolicy)
m_informationDisplay.setVisualScale(m_renderPolicy->VisualScale());
+ m_balloonManager.RenderPolicyCreated(m_renderPolicy->Density());
+
if (m_width != 0 && m_height != 0)
OnSize(m_width, m_height);
@@ -1481,7 +1480,7 @@ bool Framework::IsBenchmarking() const
return m_benchmarkEngine != 0;
}
-shared_ptr<graphics::OverlayElement> const GetClosestToPivot(list<shared_ptr<graphics::OverlayElement> > const & l,
+shared_ptr<graphics::OverlayElement> GetClosestToPivot(list<shared_ptr<graphics::OverlayElement> > const & l,
m2::PointD const & pxPoint)
{
double dist = numeric_limits<double>::max();
@@ -1502,7 +1501,8 @@ shared_ptr<graphics::OverlayElement> const GetClosestToPivot(list<shared_ptr<gra
return res;
}
-bool Framework::GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info) const
+bool Framework::GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot,
+ search::AddressInfo & info) const
{
m_renderPolicy->FrameLock();
@@ -1552,40 +1552,16 @@ bool Framework::GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot,
return false;
}
-namespace
-{
-string GenerateNameAndAddress(Framework::AddressInfo const & info)
-{
- if (info.m_name.empty())
- return info.FormatAddress();
- else
- return info.m_name + ", " + info.FormatAddress();
-}
-}
-
-
-string Framework::GetNameAndAddressAtPoint(m2::PointD const & pxPoint)
-{
- AddressInfo info;
- GetAddressInfo(pxPoint, info);
- return GenerateNameAndAddress(info);
-}
-
-string Framework::GetNameAndAddressAtGlobalPoint(m2::PointD const & glPoint)
-{
- AddressInfo info;
- GetAddressInfoForGlobalPoint(glPoint, info);
- return GenerateNameAndAddress(info);
-}
-
-Framework::BookmarkOrPoi Framework::GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info, BookmarkAndCategory & bmCat)
+Framework::BookmarkOrPoi Framework::GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot,
+ search::AddressInfo & info, BookmarkAndCategory & bmCat)
{
bmCat = GetBookmark(pxPoint);
if (IsValid(bmCat))
return Framework::BOOKMARK;
+
if (GetVisiblePOI(pxPoint, pxPivot, info))
{
- //We need almost the exact position of the bookmark, parameter 0.1 resolves the error in 2 pixels
+ // We need almost the exact position of the bookmark, parameter 0.1 resolves the error in 2 pixels
bmCat = GetBookmark(pxPivot, 0.1);
if (IsValid(bmCat))
return Framework::BOOKMARK;
diff --git a/map/framework.hpp b/map/framework.hpp
index f914d7dfdf..af4d711c1e 100644
--- a/map/framework.hpp
+++ b/map/framework.hpp
@@ -8,8 +8,12 @@
#include "navigator.hpp"
#include "animator.hpp"
#include "feature_vec_model.hpp"
+
#include "bookmark.hpp"
#include "bookmark_manager.hpp"
+#include "balloon_manager.hpp"
+
+#include "url_api.hpp"
#include "mwm_url.hpp"
#include "../defines.hpp"
@@ -38,7 +42,12 @@
//#define DRAW_TOUCH_POINTS
-namespace search { class Result; }
+namespace search
+{
+ class Result;
+ struct AddressInfo;
+}
+
namespace gui { class Controller; }
namespace anim { class Controller; }
@@ -129,6 +138,7 @@ protected:
BenchmarkEngine * m_benchmarkEngine;
BookmarkManager m_bmManager;
+ BalloonManager m_balloonManager;
void ClearAllCaches();
@@ -321,36 +331,19 @@ public:
/// @param[in] pixPt Current touch point in device pixel coordinates.
void GetFeatureTypes(m2::PointD pixPt, vector<string> & types) const;
- struct AddressInfo
- {
- string m_country, m_city, m_street, m_house, m_name;
- vector<string> m_types;
-
- void MakeFrom(search::Result const & res);
-
- string GetPinName() const;
- string GetPinType() const;
-
- string FormatPinText() const;
- string FormatAddress() const;
- string FormatTypes() const;
- char const * GetBestType() const;
-
- void Clear();
- };
-
/// Get address information for point on map.
- void GetAddressInfo(m2::PointD const & pxPoint, AddressInfo & info) const;
- void GetAddressInfoForGlobalPoint(m2::PointD const & pt, AddressInfo & info) const;
+ inline void GetAddressInfoForPixelPoint(m2::PointD const & pxPoint, search::AddressInfo & info) const
+ {
+ GetAddressInfoForGlobalPoint(PtoG(pxPoint), info);
+ }
+ void GetAddressInfoForGlobalPoint(m2::PointD const & pt, search::AddressInfo & info) const;
private:
- void GetAddressInfo(FeatureType const & ft, m2::PointD const & pt, AddressInfo & info) const;
- void GetLocality(m2::PointD const & pt, AddressInfo & info) const;
+ void GetAddressInfo(FeatureType const & ft, m2::PointD const & pt, search::AddressInfo & info) const;
+ void GetLocality(m2::PointD const & pt, search::AddressInfo & info) const;
public:
- bool GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info) const;
- string GetNameAndAddressAtPoint(m2::PointD const & pxPoint);
- string GetNameAndAddressAtGlobalPoint(m2::PointD const & glPoint);
+ bool GetVisiblePOI(m2::PointD const & pxPoint, m2::PointD & pxPivot, search::AddressInfo & info) const;
enum BookmarkOrPoi
{
@@ -359,7 +352,8 @@ public:
POI = 2
};
- BookmarkOrPoi GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot, AddressInfo & info, BookmarkAndCategory & bmCat);
+ BookmarkOrPoi GetBookmarkOrPoi(m2::PointD const & pxPoint, m2::PointD & pxPivot,
+ search::AddressInfo & info, BookmarkAndCategory & bmCat);
virtual void BeginPaint(shared_ptr<PaintEvent> const & e);
/// Function for calling from platform dependent-paint function.
@@ -443,6 +437,8 @@ public:
StringsBundle const & GetStringsBundle();
+ BalloonManager & GetBalloonManager() { return m_balloonManager; }
+
/// Checks, whether the country which contains
/// the specified point is loaded
bool IsCountryLoaded(m2::PointD const & pt) const;
diff --git a/map/map.pro b/map/map.pro
index 54ad4e6300..6920117901 100644
--- a/map/map.pro
+++ b/map/map.pro
@@ -56,6 +56,7 @@ HEADERS += \
geometry_processors.hpp \
bookmark_manager.hpp \
ge0_parser.hpp \
+ balloon_manager.hpp \
SOURCES += \
feature_vec_model.cpp \
@@ -103,6 +104,7 @@ SOURCES += \
bookmark_manager.cpp \
ge0_parser.cpp \
../api/src/c/api-client.c \
+ balloon_manager.cpp \
!iphone*:!bada*:!android* {
HEADERS += qgl_render_context.hpp
diff --git a/map/map_tests/bookmarks_test.cpp b/map/map_tests/bookmarks_test.cpp
index 57d6c8ca81..1cf3931609 100644
--- a/map/map_tests/bookmarks_test.cpp
+++ b/map/map_tests/bookmarks_test.cpp
@@ -2,6 +2,8 @@
#include "../../map/framework.hpp"
+#include "../../search/result.hpp"
+
#include "../../platform/platform.hpp"
#include "../../coding/internal/file_data.hpp"
@@ -342,8 +344,9 @@ namespace
char const * st, char const * house,
char const * typeEn, char const * typeRu)
{
- Framework::AddressInfo info;
- fm.GetAddressInfo(fm.GtoP(m2::PointD(MercatorBounds::LonToX(lon), MercatorBounds::LatToY(lat))), info);
+ search::AddressInfo info;
+ fm.GetAddressInfoForGlobalPoint(
+ m2::PointD(MercatorBounds::LonToX(lon), MercatorBounds::LatToY(lat)), info);
TEST_EQUAL(info.m_name, name, ());
TEST_EQUAL(info.m_street, st, ());