Merge pull request #5158 from osmandapp/SearchCityWithoutStreets
Search city without streets
This commit is contained in:
commit
ad0d367153
1 changed files with 18 additions and 1 deletions
|
@ -33,6 +33,7 @@ import net.osmand.search.core.ObjectType;
|
||||||
import net.osmand.search.core.SearchResult;
|
import net.osmand.search.core.SearchResult;
|
||||||
import net.osmand.util.Algorithms;
|
import net.osmand.util.Algorithms;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -97,7 +98,22 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
||||||
|
|
||||||
showResult(sr);
|
showResult(sr);
|
||||||
} else {
|
} else {
|
||||||
dialogFragment.completeQueryWithObject(item.getSearchResult());
|
if ((sr.objectType == ObjectType.CITY || sr.objectType == ObjectType.VILLAGE)
|
||||||
|
&& sr.file != null && sr.object instanceof City) {
|
||||||
|
City c = (City) sr.object;
|
||||||
|
if (c.getStreets().isEmpty()) {
|
||||||
|
try {
|
||||||
|
sr.file.preloadStreets(c, null);
|
||||||
|
if (c.getStreets().isEmpty()) {
|
||||||
|
showResult(sr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dialogFragment.completeQueryWithObject(sr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,6 +214,7 @@ public abstract class QuickSearchListFragment extends OsmAndListFragment {
|
||||||
FavouritePoint fav = (FavouritePoint) object;
|
FavouritePoint fav = (FavouritePoint) object;
|
||||||
pointDescription = fav.getPointDescription();
|
pointDescription = fav.getPointDescription();
|
||||||
break;
|
break;
|
||||||
|
case VILLAGE:
|
||||||
case CITY:
|
case CITY:
|
||||||
String cityName = searchResult.localeName;
|
String cityName = searchResult.localeName;
|
||||||
String typeNameCity = QuickSearchListItem.getTypeName(app, searchResult);
|
String typeNameCity = QuickSearchListItem.getTypeName(app, searchResult);
|
||||||
|
|
Loading…
Reference in a new issue