Merge pull request #10547 from osmandapp/fix_links
Fix links to wikivoyage
This commit is contained in:
commit
f8a7929310
1 changed files with 20 additions and 3 deletions
|
@ -492,7 +492,7 @@ public class TravelObfHelper implements TravelHelper {
|
||||||
@Override
|
@Override
|
||||||
public TravelArticle getArticleByTitle(@NonNull final String title, @NonNull QuadRect rect, @NonNull final String lang) {
|
public TravelArticle getArticleByTitle(@NonNull final String title, @NonNull QuadRect rect, @NonNull final String lang) {
|
||||||
TravelArticle article = null;
|
TravelArticle article = null;
|
||||||
List<Amenity> amenities = null;
|
final List<Amenity> amenities = new ArrayList<>();
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
int left = 0;
|
int left = 0;
|
||||||
|
@ -510,8 +510,25 @@ public class TravelObfHelper implements TravelHelper {
|
||||||
for (BinaryMapIndexReader reader : getReaders()) {
|
for (BinaryMapIndexReader reader : getReaders()) {
|
||||||
try {
|
try {
|
||||||
SearchRequest<Amenity> req = BinaryMapIndexReader.buildSearchPoiRequest(
|
SearchRequest<Amenity> req = BinaryMapIndexReader.buildSearchPoiRequest(
|
||||||
x, y, title, left, right, top, bottom, getSearchRouteArticleFilter(), null, null);
|
x, y, title, left, right, top, bottom, getSearchRouteArticleFilter(),
|
||||||
amenities = reader.searchPoiByName(req);
|
new ResultMatcher<Amenity>() {
|
||||||
|
boolean done = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean publish(Amenity amenity) {
|
||||||
|
if (Algorithms.stringsEqual(title, Algorithms.emptyIfNull(amenity.getName(lang)))) {
|
||||||
|
amenities.add(amenity);
|
||||||
|
done = true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isCancelled() {
|
||||||
|
return done;
|
||||||
|
}
|
||||||
|
}, null);
|
||||||
|
reader.searchPoiByName(req);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
LOG.error(e.getMessage());
|
LOG.error(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue