From 1a633d641fb17e570d875a0db5e03146f5b8c2e4 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Mon, 1 Apr 2013 19:21:38 +0200 Subject: [PATCH] Check interpolation method --- .../search/SearchBuildingByNameActivity.java | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java index 7ccaa73acd..7d52741855 100644 --- a/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/search/SearchBuildingByNameActivity.java @@ -104,20 +104,12 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity 0 || obj.getInterpolationType() != null){ - String hno = getCurrentFilter(); - float interpolation = obj.interpolation(hno); - if (interpolation >= 0) { - text = hno; - if (interpolation > 0 && obj.getLatLon2() != null) { - double lat1 = loc.getLatitude(); - double lat2 = obj.getLatLon2().getLatitude(); - double lon1 = loc.getLongitude(); - double lon2 = obj.getLatLon2().getLongitude(); - loc = new LatLon(interpolation * (lat2 - lat1) + lat1, interpolation * (lon2 - lon1) + lon1); - } - } + float interpolation = obj.interpolation(hno); + if(interpolation >= 0) { + loc = obj.getLocation(interpolation); + text = hno; } settings.setLastSearchedBuilding(text, loc); finish();