Merge pull request #11422 from osmandapp/T11346

fix search result for interpolation, 11346
This commit is contained in:
vshcherb 2021-04-14 10:12:11 +02:00 committed by GitHub
commit 940ccf8d8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1317,7 +1317,13 @@ public class SearchCoreFactory {
|| !phrase.isSearchTypeAllowed(ObjectType.HOUSE)) { || !phrase.isSearchTypeAllowed(ObjectType.HOUSE)) {
continue; continue;
} }
res.localeName = b.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); if(interpolation) {
res.localeName = lw;
res.location = b.getLocation(b.interpolation(lw));
} else {
res.localeName = b.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate());
res.location = b.getLocation();
}
res.otherNames = b.getAllNames(true); res.otherNames = b.getAllNames(true);
res.object = b; res.object = b;
res.file = file; res.file = file;
@ -1328,12 +1334,6 @@ public class SearchCoreFactory {
res.relatedObject = s; res.relatedObject = s;
res.localeRelatedObjectName = s.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate()); res.localeRelatedObjectName = s.getName(phrase.getSettings().getLang(), phrase.getSettings().isTransliterate());
res.objectType = ObjectType.HOUSE; res.objectType = ObjectType.HOUSE;
if(interpolation) {
res.location = b.getLocation(b.interpolation(lw));
res.localeName = lw;
} else {
res.location = b.getLocation();
}
res.preferredZoom = 17; res.preferredZoom = 17;
resultMatcher.publish(res); resultMatcher.publish(res);