Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
475b1d96c3
2 changed files with 23 additions and 16 deletions
|
@ -384,7 +384,11 @@ public class OsmandRegions {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
@ -538,21 +538,24 @@ public abstract class MenuController extends BaseMenuController {
|
|||
String selectedFullName = "";
|
||||
double smallestArea = -1;
|
||||
for (BinaryMapDataObject o : mapDataObjects) {
|
||||
boolean downloaded = checkIfObjectDownloaded(rm, osmandRegions.getDownloadName(o));
|
||||
if (downloaded) {
|
||||
downloadMapDataObject = null;
|
||||
break;
|
||||
} else {
|
||||
String fullName = osmandRegions.getFullName(o);
|
||||
double area = OsmandRegions.getArea(o);
|
||||
if (smallestArea == -1) {
|
||||
smallestArea = area;
|
||||
selectedFullName = fullName;
|
||||
downloadMapDataObject = o;
|
||||
} else if (area < smallestArea) {
|
||||
smallestArea = area;
|
||||
selectedFullName = fullName;
|
||||
downloadMapDataObject = o;
|
||||
String downloadName = osmandRegions.getDownloadName(o);
|
||||
if (!Algorithms.isEmpty(downloadName)) {
|
||||
boolean downloaded = checkIfObjectDownloaded(rm, downloadName);
|
||||
if (downloaded) {
|
||||
downloadMapDataObject = null;
|
||||
break;
|
||||
} else {
|
||||
String fullName = osmandRegions.getFullName(o);
|
||||
double area = OsmandRegions.getArea(o);
|
||||
if (smallestArea == -1) {
|
||||
smallestArea = area;
|
||||
selectedFullName = fullName;
|
||||
downloadMapDataObject = o;
|
||||
} else if (area < smallestArea) {
|
||||
smallestArea = area;
|
||||
selectedFullName = fullName;
|
||||
downloadMapDataObject = o;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue