Changeset 14374 in josm for trunk/src/org
- Timestamp:
- 2018-10-27T16:31:51+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r14357 r14374 200 200 @Override 201 201 public ProjectionBounds getDownloadProjectionBounds() { 202 return downloadTask != null ? downloadTask.computeBbox(currentBounds) : null;202 return downloadTask != null ? downloadTask.computeBbox(currentBounds).orElse(null) : null; 203 203 } 204 204 … … 346 346 } 347 347 348 protected ProjectionBoundscomputeBbox(Bounds bounds) {348 protected Optional<ProjectionBounds> computeBbox(Bounds bounds) { 349 349 BoundingXYVisitor v = new BoundingXYVisitor(); 350 350 if (bounds != null) { … … 353 353 v.computeBoundingBox(dataSet.getNodes()); 354 354 } 355 return v.getBounds();355 return Optional.ofNullable(v.getBounds()); 356 356 } 357 357 … … 378 378 layer.mergeFrom(dataSet); 379 379 MapFrame map = MainApplication.getMap(); 380 if (map != null && zoomAfterDownload && bounds != null) {381 map.mapView.zoomTo(new ViewportData(computeBbox(bounds)));380 if (map != null && zoomAfterDownload) { 381 computeBbox(bounds).map(ViewportData::new).ifPresent(map.mapView::zoomTo); 382 382 } 383 383 if (!primitivesToUpdate.isEmpty()) {
Note:
See TracChangeset
for help on using the changeset viewer.