From bfbd0ff810fc29db9585ff6b17debc398ad6ac17 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Sun, 22 Nov 2015 20:54:36 +0300 Subject: [PATCH] Improve regions layer --- .../net/osmand/plus/views/DownloadedRegionsLayer.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java index 140ab065f7..7b9ae89aea 100644 --- a/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/DownloadedRegionsLayer.java @@ -493,18 +493,15 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe Iterator it = result.iterator(); while (it.hasNext()) { BinaryMapDataObject o = it.next(); - if (!osmandRegions.isDownloadOfType(o, OsmandRegions.MAP_TYPE) || !osmandRegions.contain(o, point31x, point31y)) { + if (!osmandRegions.contain(o, point31x, point31y) ) { it.remove(); } } - - selectedObjects = result; - OsmandRegions osmandRegions = app.getRegions(); for (BinaryMapDataObject o : result) { String fullName = osmandRegions.getFullName(o); WorldRegion region = osmandRegions.getRegionData(fullName); - if (region != null) { + if (region != null && region.isRegionMapDownload()) { List indexItems = app.getDownloadThread().getIndexes().getIndexItems(region); List dataItems = new LinkedList<>(); IndexItem regularMapItem = null; @@ -550,9 +547,6 @@ public class DownloadedRegionsLayer extends OsmandMapLayer implements IContextMe if (o instanceof DownloadMapObject) { DownloadMapObject mapObject = ((DownloadMapObject) o); List list = new LinkedList<>(); - if (selectedObjects. size() > 0) { - list.addAll(selectedObjects); - } list.add(mapObject.dataObject); selectedObjects = list; }