Skip to content

Commit

Permalink
Merge branch 'praszuk/fix/cursor-not-on-the-map'
Browse files Browse the repository at this point in the history
  • Loading branch information
praszuk committed Jul 12, 2022
2 parents 31a788d + bf5d81b commit 6836fbd
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,16 @@ public BuildingsImportAction() {
}

public static DataSet getBuildingsAtCurrentLocation(){
LatLon latLonPoint = MainApplication.getMap().mapView.getLatLon(
MainApplication.getMap().mapView.getMousePosition().getX(),
MainApplication.getMap().mapView.getMousePosition().getY()
);

return BuildingsDownloader.downloadBuildings(latLonPoint, "bdot");
try {
LatLon latLonPoint = MainApplication.getMap().mapView.getLatLon(
MainApplication.getMap().mapView.getMousePosition().getX(),
MainApplication.getMap().mapView.getMousePosition().getY()
);
return BuildingsDownloader.downloadBuildings(latLonPoint, "bdot");
}
catch (NullPointerException exception){
return null;
}
}

/**
Expand All @@ -71,7 +75,7 @@ public static void performBuildingImport(DataSet currentDataSet) {
BuildingsImportStats.getInstance().addTotalImportActionCounter(1);
DataSet importedBuildingsDataSet = getBuildingsAtCurrentLocation();
if (importedBuildingsDataSet == null){
Logging.warn("Connection error: Cannot import building!");
Logging.warn("Downloading error: Cannot import building!");
return;
}
if (importedBuildingsDataSet.isEmpty()) {
Expand Down

0 comments on commit 6836fbd

Please # to comment.