From 7df0c7c15de6a1d845aec18f661ebf464f068f1d Mon Sep 17 00:00:00 2001 From: Alexey Kulish Date: Wed, 9 Nov 2016 10:29:16 +0300 Subject: [PATCH] Fix #3249 --- .../net/osmand/plus/mapcontextmenu/MenuController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java index 2d81e3fd06..ddc6badafb 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/MenuController.java @@ -9,7 +9,6 @@ import android.widget.LinearLayout; import net.osmand.IndexConstants; import net.osmand.NativeLibrary.RenderedObject; import net.osmand.binary.BinaryMapDataObject; -import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapIndexReader.TagValuePair; import net.osmand.binary.RouteDataObject; import net.osmand.data.Amenity; @@ -612,7 +611,14 @@ public abstract class MenuController extends BaseMenuController { + IndexConstants.BINARY_MAP_INDEX_EXT; final String roadsRegionName = Algorithms.capitalizeFirstLetterAndLowercase(downloadName) + ".road" + IndexConstants.BINARY_MAP_INDEX_EXT; - return rm.getIndexFileNames().containsKey(regionName) || rm.getIndexFileNames().containsKey(roadsRegionName); + boolean downloaded = rm.getIndexFileNames().containsKey(regionName) || rm.getIndexFileNames().containsKey(roadsRegionName); + if (!downloaded) { + WorldRegion region = rm.getOsmandRegions().getRegionDataByDownloadName(downloadName); + if (region != null && region.getSuperregion() != null && region.getSuperregion().isRegionMapDownload()) { + return checkIfObjectDownloaded(rm, region.getSuperregion().getRegionDownloadName()); + } + } + return downloaded; } public static class ContextMenuToolbarController extends TopToolbarController {