Changeset 3064 in josm for trunk/src/org


Ignore:
Timestamp:
2010-03-01T21:26:51+01:00 (14 years ago)
Author:
mjulius
Message:

in DownloadOsmTask zoom to downloaded primitives when there was not bbox given

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTask.java

    r3048 r3064  
    1111import org.openstreetmap.josm.Main;
    1212import org.openstreetmap.josm.data.Bounds;
    13 import org.openstreetmap.josm.data.coor.LatLon;
    1413import org.openstreetmap.josm.data.osm.DataSet;
    1514import org.openstreetmap.josm.data.osm.DataSource;
     
    6463                new OsmServerLocationReader(url),
    6564                progressMonitor);
    66         currentBounds = new Bounds(new LatLon(0,0), new LatLon(0,0));
     65        //currentBounds = new Bounds(new LatLon(0,0), new LatLon(0,0));
     66        currentBounds = null;
    6767        return Main.worker.submit(downloadTask);
    6868    }
     
    139139            if (dataSet == null)
    140140                return; // user canceled download or error occurred
    141             if (currentBounds == null)
    142                 return; // no data retrieved
     141            //if (currentBounds == null)
     142            //  return; // no data retrieved
    143143            if (dataSet.allPrimitives().isEmpty()) {
    144144                rememberErrorMessage(tr("No data found in this area."));
     
    156156                OsmDataLayer layer = new OsmDataLayer(dataSet, OsmDataLayer.createNewName(), null);
    157157                final boolean isDisplayingMapView = Main.isDisplayingMapView();
    158                
     158
    159159                Main.main.addLayer(layer);
    160160
     
    163163                if (isDisplayingMapView) {
    164164                    BoundingXYVisitor v = new BoundingXYVisitor();
    165                     v.visit(currentBounds);
     165                    if (currentBounds != null) {
     166                        v.visit(currentBounds);
     167                    } else {
     168                        v.computeBoundingBox(dataSet.getNodes());
     169                    }
    166170                    Main.map.mapView.recalculateCenterScale(v);
    167171                }
     
    174178                target.mergeFrom(dataSet);
    175179                BoundingXYVisitor v = new BoundingXYVisitor();
    176                 v.visit(currentBounds);
     180                if (currentBounds != null) {
     181                    v.visit(currentBounds);
     182                } else {
     183                    v.computeBoundingBox(dataSet.getNodes());
     184                }
    177185                Main.map.mapView.recalculateCenterScale(v);
    178186                target.onPostDownloadFromServer();
Note: See TracChangeset for help on using the changeset viewer.