diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index 2c24433b8d..089916ff6c 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -99,9 +99,11 @@ public class ConfigureMapMenu { }); RenderingRulesStorage renderer = ma.getMyApplication().getRendererRegistry().getCurrentSelectedRenderer(); List customRules = new ArrayList<>(); + boolean hasDepthContours = ma.getMyApplication().getResourceManager().hasDepthContours(); if (renderer != null) { for (RenderingRuleProperty p : renderer.PROPS.getCustomRules()) { - if (!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory())) { + if (!RenderingRuleStorageProperties.UI_CATEGORY_HIDDEN.equals(p.getCategory()) + && (hasDepthContours || !p.getAttrName().equals("depthContours"))) { customRules.add(p); } } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index 27e9f79ff5..5005c053c6 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -132,6 +132,7 @@ public class DownloadResources extends DownloadResourceGroup { if ((item.getType() == DownloadActivityType.NORMAL_FILE && !item.extra) || item.getType() == DownloadActivityType.ROADS_FILE || item.getType() == DownloadActivityType.WIKIPEDIA_FILE + || item.getType() == DownloadActivityType.DEPTH_CONTOUR_FILE || item.getType() == DownloadActivityType.SRTM_COUNTRY_FILE) { outdated = true; } else { diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index f470d918c7..e3fd8f7b2d 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -211,6 +211,7 @@ public class ResourceManager { protected boolean internetIsNotAccessible = false; private java.text.DateFormat dateFormat; + private boolean depthContours; public ResourceManager(OsmandApplication context) { @@ -269,7 +270,11 @@ public class ResourceManager { public OsmandApplication getContext() { return context; } - + + public boolean hasDepthContours() { + return depthContours; + } + ////////////////////////////////////////////// Working with tiles //////////////////////////////////////////////// public Bitmap getTileImageForMapAsync(String file, ITileSource map, int x, int y, int zoom, boolean loadFromInternetIfNeeded) { @@ -745,6 +750,7 @@ public class ResourceManager { } } File liveDir = context.getAppPath(IndexConstants.LIVE_INDEX_DIR); + depthContours = false; for (File f : files) { progress.startTask(context.getString(R.string.indexing_map) + " " + f.getName(), -1); //$NON-NLS-1$ try { @@ -783,6 +789,9 @@ public class ResourceManager { changesManager.indexMainMap(f, dateCreated); } indexFileNames.put(f.getName(), dateFormat.format(dateCreated)); //$NON-NLS-1$ + if (!depthContours && f.getName().toLowerCase().startsWith("depth_")) { + depthContours = true; + } renderer.initializeNewResource(progress, f, mapReader); BinaryMapReaderResource resource = new BinaryMapReaderResource(f, mapReader);