From f5d269f551d11d5ac77b25898856496c5bd2c934 Mon Sep 17 00:00:00 2001 From: vshcherb Date: Sun, 20 Oct 2013 17:40:09 +0200 Subject: [PATCH] Enable/deactivate srtm maps --- OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java | 4 ++-- .../src/net/osmand/plus/activities/LocalIndexesActivity.java | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java index 345c54fc09..1b28a34c98 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexHelper.java @@ -24,7 +24,6 @@ import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex; import net.osmand.map.ITileSource; import net.osmand.map.TileSourceManager; -import net.osmand.map.TileSourceManager.TileSourceTemplate; import net.osmand.plus.GPXUtilities; import net.osmand.plus.GPXUtilities.GPXFile; import net.osmand.plus.GPXUtilities.Track; @@ -328,7 +327,8 @@ public class LocalIndexHelper { if (mapPath.canRead()) { for (File mapFile : listFilesSorted(mapPath)) { if (mapFile.isFile() && mapFile.getName().endsWith(IndexConstants.BINARY_MAP_INDEX_EXT)) { - LocalIndexInfo info = new LocalIndexInfo(LocalIndexType.MAP_DATA, mapFile, backup); + boolean srtm = mapFile.getName().endsWith(IndexConstants.BINARY_SRTM_MAP_INDEX_EXT); + LocalIndexInfo info = new LocalIndexInfo(srtm ? LocalIndexType.SRTM_DATA :LocalIndexType.MAP_DATA, mapFile, backup); if(loadedMaps.containsKey(mapFile.getName()) && !backup){ info.setLoaded(true); } diff --git a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java index f95f3df1c9..60b5043279 100644 --- a/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/LocalIndexesActivity.java @@ -198,7 +198,7 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { } }; - if(info.getType() == LocalIndexType.MAP_DATA){ + if(info.getType() == LocalIndexType.MAP_DATA || info.getType() == LocalIndexType.SRTM_DATA){ if(!info.isBackupedData()){ adapter.item(R.string.local_index_mi_backup).listen(listener).position( 1).reg(); } @@ -300,6 +300,8 @@ public class LocalIndexesActivity extends OsmandExpandableListActivity { File parent = new File(i.getPathToData()).getParentFile(); if(i.getType() == LocalIndexType.GPX_DATA){ parent = getMyApplication().getAppPath(IndexConstants.GPX_INDEX_DIR); + } else if(i.getType() == LocalIndexType.SRTM_DATA){ + parent = getMyApplication().getAppPath(IndexConstants.SRTM_INDEX_DIR); } else if(i.getType() == LocalIndexType.MAP_DATA){ parent = getMyApplication().getAppPath(IndexConstants.MAPS_PATH); } else if(i.getType() == LocalIndexType.TILES_DATA){