Fix formatting
This commit is contained in:
parent
e15a9bb3a2
commit
cb6009ecff
2 changed files with 15 additions and 1 deletions
|
@ -294,7 +294,13 @@ public class SearchUICore {
|
|||
if(st1 != st2) {
|
||||
return Algorithms.compare(st1, st2);
|
||||
}
|
||||
return collator.compare(o1.localeName, o2.localeName);
|
||||
cmp = collator.compare(o1.localeName, o2.localeName);
|
||||
if(cmp != 0) {
|
||||
return cmp;
|
||||
}
|
||||
s1 = o1.getSearchDistance(loc, 1);
|
||||
s2 = o2.getSearchDistance(loc, 1);
|
||||
return Double.compare(s1, s2);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -42,6 +42,14 @@ public class SearchResult {
|
|||
return priority - 1 / (1 + priorityDistance * distance);
|
||||
}
|
||||
|
||||
public double getSearchDistance(LatLon location, double pd) {
|
||||
double distance = 0;
|
||||
if (location != null && this.location != null) {
|
||||
distance = MapUtils.getDistance(location, this.location);
|
||||
}
|
||||
return priority - 1 / (1 + pd * distance);
|
||||
}
|
||||
|
||||
public LatLon location;
|
||||
public int preferredZoom = 15;
|
||||
public String localeName;
|
||||
|
|
Loading…
Reference in a new issue