Fix #3256
This commit is contained in:
parent
af7031bfb6
commit
e1c8d3b336
2 changed files with 23 additions and 16 deletions
|
@ -384,7 +384,11 @@ public class OsmandRegions {
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorldRegion getRegionDataByDownloadName(String downloadName) {
|
public WorldRegion getRegionDataByDownloadName(String downloadName) {
|
||||||
return getRegionData(downloadNamesToFullNames.get(downloadName.toLowerCase()));
|
if (downloadName == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return getRegionData(downloadNamesToFullNames.get(downloadName.toLowerCase()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDownloadName(BinaryMapDataObject o) {
|
public String getDownloadName(BinaryMapDataObject o) {
|
||||||
|
|
|
@ -538,21 +538,24 @@ public abstract class MenuController extends BaseMenuController {
|
||||||
String selectedFullName = "";
|
String selectedFullName = "";
|
||||||
double smallestArea = -1;
|
double smallestArea = -1;
|
||||||
for (BinaryMapDataObject o : mapDataObjects) {
|
for (BinaryMapDataObject o : mapDataObjects) {
|
||||||
boolean downloaded = checkIfObjectDownloaded(rm, osmandRegions.getDownloadName(o));
|
String downloadName = osmandRegions.getDownloadName(o);
|
||||||
if (downloaded) {
|
if (!Algorithms.isEmpty(downloadName)) {
|
||||||
downloadMapDataObject = null;
|
boolean downloaded = checkIfObjectDownloaded(rm, downloadName);
|
||||||
break;
|
if (downloaded) {
|
||||||
} else {
|
downloadMapDataObject = null;
|
||||||
String fullName = osmandRegions.getFullName(o);
|
break;
|
||||||
double area = OsmandRegions.getArea(o);
|
} else {
|
||||||
if (smallestArea == -1) {
|
String fullName = osmandRegions.getFullName(o);
|
||||||
smallestArea = area;
|
double area = OsmandRegions.getArea(o);
|
||||||
selectedFullName = fullName;
|
if (smallestArea == -1) {
|
||||||
downloadMapDataObject = o;
|
smallestArea = area;
|
||||||
} else if (area < smallestArea) {
|
selectedFullName = fullName;
|
||||||
smallestArea = area;
|
downloadMapDataObject = o;
|
||||||
selectedFullName = fullName;
|
} else if (area < smallestArea) {
|
||||||
downloadMapDataObject = o;
|
smallestArea = area;
|
||||||
|
selectedFullName = fullName;
|
||||||
|
downloadMapDataObject = o;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue