kopia lustrzana https://github.com/JOSM/MapWithAI
rodzic
8be1579789
commit
5cf2aafd1a
|
@ -19,6 +19,7 @@ import java.util.concurrent.ExecutorService;
|
||||||
|
|
||||||
import org.openstreetmap.josm.data.StructUtils;
|
import org.openstreetmap.josm.data.StructUtils;
|
||||||
import org.openstreetmap.josm.data.imagery.ImageryInfo;
|
import org.openstreetmap.josm.data.imagery.ImageryInfo;
|
||||||
|
import org.openstreetmap.josm.gui.MainApplication;
|
||||||
import org.openstreetmap.josm.gui.PleaseWaitRunnable;
|
import org.openstreetmap.josm.gui.PleaseWaitRunnable;
|
||||||
import org.openstreetmap.josm.gui.util.GuiHelper;
|
import org.openstreetmap.josm.gui.util.GuiHelper;
|
||||||
import org.openstreetmap.josm.io.CachedFile;
|
import org.openstreetmap.josm.io.CachedFile;
|
||||||
|
@ -114,7 +115,7 @@ public class MapWithAILayerInfo {
|
||||||
}
|
}
|
||||||
Collections.sort(layers);
|
Collections.sort(layers);
|
||||||
}
|
}
|
||||||
loadDefaults(false, null, fastFail, null);
|
loadDefaults(false, MainApplication.worker, fastFail, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -160,7 +160,14 @@ public class MapWithAISourceReader implements Closeable {
|
||||||
|
|
||||||
private static List<ImageryInfo.ImageryBounds> getBounds(JsonValue countries) {
|
private static List<ImageryInfo.ImageryBounds> getBounds(JsonValue countries) {
|
||||||
if (JsonValue.ValueType.OBJECT == countries.getValueType()) {
|
if (JsonValue.ValueType.OBJECT == countries.getValueType()) {
|
||||||
Set<String> codes = Territories.getKnownIso3166Codes();
|
Set<String> codes;
|
||||||
|
try {
|
||||||
|
codes = Territories.getKnownIso3166Codes();
|
||||||
|
} catch (NullPointerException e) {
|
||||||
|
// Fix JOSM-19420
|
||||||
|
Territories.initializeInternalData();
|
||||||
|
codes = Territories.getKnownIso3166Codes();
|
||||||
|
}
|
||||||
List<ImageryBounds> bounds = new ArrayList<>();
|
List<ImageryBounds> bounds = new ArrayList<>();
|
||||||
for (Map.Entry<String, JsonValue> country : countries.asJsonObject().entrySet()) {
|
for (Map.Entry<String, JsonValue> country : countries.asJsonObject().entrySet()) {
|
||||||
if (codes.contains(country.getKey())) {
|
if (codes.contains(country.getKey())) {
|
||||||
|
|
Ładowanie…
Reference in New Issue