Fix "Local wikipedia results don't show in search history"
This commit is contained in:
parent
10c2478153
commit
212dbdb8ff
2 changed files with 6 additions and 15 deletions
|
@ -205,20 +205,6 @@ public class MapPoiTypes {
|
||||||
if (pt != null && !pt.isReference()) {
|
if (pt != null && !pt.isReference()) {
|
||||||
return pt;
|
return pt;
|
||||||
}
|
}
|
||||||
if (pc.isWiki() && name.startsWith(WIKI_LANG)) {
|
|
||||||
return getPoiTypeForWiki(pc, name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AbstractPoiType getPoiTypeForWiki(PoiCategory osmwiki, String name) {
|
|
||||||
for (PoiType pt : osmwiki.getPoiTypes()) {
|
|
||||||
for (PoiType wikiLangPt : pt.getPoiAdditionals()) {
|
|
||||||
if (wikiLangPt != null && Algorithms.objectEquals(wikiLangPt.getOsmTag(), name)) {
|
|
||||||
return wikiLangPt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -436,7 +436,12 @@ public class QuickSearchHelper implements ResourceListener {
|
||||||
SearchResult sr = new SearchResult(phrase);
|
SearchResult sr = new SearchResult(phrase);
|
||||||
PointDescription pd = point.getName();
|
PointDescription pd = point.getName();
|
||||||
if (pd.isPoiType()) {
|
if (pd.isPoiType()) {
|
||||||
AbstractPoiType pt = MapPoiTypes.getDefault().getAnyPoiTypeByKey(pd.getName());
|
String name = pd.getName();
|
||||||
|
MapPoiTypes mapPoiTypes = MapPoiTypes.getDefault();
|
||||||
|
AbstractPoiType pt = mapPoiTypes.getAnyPoiTypeByKey(name);
|
||||||
|
if (pt == null) {
|
||||||
|
pt = mapPoiTypes.getAnyPoiAdditionalTypeByKey(name);
|
||||||
|
}
|
||||||
if (pt != null) {
|
if (pt != null) {
|
||||||
sr.localeName = pt.getTranslation();
|
sr.localeName = pt.getTranslation();
|
||||||
sr.object = pt;
|
sr.object = pt;
|
||||||
|
|
Loading…
Reference in a new issue