forked from organicmaps/organicmaps
[search] Return feature center in results.
This commit is contained in:
parent
8b21484d62
commit
135cd29cba
2 changed files with 10 additions and 0 deletions
|
@ -38,6 +38,12 @@ m2::RectD Result::GetFeatureRect() const
|
|||
return m_featureRect;
|
||||
}
|
||||
|
||||
m2::PointD Result::GetFeatureCenter() const
|
||||
{
|
||||
ASSERT_EQUAL(GetResultType(), RESULT_FEATURE, ());
|
||||
return m_featureRect.Center();
|
||||
}
|
||||
|
||||
uint32_t Result::GetFetureType() const
|
||||
{
|
||||
ASSERT_EQUAL(GetResultType(), RESULT_FEATURE, ());
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#include "../geometry/point2d.hpp"
|
||||
#include "../geometry/rect2d.hpp"
|
||||
#include "../std/string.hpp"
|
||||
|
||||
|
@ -31,6 +32,9 @@ public:
|
|||
// Rect of a feature, if GetResultType() == RESULT_FEATURE.
|
||||
m2::RectD GetFeatureRect() const;
|
||||
|
||||
// Center point of a feature, if GetResultType() == RESULT_FEATURE.
|
||||
m2::PointD GetFeatureCenter() const;
|
||||
|
||||
// Type of a feature, if GetResultType() == RESULT_FEATURE.
|
||||
uint32_t GetFetureType() const;
|
||||
string GetFetureTypeAsString() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue