Changeset 7816 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2014-12-17T01:49:45+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java
r7749 r7816 15 15 import org.openstreetmap.josm.data.Bounds; 16 16 import org.openstreetmap.josm.data.DataSource; 17 import org.openstreetmap.josm.data.ProjectionBounds; 17 18 import org.openstreetmap.josm.data.coor.LatLon; 18 19 import org.openstreetmap.josm.data.osm.DataSet; … … 250 251 } 251 252 252 protected void computeBboxAndCenterScale(Bounds bounds) {253 protected ProjectionBounds computeBbox(Bounds bounds) { 253 254 BoundingXYVisitor v = new BoundingXYVisitor(); 254 255 if (bounds != null) { … … 257 258 v.computeBoundingBox(dataSet.getNodes()); 258 259 } 260 return v.getBounds(); 261 } 262 263 protected void computeBboxAndCenterScale(Bounds bounds) { 264 ProjectionBounds pb = computeBbox(bounds); 265 BoundingXYVisitor v = new BoundingXYVisitor(); 266 v.visit(pb); 259 267 Main.map.mapView.recalculateCenterScale(v); 260 268 } … … 267 275 // 268 276 final OsmDataLayer layer = createNewLayer(newLayerName); 269 final boolean isDisplayingMapView = Main.isDisplayingMapView(); 270 271 Main.main.addLayer(layer); 272 273 // If the mapView is not there yet, we cannot calculate the bounds (see constructor of MapView). 274 // Otherwise jump to the current download. 275 if (isDisplayingMapView) { 276 computeBboxAndCenterScale(bounds); 277 } 277 Main.main.addLayer(layer, computeBbox(bounds)); 278 278 return layer; 279 279 }
Note:
See TracChangeset
for help on using the changeset viewer.