Check interpolation method
This commit is contained in:
parent
e590fd0245
commit
1a633d641f
1 changed files with 5 additions and 13 deletions
|
@ -104,20 +104,12 @@ public class SearchBuildingByNameActivity extends SearchByNameAbstractActivity<B
|
||||||
@Override
|
@Override
|
||||||
public void itemSelected(Building obj) {
|
public void itemSelected(Building obj) {
|
||||||
String text = getText(obj);
|
String text = getText(obj);
|
||||||
|
String hno = getCurrentFilter();
|
||||||
LatLon loc = obj.getLocation();
|
LatLon loc = obj.getLocation();
|
||||||
if(obj.getInterpolationInterval() > 0 || obj.getInterpolationType() != null){
|
float interpolation = obj.interpolation(hno);
|
||||||
String hno = getCurrentFilter();
|
if(interpolation >= 0) {
|
||||||
float interpolation = obj.interpolation(hno);
|
loc = obj.getLocation(interpolation);
|
||||||
if (interpolation >= 0) {
|
text = hno;
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
settings.setLastSearchedBuilding(text, loc);
|
settings.setLastSearchedBuilding(text, loc);
|
||||||
finish();
|
finish();
|
||||||
|
|
Loading…
Reference in a new issue