diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index 5d5ca05c96..85fc4b43df 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -801,9 +801,21 @@ public class ResourceManager { return warnings; } - private void collectTravelFiles(BinaryMapIndexReader mapReader, BinaryMapReaderResource resource) { - BinaryMapIndexReader index = mapReader; - for (BinaryIndexPart p : index.getPoiIndexes()) { + private List getTravelRepositories() { + List fileNames = new ArrayList<>(travelRepositories.keySet()); + Collections.sort(fileNames, Algorithms.getStringVersionComparator()); + List res = new ArrayList<>(); + for (String fileName : fileNames) { + BinaryMapReaderResource r = travelRepositories.get(fileName); + if (r != null) { + res.add(r.getReader(BinaryMapReaderResourceType.POI)); + } + } + return res; + } + + private void collectTravelFiles(BinaryMapReaderResource resource) { + for (BinaryMapIndexReader index : getTravelRepositories()){ travelRepositories.put(index.getFile().getName(), resource); } }