Fix #2495
This commit is contained in:
parent
9b9dfef76d
commit
c0ab369316
1 changed files with 24 additions and 20 deletions
|
@ -10,6 +10,7 @@ import net.osmand.data.Amenity;
|
|||
import net.osmand.osm.PoiCategory;
|
||||
import net.osmand.plus.OsmandApplication;
|
||||
import net.osmand.plus.R;
|
||||
import net.osmand.util.Algorithms;
|
||||
import net.osmand.util.MapUtils;
|
||||
|
||||
public class SearchByNameFilter extends PoiUIFilter {
|
||||
|
@ -33,9 +34,11 @@ public class SearchByNameFilter extends PoiUIFilter {
|
|||
double bottomLatitude, double leftLongitude, double rightLongitude, final ResultMatcher<Amenity> matcher) {
|
||||
currentSearchResult = new ArrayList<Amenity>();
|
||||
final int limit = distanceInd == 0 ? 500 : -1;
|
||||
List<Amenity> result = app.getResourceManager().searchAmenitiesByName(getFilterByName(),
|
||||
topLatitude, leftLongitude, bottomLatitude, rightLongitude, lat, lon, new ResultMatcher<Amenity>() {
|
||||
if (!Algorithms.isBlank(getFilterByName())) {
|
||||
List<Amenity> result = app.getResourceManager().searchAmenitiesByName(getFilterByName(), topLatitude,
|
||||
leftLongitude, bottomLatitude, rightLongitude, lat, lon, new ResultMatcher<Amenity>() {
|
||||
boolean elimit = false;
|
||||
|
||||
@Override
|
||||
public boolean publish(Amenity object) {
|
||||
if (limit != -1 && currentSearchResult.size() > limit) {
|
||||
|
@ -54,6 +57,7 @@ public class SearchByNameFilter extends PoiUIFilter {
|
|||
}
|
||||
});
|
||||
MapUtils.sortListOfMapObject(result, lat, lon);
|
||||
}
|
||||
currentSearchResult = result;
|
||||
return currentSearchResult;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue