Enable/deactivate srtm maps

This commit is contained in:
vshcherb 2013-10-20 17:40:09 +02:00
parent 6214c54bdf
commit f5d269f551
2 changed files with 5 additions and 3 deletions

View file

@ -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);
}

View file

@ -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){