[android] Fixed initialization lan and lon for search items - p2p mode

This commit is contained in:
Dmitry Donskoy 2018-10-08 15:47:24 +03:00 committed by Daria Volvenkova
parent 00db6b99c6
commit 493669353d

View file

@ -308,13 +308,13 @@ jobject ToJavaResult(Result & result, search::ProductInfo const & productInfo, b
ms::LatLon ll = ms::LatLon::Zero();
string distance;
double distanceInMeters = 0.0;
if (hasPosition)
{
if (result.HasPoint())
{
auto const center = result.GetFeatureCenter();
ll = MercatorBounds::ToLatLon(center);
if (result.HasPoint())
{
auto const center = result.GetFeatureCenter();
ll = MercatorBounds::ToLatLon(center);
if (hasPosition)
{
distanceInMeters = ms::DistanceOnEarth(lat, lon,
MercatorBounds::YToLat(center.y),
MercatorBounds::XToLon(center.x));