From 493669353d26be0ced7ed7bed43da4a220d044b1 Mon Sep 17 00:00:00 2001 From: Dmitry Donskoy Date: Mon, 8 Oct 2018 15:47:24 +0300 Subject: [PATCH] [android] Fixed initialization lan and lon for search items - p2p mode --- android/jni/com/mapswithme/maps/SearchEngine.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/android/jni/com/mapswithme/maps/SearchEngine.cpp b/android/jni/com/mapswithme/maps/SearchEngine.cpp index 0e10845d77..6bf05c88a2 100644 --- a/android/jni/com/mapswithme/maps/SearchEngine.cpp +++ b/android/jni/com/mapswithme/maps/SearchEngine.cpp @@ -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));